Loaded SWF doesn’t run its code - no errors? WFT??

WTF

The other day I was writing the code for a simple animated movie. I decided to use a host flash to get the user started quickly and then create a separate SWF file for each scene in the movie. The host flash would then preload the next scene while the current one was playing. MovieHost.as would be the document class for the host movie and Scene.as document class for all the scenes. Simple right? Budget: 6-7 hours including the stop frame animations…

Well, not quite so. I created all the animations in all the swiffs, set up the hos flash to load them in, pressed command+enter to verify my effectiveness. The host flash fires up and loads the first scene but the scene’s code does not seem to run at all. And no error messages? After all this is AS3 - WTF??

I won’t bore you with the details of all my testing, but it went to the point where I started to research the use of explicit application domains and such. After some hours I found the reason, and here it it:

From the Flash documentation on the ApplicationDomain class:

“You cannot override a loaded class definition with a newer definition.”

This says it all really. Close to the top of my HostMovie.as class (where I hadn’t been for a while) I found this line:

private var _currentScene:Scene;

Even though this variable was not being used in any way, the host flash still had a compiled version of the class Scene.as when the scene swiffs were being loaded. I f you look at the comment from the documentation again you realize that of course no code from the loaded swf could run, it’s document class had been discarded in favor of the one allready existing in the host flash.

I removed the unused property definition from HostMovie.as and everything from there on went as planned.

Flash On The Beach wasn’t sold out after all

Paulo and Tink were right after all; FOTB wasn’t sold out. The tickets page was just not updated from last year and I’ve got me a ticket. Yeah!

Flash On The Beach already sold out

I checked the FOTB site about a week ago and it seems I might have misunderstood the message there about ticket sales not being open. Or maybe tickets were in fact not yet for sale at that point. Either way, those tickets must have been ripped away pretty fast […] Continue Reading…

Winter rebound

Just when all was going so well winter draws one hell of a dying breath and I get a cold. So I’m stuck in an empty house watching it snow outside with my nose running so bad I keep leaving slime tracks all over the house like a garden […] Continue Reading…

Happy St. Patric’s!

 

Grab a beer, It’s St. Patric’s Day. In the words of House of Pain: Put on your shit kickers and kick some shit!

If anyone’s wondering why I’ve been a slow poster  lately, it’s because my basement home cinema is looking like this:

I’ll be back when that is done with […] Continue Reading…

MasterPhoto.no launched!

A really interesting project I’ve been doing at work is finally live after a little over a month in design and development. I am quite pleased with the result as it is a fully dynamic (with content management system on the way) all Flash, language extendable solution.

The language menu […] Continue Reading…

Microsoft SilverLight: Light ‘em up!

I just browsed through Microsoft’s download pages to find a .NET Framework install needed for FlashDevelop when I came across this page asking me if I would like to try their shiny new Silverlight-boosted download area. Of course I was curious, so I happily OK’ed the installation link for […] Continue Reading…

Flash JavaScript Resizer - fill the browser window without cropping

Creating Flash content that fills the entire browser window right up to the chrome is nothing new. Normally it is accomplished by setting the swf’s width and height to 100% in the object and embed tags and controlling how different elements respond to resizing with ActionScript within the Flash […] Continue Reading…

Call Of Duty 4 (PS3) port opening (forwarding) for AirPort

If you play Call Of Duty 4 on PlayStation 3 (like me), chances are you’ve spent some time waiting to be connected to an online game. Infinity Ward who created the game blame your internet router for not having the correct ports opened. While this post says that you […] Continue Reading…

Happy new year from Aron!

My son wanted so desperately to wish you all a happy new year, so here he is, posing with my hat and all :-)

Aron turned 6 months on december 27. He’s full of smiles and really interesting language interpretations. He’s just about to begin crawling around. He also wishes […] Continue Reading…