Avatar of velob53
velob53

asked on 

Is it possible to get a movie clip to stay on its last frame?

I need to get a movie clip to play, and then to stay on its last frame. I have several clips on one layer in one place on the timeline. When any of them are clicked on, they change appearance, then tellTarget (_root) gotoAndPlay(frame of _root). Problem is, when the movie returns to the original place on the timeline, the clips have reverted to their initial appearance.

I tried putting a stop on the last frame of each movie clip, but that doesn't seem to work. And help would be appreciated.
Adobe Flash

Avatar of undefined
Last Comment
velob53
Avatar of AgentSmith007
AgentSmith007

On the last frame of the movieclip you could assign a stop(); action. This is the easiest way to do it. Are you looking for something that will programmatically implement this on a movieclip ?
Avatar of AgentSmith007
AgentSmith007

If you need to do this programmatically, here is a little block of code that will apply this functionality to a movieclip with an instance name of "mcTest"

mcTest.onEnterFrame = function(){
      if(mcTest._currentframe == mcTest._totalframes){
            mcTest.stop();
      }
}
Avatar of velob53
velob53

ASKER

I tried a stop action but it seems to ignore it. It's as if it reloads the movie clip whenever it goes back to frame where the movie clip sits. I need the clip to disappear.

The above had no effect.
ASKER CERTIFIED SOLUTION
Avatar of Savong
Savong
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of run_logan_run
run_logan_run

This worked for me.

In the movie clip, add a layer and call it something like "actions". On the last frame of the clip, add a keyframe in the "actions" layer. Put some action script in this frame which is basically a flag saying that we got here. Like this:

_root.got_here="yes";
stop();

In the first frame of the actions layer add a keyframe and in this keyframe enter this code:

if (_root.got_here =="yes"){
  gotoAndPlay(lastframe);
}


*make sure you define the lastframe (as [clipName]._totalframes) or hard code it.

set the clip to start on frame 2 (so there is no noticable jump)

Then once the clip plays once, next time it will jump to the last frame and stop.


Avatar of AgentSmith007
AgentSmith007

I'd be willing to bet that, since actions are not working properly that your "moveclip" is not in fact a movieclip. From the main timeline, click on the item & view it's properties. It may in fact be getting treated as a graphic. You can change the behaviour by changing this to a movieclip, then the actions will work just fine. You can also do this by selecting your graphic and (using F8) converting this symbol to a movieclip. Let me know if this helps.
Avatar of blue-genie
blue-genie
Flag of South Africa image

From your original description, I think i'd agree with AgentSmith, it seems you've created multiple "animations" on your main timeline.

i'd suggest posting ur fla somewhere so we can have a look at what it is u're doing.
blu.
Avatar of velob53
velob53

ASKER

You rock, Savong. As usual, it's something simple.
Adobe Flash
Adobe Flash

Adobe Flash (formerly Macromedia Flash) is a cross-platform multimedia and software platform used to embed animations, video, and interactive applications into web pages and desktop and mobile applications and games. Flash displays text, vector and raster graphics to provide animations, video games and applications. It allows streaming of audio and video, and can capture mouse, keyboard, microphone and camera input. The ActionScript programming language allows creation of interactive animations, video games, web applications, desktop applications and mobile applications.

29K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo