View Full Version : load movie disaster
lizuka
02-21-2002, 04:40 PM
hi there!
I'm trying to load maroc.swf into pixs.swf but once it's loaded, maroc.swf's script doesn't work anymore.
script in maroc.swf (which is a diaporama):
on (release){
_root.tophs.play(_currentFrame+1);
if (_root.tophs._currentFrame==11) {
_root.tophs.stop ();
}
}
on (release){
_root.tophs.prevFrame();
}
pixelwit
02-21-2002, 10:36 PM
You probably loaded your SWF into a target clip. This means any reference to the "_root" will resolve to the _root of the timeline the SWF was loaded into (probably _level0). To overcome this load your movie into a level (rather than a target clip) or remove all references to _root in the SWF you are loading.
Hope it helps,
-PiXELWiT
http://www.pixelwit.com
Billy T
02-21-2002, 10:40 PM
did your post get cut off? if you are pasting code from flash use the # button up the top
anyway your problem is probably due to your paths. Where did you load the movie into? level 1?
change all the _root to _level1 and see how you go...
cheers
apprentice
02-22-2002, 02:22 AM
Originally posted by pixelwit
You probably loaded your SWF into a target clip. This means any reference to the "_root" will resolve to the _root of the timeline the SWF was loaded into (probably _level0). To overcome this load your movie into a level (rather than a target clip) or remove all references to _root in the SWF you are loading.
I'm also having the same problem. I'm confused here (as I'm still relatively new to scripting). What exactly is the difference between loading the movie into a level vs. a target clip? Isn't a target clip itself in a level other than the _level0? I tried removing all references to _root in the SWF I loaded, but still couldn't get it to work.:confused:
pixelwit
02-22-2002, 04:49 AM
Every _level has it's own _root. The root of each level is the level itself. This means the _root of _level0 is _level0. The _root of _level1 is _level1. This means if you load a SWF (swftoload.SWF) into a target clip on _level0 of "main.SWF" all the references to _root in swftoload.SWF will resolve to _level0 which is the root timeline of main.SWF rather than the main timeline of swftoload.SWF.
To make things just a bit more confusing, If you load swftoload.swf into _level1 rather than a target clip on _level0, all references to _root (from within swftoload.SWF) will resolve to _level1 which is the main timeline of your swftoload.SWF. That means all your reference to _root will continue to work without having to alter the code in swftoload.SWF.
Hope this helps,
-PiXELWiT
http://www.pixelwit.com
apprentice
02-22-2002, 05:03 AM
Thanks Pixelwit, I got it working now. :) Somewhere along the line of my learning I was confusing path levels with _levelX's. What an adventure it's been for me this past week!!
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.