Commandline scripting in PHP 5

At TriMM I am working on an eLearning environment consisting of a core engine and some 500 swfs (and growing). Some of these locations are very simple, like an image with hotspots and some are more complex such as an emailclient. The engine is refactored now and then, and extended, in addition the requests for some of the locations themselves might change.
All the work is done by different people in different roles, and some location versions might or might not be compatible with certain version of the core engine.

Why am I telling you this? Because I switched from Flash to PHP because of this? 🙂 No way.

But I do have to write a script to automate the release process, which will collect the latest versions of all location swf’s that go with a certain core engine version. I thought about using Ruby or Python for that, but since TriMM does a lot of Java, PHP and Flash, I decided it had to be one of those 3.

My first choice was PHP since it is a scripting language and doesn’t have to be compiled. Having written a little bit in it, I’m not so sure if I’m gonna stick with my choice since me and untyped functional languages dont really match, but okay okay I’ll try.
Read more

Wrapping function calls in ActionScript 2

Also known as:

  • debugging function calls
  • displaying the name of a called function
  • tracing function calls director like

Today I finally got to try something I had been wanting to try for a long time: wrapping function calls in a nice way.

I had been playing around with function pointers etc, which was ok in itself, but I was forced to create the messy pointer bit each time over again. So I implemented a FunctionWrapper class.

Say we have a class Test, with a method testMethod.

Now we want to execute some code before calling testMethod and after calling testMethod. “Well write another function to do so”, you might say. Of course that is one option, but assume we are looking for another way to do so (I’ll discuss some scenario’s in a minute).
Read more

Local Flash Content and SSL

We are in the process of migrating one of our largest eLearning systems to SSL and Active Directory. Some of the Learning Objects within this system are pretty complex and I’ve implemented a mechanism which allows you to test them standalone.

However during the migration to SSL these objects stopped working when run locally, from the IDE or from FlashDevelop.

I tried to wrap my head around why this was happening, since I’ve been doing less and less with serverside content and certificates these past few years.

Luckily I found this URL which described the problem quite accurate.

Http:// content cannot always access https:// content it seems, but the invalid security certificate was the biggest issue for us.

Our system admin Roy Olthof quickly jumped in, installed a valid certificate and tadaaaaa. Local content could access https content again. Note that we were accessing https content on our own test server, which didnt have a certificate installed.

In addition the Flash content kept giving me the mixed content (secure and unsecure) warning. After changing all the http://’s in the macromedia/adobe codebases (contained within the object and embed tags) this disappeared as well.