Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

attach MC stops working when loaded into another SWF?

Status
Not open for further replies.

styleBunny

Technical User
Jun 20, 2002
133
AU
hiya,

i was able to attach librairy members to an empty clip(on the main timeline) from within another movieclip (on the main timeline). this worked well.
_root.descript.attachMovie("media", "media", 5);

now i have published that swf and when i load that very same swf into an empty movie, from another swf, the attachMovie script no longer works.

If i load my original swf onto a level,
loadMovie("2001_menu04.swf", 5);
the attachmovie still works, but then i load it into an empty clip like this:
loadMovie("2001_menu04.swf", loadIn);

the attachmovie from the original file stops working,
i spose its about changing the reference/target in this line somehow :
_root.descript.attachMovie("media", "media", 5);

i prolly in over my head but, but if i stare at it long enough the answer will come :|

thanks
p.
 
myMovieClip.attachMovie( idName, newName, depth)

First IMHO, it's not really a good idea to use the same name for your attached movie clip... That could get you in trouble. Also note that the third parameter is a depth and not a level.

Second, when loading on a level, you should really use (if only for sake of clarity!) loadMovieNum rather than loadMovie alone.

Last, when loading in a container clip, your reference to _root, is what is keeping it from working.
You would either have to add the container's instance name in the path, or use this and/or _parent depending, rather than _root.

The reason it does work when loading on a level, is because then _root, refers to the root level of the loaded movie itself, and not the root level of the main movie.

Regards,

cubalibre2.gif
 
splendid, all fixed now thanks so much :)

a few questions to settle my own curiosity (feel free to stop reading here.)

what is the difference between a level and a depth?

like wise loadMovie and loadMovieNum? use loadMovie when i was loading an SWF into a container movieClip and loadMovie when just loading into ontop? is that right?

the reason i used _root was because i was having problems targeting my container clip from within another movieclip, so i fixed this, (prolly cos i wasnt using 'this' in the first place)its all about the scope right?

thanks olds
p.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top