PDA

View Full Version : Get Frame from MovieClip


binacaboy
10-27-2008, 10:12 PM
I currently have 2 movie clips in scene 2 (scene 1 is my intro movie clip/preloader).

The first movie clip "bg_mc" is a background clip that displays a sideshow of several pictures that cycle through for eternity.
The second is a movie clip "gray_mc" with two buttons on it.

I want the buttons to stop the bg_mc movie clip from playing, and then fade into another picture for scene 3. Currently my actions on the buttons are as follows:

on (release) {
_root.bg_mc.stop();
_root.gotoAndPlay("S3F1");
}

This stops the background and moves the timeline to S3F1 or "scene 3 frame 1"

My question is how can I get the stopped frame from bg_mc to display in a layer in scene 3? Because i want to fade from this stopped frame to a new picture all together, like a sideshow transition. I basically just need to copy this stopped frame into either a movie clip or into scene 3 so it won't just disappear into white. Is there any way i can copy the current frame of that movie clip after it is stopped by pressing the button?

Thanks in advance
I'm using Actionscript 2.0 btw.

alile
10-27-2008, 10:29 PM
i would recommend NOT using scenes - they are an added level of complexity, and you can get all the same results using key frames. That said, you really don't want to copy the frame of the mc (nor can you, afaik). You can copy movieclips, or at least library assets, but that is not wanted here.

What would likely be best is to have the two items on stage at the same time, and fade out one as you fade in the other. So have the bg_mc buttons on a layer above the scene 3 assets (but move them to the same timeline as the buttons), and then fade.

hth

binacaboy
10-27-2008, 10:51 PM
Not sure if i was too clear on this sorry.

bg_mc is a picture slide show running in the background. In the foreground I have a gray bar with buttons on it. Upon clicking one of these buttons i want the background to bg_mc to stop, and then i want a new picture to fade in, a picture that is separate from the slide show, maybe in a new movieclip. During this time The gray bar will remain in the foreground but move to the top of the screen. In order for this to work i need a way of referencing what frame the background slide show stopped at.

http://www.calcoasttrack.com/mph/mph.html

there's where i am right now, as you can see the background when clicking on the services button turns to white then to the new picture, because i currently have a movie clip set up for that transition. I want to reference that stopped clip from the beginning slide show.

alile
10-27-2008, 11:28 PM
having a link to the project makes this much easier to understand, thanks. i assume you are telling the bg_mc to play(), rather than gotoAndPlay("someFrame"), yes? either way, bg_mc._currentframe will give you where the play head currently is, and you can store that value in a variable for future reference, if you like.

Or, you can have two copies of bg_mc on stage (but with different names), and so if you want to move one to the same frame as the other (and i am not quite understanding your problem, methinks), you could do this:

bg_mc2.gotoAndStop(bg_mc._currentframe);

useful?

binacaboy
10-28-2008, 08:12 AM
I understand that code

bg_mc2.gotoAndStop(bg_mc._currentframe);

but where do i apply it? When I press the services button this code is initiated...
on (release) {
_root.bg_mc.stop();
_root.gotoAndPlay("S3F1");
}

I don't apply it to the button action. Do I apply it to the first frame of the layer with bg_mc2 on it? neither of those are seeming to work for me, rather it just starts at the beginning of the movie clip, as though it ignores the code.

If you want a copy of the fla file just say so.