How to load an object from library by clicking on a button?
How can we load and unload an object ( like a picture ) from our library by just clicking on a button and then unload it by clicking on an other button using as2.
Thanks for the help
How can we load and unload an object ( like a picture ) from our library by just clicking on a button and then unload it by clicking on an other button using as2.
Thanks for the help
assign the button an instance name (eg, btn) and assign the library object a linkage id - right click the library symbol>click properties>tick export for actionscript>assign a linkage id (eg, mc_id) and click ok. then use:
var tl:MovieClip=this;
btn.onRelease=function(){
tl.attachMovie("mc_id","mc",tl.getNextHighestDepth());
}
// to remove, mc.removeMovieClip();
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.