AS 3
- Started
- Last post
- 9 Responses
- redant
ok any help is app. I'm creating a flash interactive type presentation. to load things I'm using addchild() when a button is clicked. So It loads mc's (more than one) from the library. That is fine, but when I click a different button I want to load a different clips from library then remove the other ones, but I keep getting errors as if the other instances are not defined so I can not remove them.
btnscroll.addEventListener(Mouse... onBtnScrollClick);function onBtnScrollClick(evt:MouseEvent...
TweenLite.to(evt.target, .25, {tint:0xEB772E, alpha:1});
TweenLite.to(btnentername, .25, {tint:0xffffff, alpha:1});var directoryscroll:MovieClip = new Directory01();
MovieClip(loadhere).addChild(dir...btnentername.addEventListener(Mo... onBtn01Click);
function onBtn01Click(evt:MouseEvent):voi... {
removeChild(directoryscroll);something like that.
- mikotondria30
try adding them using AddchildAt(n), then removeChildAt(n)..
- redant0
is that levels? I'll try.
- mikotondria30
be aware that when you add a child 'at', you can only 'insert' into the current 'stack', or go on top, there cant be any 'empty' levels, so when you insert once, the rest will shove up, and conversely when you remove a child at, then the rest drop down..
- redant0
if i addChild in the same (n) does that remove whatever is there currently?
- acescence0
loadhere.addChild(directoryscrol...
loadhere.removeChildAt(0);
loadhere.addChild(anotherClip);
- skelly_b0
No, redant, when you add something to the displayList things shift around to make room. This is very different from depth and levels in previous version of AS.
Also be aware when you remove something from the displayList it is still there, you just can't see it. Because of this you don't need to reload or reattach those MC everytime you click.
may want to read up on the displayList.
http://www.adobe.com/devnet/flas…
- redant0
i have been reading some. It's alot to grasp for me. Is there anyway I can zip my fla and send to you guys and when u get a chance give me some advice on if I am going in the right direction? I'll check out the link thanks!
- skelly_b0
drop me an email, I can take a quick peak.
- redant0
done. tanks.