Friday, April 16, 2010

Reparent AVM1 content in AVM2 (AS3) content.

For whatever reason you need to reparent loaded AVM1 content to another part of the display list and you don't want to keep the loader as the parent. One would have to save the content first from the LoaderInfo instance then use the LoaderInfo loader member to unload the loaded content.

You will then be allowed to reparent the saved content elsewhere. But be warned if you try to reparent it again you will get the:

"ArgumentError: Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to a different part of the displayList when it has been loaded into AVM2 (AS3) content."

error as you would with the original. Remove the child first before you reparent.

Example from the Event.COMPLETE dispatch:
var li:LoaderInfo = e.target as LoaderInfo;
var avm1:AVM1Movie = li.content as AVM1Movie;
var l:Loader = li.loader;
l.unload();

// No error
layer1.addChild(avm1);

// No error
layer1.removeChild(avm1);
layer2.addChild(avm1);

// Error #2180
layer3.addChild(avm1);

Thursday, April 8, 2010

CS4 Class Paths

For reference:

C:\Program Files (x86)\Adobe\Adobe Flash CS4\Common\Configuration\Component Source\ActionScript 3.0\User Interface

C:\Program Files (x86)\Adobe\Adobe Flash CS4\Common\First Run\Classes

C:\Program Files (x86)\Adobe\Adobe Flash CS4\Common\Configuration\ActionScript 3.0\projects\Flash\src