Weird Problem

I have an .swf that works fine if I test it alone. However, If I load this .swf file from another Flash movie it doesnt function correctly…What’s Up?

Here is the .fla…

Then in another Flash program I have something like…

on(release)
{
_root.loader_mc.loadMovie(“ranMovSq.swf”);
}

Thanks All

_root is the first timeline in the hierarchy.

When you load a movie into another movie, the _root timeline of the movie you load in becomes the _root timeline of the movie you load into.

So… unless loader_mc is on the _root timeline of the main movie and not the movie you load in, it wont work.

You would need to use proper targeting of your clip and that can vary depending on where your button is placed or what kind of button you are using (button symbol or movieclip symbol)

Targeting is a very important aspect to actionscript in Flash, here are some good tutorials that may help you…

Relative Addressing:
http://www.kirupa.com/developer/actionscript/tricks/relativeaddressing.htm

_root, _parent, and this:
http://www.kirupa.com/developer/actionscript/tricks/root_parent_this.htm

loader_mc is obviously in the movie that loads the other movie. I use this same functionality loading another .swf and it works fine. The difference is that with the one that works there is no code in its onLoad event, and in the one that does not work there is a lot of initialization code in onLoad. So I’m lead to believe that the onLoad event is not firing…

Why?

thanks

Well how are you doing on the onLoad?

onLoad in a frame is pretty much useless since if you put the actions on the frame without an onLoad they are triggered with that frames loads anyway. onLoad is typically used for loading content in… like via loadVars() and such.