Design Directory Discussion Forum Design Job Board Add Your Site Post a Message Post a Job / Gig

HomeDevelopers → Movie already loaded, now go to

How do I trigger an actionscript on a button that detects if a movie is loaded, and then play a framelabel of that movie.

I was able to play a specific frame label by clicking the button but I've been using loadmovie, which loads the movie again and shows a transition gap. The movie is already loaded, and then the button exists just to tell it to play an advanced framelabel "35"

I tried with tellTarget too, but not working. I think I probably have to use an IF or ELSE...

Any ideas?
Visit My Website | -Adriana www.breathewords.com www.scene360.com
This might point you in the right direction.

preloader_mc.onEnterFrame = function () {
total = this.getBytesTotal();
loaded = this.getBytesLoaded();
perc = loaded/total *100;
trace(perc);
}

yourButton.onRelease = function() {
if (preloader_mc.perc == 100) {
yourClip.gotoAndPlay("label") }
else {
loadMovie("yourmovie.swf", preloader_mc)
}
}
Visit My Website | Aaron Elliott http://www.forwardtrends.com
Hi Aaron,

Does this obligate having an actual preloader for the function to work?
Visit My Website | -Adriana www.breathewords.com www.scene360.com
No - preloader_mc is just what you are loading into.
Visit My Website | Aaron Elliott http://www.forwardtrends.com
? No - preloader_mc is just what you are loading into.

It is the empty movieclip, right? Not the actual MC with the content.

I've tried with the clip and through the process of _parent.sectionclip, etc... doesn't work. The closest I got was with:

on (release) {
loadMovie("gumballs.swf", "_parent.sectionclip");
_root.framepos = "position25";
}

---- This uses your actionscript that jumps to the label. It just reloads the film and the film is already open. There is one button to open film, and then another that triggers it to play further.
Visit My Website | -Adriana www.breathewords.com www.scene360.com
Ohhhh....

Here's a simple way to do it:

---------------------------

Each external clip that is loaded will have a line on the first frame of something like

isLoaded = true

Then on the button just have a simple if statement:

if (loader.isLoaded == true) {
gotoAndPlay
}else{
loadMovie
}
Visit My Website | Aaron Elliott http://www.forwardtrends.com
Or you could use that code I posted the first time to detect when the content of "loader" is loaded (then setting the variable isLoaded = true is it is) then do the same thing on the if statement.
Visit My Website | Aaron Elliott http://www.forwardtrends.com
Can't get it to work. Crap. I've tried it in so many ways, and even altered the movie timeline to see if that would work. I think I'll have to give up on the idea, I just can't get it to work.

Thanks Aaron.
Visit My Website | -Adriana www.breathewords.com www.scene360.com
I'll see if I can put together an example tonight for ya.
Visit My Website | Aaron Elliott http://www.forwardtrends.com
I found the solution. Finally! OMG, was I trying this for hours. Usually the answer is simpler than what is imagined, and I ended up trying something else as a last call for the day. The previous attempts were not working at all, and I noticed it called the film but it wasn't played accurately.
----------------------

ON BUTTON:

on (release) {
_parent.emptyclip.movieclip.gotoAndPlay(35);
}

---------

Since I'm using various movies all generated from the root, the button is on an external film calling another one. So I knew I had to use _parent, and then I just used the order until reaching the film. It works. Now it seems simple, but it wasn't before.

Thanks again for your help. I'll show you where I placed it, as soon as I launch my portfolio online. It is going to be rad.

I'm going to take a tylenol now.
Visit My Website | -Adriana www.breathewords.com www.scene360.com