PDA

View Full Version : SWF not working in Flash Movie


kepler
08-06-2005, 08:51 PM
Hi,

I've a little problem... I have a main Movie where I want to load a second one, a swf. There's no problem in doing that - I've created an empty movie clip, gave it an instance name, add it to a new layer in the timeline and placed the _root.Name_of_instance.loadMovie("movie.swf") expression to load it. In fact it loads.

Just one problem: if I integrate the swf in a php page, for example, it runs and works; if I place it inside the Main Movie, it doesn't...

Any ideas?

Kind regards,

Kepler

oldnewbie
08-06-2005, 09:26 PM
You mean the loaded movie works fine on it's own, but doesn't anymore when loaded in another main movie?

If so, do you have references to _root in this external movie?

And are you on MX only or MX2004?

kepler
08-06-2005, 09:32 PM
Hi,

Yes, I have references to _root in the swf I wish to load to the main movie. I'm working in Flash MX only, I think.

Kind regards,

Kepler

Ricod
08-06-2005, 10:44 PM
As oldnewbie suspected, you need to change that.

Check out this tutorial on paths : http://www.actionscript.org/tutorials/beginner/paths/index.shtml

You see, _root no longer refers to what it used to refer to. It now refers to the main timeline of your main movie so to speak.

oldnewbie
08-06-2005, 10:46 PM
Most likely that's what's causing the problem, since when loaded in a container clip of another main movie, references to _root now wrongly point to the root level of the main movie rather than the root level of the loaded movie itself...

If you actually are on MX only, you have but 2 solutions...

Load the movie on another level (loadMovieNum), or change all your references to _root in the external movie to the appropriate this and/or 1 or more _parent's...

If you're on MX2004, but only on MX2004, you could use _lockroot...

http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001522.html

kepler
08-07-2005, 09:16 AM
Hi,

I don't understand: I signed to be notified of replyes to this thread, and I didn't received more than 1.

Well, the problem is solved.

Thanks to all.

Kind regards,

Kepler

Ricod
08-07-2005, 10:00 AM
I think you won't get anymore notifications untill you've revisited the thread in question. Any reply after that will get you a new notification. This reply will probably get you one. ;)