What are the key differences between JavaScript and ActionScript 3?

First of all ActionScript 3 and JavaScript are both defined in ECMA-262 so they have a lot in common. Both languages feature prototype inheritance for instance. It is however not correct that ActionScript fully implements ES4. ActionScript implements a couple of features that are not defined in ECMA-262 and some — but definitely not all … Read more

Flex’s FileReference.save() can only be called in a user event handler — how can I get around this?

Adobe does this as a sort of security measure to ensure users are the ones messing with files rather than potentially harmful code. My understanding is that they enforce this by only allowing handlers of (click?) events that originate from UI components to execute the FileReference methods, so generating your own events programmatically will not … Read more

Can I create an instance of a class from AS3 just knowing his name?

Create instances of classes dynamically by name. To do this following code can be used: //cc() is called upon creationComplete private var forCompiler:FlagFrance; //REQUIRED! (but otherwise not used) private function cc():void { var obj:Object = createInstance(“flash.display.Sprite”); } public function createInstance(className:String):Object { var myClass:Class = getDefinitionByName(className) as Class; var instance:Object = new myClass(); return instance; } … Read more

Static Actionscript code analysis possibilities

Update Nov 2018: It would appear that Structure101 (new download page) no longer has an ActionScript variant. Original answer, links outdated: Download Structure101g and select the Actionscript flavor after installing the software. I’ve confirmed that it is able to map out class level and even function call dependencies in Flex/AS3 projects, and generate a visual … Read more

Using ‘File’ to save scene object locations to rebuild later in AS3

You are trying to write a DisplayObject into the file directly, this is prevented by Flash engine due to the way Flash handles default serialization of any object. In order to save a DisplayObject into the external resource, you need to employ IExternalizable on that object’s class and any class of objects you will plan … Read more