Blog Archives

FlashDevelop with ASC2 compiler

In case you haven’t heard Adobe has released a new compiler for Flash and ActionScript. The new compiler does exactly what the legacy does, and mostly without any changes, but faster and better. Or at least that’s what it is supposed to do, but it’s still in Beta. So far you could only try it with Flash Builder 4.7 but thankfully there is a workaround for flashdevelop.

This post is based from this one by Alama, so in case you know French go on and prefer his guide.

Read the rest of this entry

How an embedded swf messes up your code and how to avoid that

When you embed another swf into your code, maybe this operation will break everything appart. That depends on the classes you use. If these classes have same names but different functions here’s your reason.

The problem is that these swfs share the same application domain. You have to set a LoaderContext with the parameter allowCodeImport to true, but if you want to make them completely seperate, then in the same LoaderContext you’ll have to set a new ApplicationDomain. That sets the two swfs seperate, but that also means that both of them can’t communicate with each other, and neither share the same stage property. So you won’t be able to dispatch any events, except set the initial LoaderContext parameters.

That thing took me some hours to find out…

One last, maybe useful thing. You can also embed a swf, but it won’t work as is. The embed must set the mimeType=”application/octet-stream” variable. That’ll make the swf a ByteArray. After that, you can load it with a Loader, as you would load an external class by instantiating with the new keyword.