views:

91

answers:

1

I currently have a single SWF file that dynamically loads other SWF files with a movieclip named 'container'. However, I am unable to manipulate anything within the dynamically loaded SWF from the main file. I'm simply loading the file with this:

_root.container.loadMovie("home.swf",0);

I tried getting the loaded SWF to play by using the code below, but got no results...

_root.container.play();

Any idea as to how I would reference the content within the container movieclip with Actionscript 2?

+1  A: 

The issue is likely that you try to play the movie before it is loaded. I suggest using the MovieClipLoader class, as this will give you events that you can listen to for when the movie is loaded and then perform actions on it accordingly.

Also, PLEASE don't use _root. That is the #1 worst practice when using AS2! Instead, always use "this" and if you need to create a global reference to your main stage, do something like this:

_global.home = this;

restlessdesign
Thanks for the tip. However, I've made sure that the loaded clip is completely done loading before trying to reference it. Either way, I'm still unable to reference the loaded SWF. Is there any way to assign an instance to it?Also, if I shouldn't use _root, but I must go up two levels, is there a better way than using "_parent._parent..." (beside using a global)?