----------------------------------------------------------------------------------------------------------------------
CREATE MOVIE CLIP IN AS3
CHECK BOXES SHOULD BE CHECKED
EXPORT FOR ACTION SCRIPT EXPORT IN FRAME 1
SET SAME NAME FOR SYMBOL AND CLASS : McClass
READ MORE:
https://www.youtube.com/watch?v=-46m2hi6AiE
https://www.youtube.com/watch?v=heSfdKd4PsI
http://coursesweb.net/actionscript/addchild-removechild
http://www.danfergusdesign.com/classfiles/oldClasses/VCB331-richMedia1/exercises/addingChildren.php
http://edutechwiki.unige.ch/en/ActionScript_3_interactive_objects_tutorial
http://www.flashvalley.com/fv_tutorials/attachMovie%20in%20Actionscript%203.0/
http://www.hongkiat.com/blog/10-killer-flash-tips-for-beginners/
http://www.republicofcode.com/tutorials/flash/as3events/
http://www.republicofcode.com/tutorials/flash/as3displaylist/
http://www.virtualmv.com/wiki/index.php?title=ActionScript3:Using_addChild_and_removeChild
----------------------------------------------------------------------------------------------------------------------
COPY AND PASTE BELOW CODE IN AS3
---------------------------------------------------------------------------------------------------------------------
var VARIABLE:McClass = new McClass();
addChild(VARIABLE)
-------------------------------------------------------------------------------------------------------------------
var mainmenu:MovieClip = new menu(); // assigns the menu movieClip to the variable mainmenu so we can use it stage.addChild(mainmenu); //adds the mainmenu movieClip to the stage mainmenu.x = 25; //sets the x position mainmenu.y = 10; //sets the y position
----------------------------------------------------------------------------------------------------------------------
// Recording CLICK event for the button on the stage, "remove_bt"
remove_bt.addEventListener(MouseEvent.CLICK, removeIns);
// The function called by the registered event
function removeIns(evt:MouseEvent):void
{
removeChild(txt); // Delete's the element with the instance "txt"
}
-----------------------------------------------------------------------------------------------------------------
http://flashgameu.com/book_source_files_2.html
-------------------------------------------------------------------------------------------------------------
// create 10 movie clips with MovieClipClassName in as3
// MOVIE CLIP SYMBOL PROPERTIES CLASS = MovieClipClassName();
// scale 25%
for(var var1=0;var1<10;var1++) {
var var2:MovieClipClassName = new MovieClipClassName();
var2.x = 50*var1+50;
var2.y = 300;
var2.scaleX = .5;
var2.scaleY = .5;
addChild(var2);
}
-----------------------------------------------------------------------------------------------------------------
http://www.kirupa.com/forum/showthread.php?300399-MovieClip-null
--------------------------------------------------------------------------------------------------------------------
MovieClip = null ?
Here is my code:
Code:
var my_mc:MovieClip = new MovieClip();
addChild(my_mc);
//
my_mc.some_variable="as3"
trace(my_mc.some_variable);
removeChild(my_mc);
trace(my_mc.some_variable);
If can remove movieclip but cant remove its data? I tried this:
Code:
var my_mc:MovieClip = new MovieClip();
addChild(my_mc);
//
my_mc.some_variable="as3"
trace(my_mc.some_variable);
removeChild(my_mc);
my_mc=null;
trace(my_mc.some_variable);
---------------------------------------------------------------------------------------------------------------------
Add ENTER_FRAME event listener and do whatever you need once
the past frame is reached:
http://www.postseek.com/meta/5ecff0dfd7f515d54c6301288a1e23c7
this.addEventListener(Event.ENTER_FRAME, enterFrameListener);
function enterFrameListener(e:Event):void{
if(currentFrame == totalFrames){
chip.visible = true;
}
}
EmoticonEmoticon