Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-07-2008, 11:51 AM   #1
samWhisker
Senior Member
 
Join Date: Jul 2005
Posts: 117
Lightbulb as3 removing parent clips

hi all, i am new to this as3 thing, so a little bit of a newbie question, which is pretty fundamental i think!

so in (the good old days of!!) as2, i was able to do something like this

Code:
//create a new mc
var m = createEmptyMovieClip("m",1)
//attach 2 mcs
var mc2 = m.attachMovie("main_movieclip","_mc2",2)
var mc3 = m.attachMovie("main_movieclip","_mc3",3)
so if i wanted to remove mc2 for instance i could just remove it, if i wanted to remove both mc's i could remove the parent movie 'm' and both the attached movie clips would be removed!!

so how do i replicate that, i have this in as3

Code:
var m:MovieClip = new MovieClip();
m = new headUp();
addChild(m);
m.name="b1"
m.x=100;
m = new h();
m.name="b2"
addChild(m);
m.x=200;
if i want to remove ' m.name="b1" ' easy, but if i want to try and remove both and try and remove the parent 'm' movie clip, only the last attached child would remove, in this case ' m.name="b2" '

so how do i remove both children in one go? surely removing the parent is the obvious method? do i have to attach the children at different levels?

I guess i am been stupid, but some advice would go down well here:-)

Thanks in advance Sam
(serial poster!!!)
samWhisker is offline   Reply With Quote
Old 03-07-2008, 01:47 PM   #2
straydog
Hands Resist Him
 
straydog's Avatar
 
Join Date: Jun 2006
Posts: 180
Send a message via AIM to straydog Send a message via MSN to straydog
Default

attach the second child onto the first one then when you remove the first child, both should go
straydog is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
removing whitespace from a jpg Cyprus106 ActionScript 3.0 2 02-16-2008 05:23 AM
Removing multiple movie clips LeahSmart ActionScript 2.0 10 09-20-2004 11:51 AM
calling a function from movie clips parent peterbelsky ActionScript 2.0 0 07-28-2004 08:01 PM
Can loaded movies be attached to their parent clips FILF ActionScript 1.0 (and below) 2 10-31-2001 12:17 PM
removing movie clips hanchinliu ActionScript 1.0 (and below) 3 03-01-2001 03:19 PM


All times are GMT. The time now is 08:56 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.