PDA

View Full Version : set interval


BuffySummers
08-06-2003, 11:16 AM
I am trying to pause my movie with setInterval. It works great by itself, but when I try to load it into another movie, the setInterval doesn't work (the movie just stops.) I placed the setInterval in a movie clip on the stage of the movie to be loaded in hopes that would help...it didn't. I can't reference _root at all because I am uncertain what the loaded movie's instance name is (thrown into a previously existing project with no one around who knows anything about the Flash portion of the project.)

nextone = function(){
_parent.gotoAndPlay("hello");
}
int1ID = setInterval(nextone, 5000);
_parent.stop();

Ricod
08-06-2003, 12:14 PM
Do you load it into the other flash file into a holder mc, or into another level ? You see, either way, the path changes. But if you loaded it into a holder mc, the main timeline of the other flash file will now be targeted using "_root".

This is a path problem, not a setInterval problem. So, what's your setup ?

In the meantime, take a look at the paths tutorial : here (http://www.actionscript.org/tutorials/beginner/paths/index.shtml)

BuffySummers
08-06-2003, 12:25 PM
I don't know if it is a level or movie clip that the loaded movie ends up in. I don't have access to the file that actually plays the whole movie. All I know is that this movie is loaded somewhere at run time. Not having that information has made other things difficult as well.

Ricod
08-06-2003, 01:35 PM
I'm just thinking out loud right now ... but what if you remove the whole _root and _parent reference at the moment. Is the "hello" frame on the same timeline as your "nextone" function ?

BuffySummers
08-06-2003, 02:58 PM
I originally started without references to _parent or _root, simply gotoAndPlay("hello"). It works perfectly when played off my desktop, but not when called in the "unknown movie".

Thanks for helping, btw.

Ricod
08-06-2003, 04:24 PM
Do you mean that the function is being called from "the unknown movie" ? I could well be that the function isn't called correctly then.

BuffySummers
08-07-2003, 04:56 AM
No, sorry (realizing that I didn't really make sense with that last one)...I meant that when the movie with the setInterval is called up in the unknown movie the setInterval doesn't work. The movie with setInterval in it does work when it is played by itself from Flash or if double-clicked off of the desktop.

Ricod
08-07-2003, 11:46 AM
Okay, but I still don't know where the setInterval-using function is (pathwise), from where its executed and how, and where the swf is loaded in.