Ultrashock Forums > Flash > ActionScript
Trying to recreate loadmovie with As3......addchild problems.

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Trying to recreate loadmovie with As3......addchild problems.
Old 2009-07-04

I want to load in external swfs into an mc on the root called 'holder'.

In As2, I would just do loadMovie("whatever.swf", this.holder);

And if I loaded another swf into that same holder it would replace the contents with the new swf.

But now, I'm trying As3 and doing...
var i =new Loader();
i.load(new URLRequest("contact.swf"));
this.holder.addChild(i)

When I repeat this code, for another external swf, I want it to replace the first one, but it appears to not be doing that. I fear that this addChild, is simply adding more mc's within my main holder mc.

So I don't know how to match the functionality that I liked from As2. Help?
postbit arrow 1 comment | 162 views postbit arrow Reply: with Quote   
Registered User
dtrace is offline
seperator
Posts: 281
2002-06-21
dtrace lives in United States
seperator

Ultrashock Member Comments:
Isocase's Avatar Isocase Isocase is offline Isocase lives in United States 2009-07-04 #2 Old  
Take a look at the Flash help documents and read up on removeChild() and removeChildAt(). You can use either of those to get rid of the first mc and then load in the second.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: