Skip to main content
Participant
March 21, 2008
Question

New to ActionScript...stopping/playing movie

  • March 21, 2008
  • 2 replies
  • 361 views
I'm new to ActionScript (within days). I've been thrown this project which has a few simple Flash elements.

One is five photos that need to fade at different times to another. I've made these movie clips that loop. However, I'd like them to start playing at different times so there is always one photo changing.

Therefore, the first frame should stop all but one movie clip from playing. 10 frames later the clip called Photo2 should start, 10 frames later Photo3, etc.

I've tried:

Photo2.stop(); on the first frame (applying the same to the other four clips). But I get an error that says "Access to undefined property [movie clip name]". I've used Photo2.play(); as the frame event when I want to start the clip playing. The above error is given to me on those events as well.

What am I doing wrong? This seems pretty simple but it's absolutely giving me fits.
This topic has been closed for replies.

2 replies

Participating Frequently
March 21, 2008
Sorry, I meant the MovieClips containing the photos.

Alternatively, on the last frame of each of the MovieClips you could add:

stop();
this.gotoAndStop(10); //REPLACE 10 WITH THE STARTING FRAME
Participating Frequently
March 21, 2008
Have you given the photos instance names?

Also, if you are uncomfortable with AS, you could just start the first image at frame 1, drag the second image over to frame ten so that it starts there and start the third image at frame 30 etc.
JerAufAuthor
Participant
March 21, 2008
I haven't given the photos instance names as they contained within movie clips. Therefore, they don't need any control. I see this as a timeline issue. I want the movie clips to play at certain frames. The movie clips loop. So the scene timeline only controls when they begin playing. The clips need to continue looping at the same pace while the user is on the page.

Photo1 plays at frame 10. Photo2 plays at frame 20. Photo3 plays at frame 30. Photo4 plays at frame 40. Photo5 plays at frame 50. Once each movie begins playing, the movies will loop independently of the main timeline. Therefore Photo2 - 5 needs to stop at frame 1. And each begins playing as above.

This seems like a simple problem to me and the solution just isn't occurring to me.