AS3 attachMovie() from Library
AS2 fans, you will no longer be using attachMovie() to attach items from the library to the stage. ActionScript 3 removed the attachMovie() function. Now you have to write 2 lines of code to attach an item from the library. It is pretty simple.
AS3 code example - Attaching Item from Library
AS3 code example - Removing Item from Stage
download as3_attachMovie_example
AS3 code example - Attaching Item from Library
unloadMovie() has also been removed in AS3. Instead of using unloadMovie(), you need to use removeChild().var item:item_one_mc = new item_one_mc(); //first declare library item
this.addChild(item); //add child to the stage
AS3 code example - Removing Item from Stage
The example below uses AS3 to attach an item from the library then remove it.this.removeChild(item);
download as3_attachMovie_example




still learning AS3. It feels like I need to relearn the basics.
Reply to this