Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash buttons and clips

Status
Not open for further replies.

indianlore

IS-IT--Management
Mar 5, 2002
4
GB
Hi,

I'm a Flash newbie and I need help desperately.

Does anybody know how to play a Movie Clip by clicking a button; everything else works fine but I cannot associate the clip with the button nohow; all I can do is redirect the flow of the timeline to a specific frame but this doesn't play the movie.

I know is a simple question, but one have to start somewhere.

Thanks guys.

Sept
 
first you must select your movie clip and name it in the instance panel...

then right-click on your button and attach a gotoAndPlay action to it

on (release) {
_root.square_in.gotoAndPlay(1);
}

This is assuming the movie clip is on the main timeline and is named square_in


You mentioned that it would not play by going to a specific frame on the main timeline... if you have the mc inserted on the main timeline it should begin playing once it enters that frame. Make sure you have a stop action in the same frame as the mc on the main timeline but no stop actions within the mc itself except perhaps at the last frame of the mc. Ya' Gotta Love It!

 
I must clarify a bit... the first suggestion above would require a stop action in the first frame of the mc and would only play when told to do so with a gotoAndPlay action as described above. This would work well where the mc starts off the stage or else is invisible at first. You could also have the first frame of the mc empty except for the stop() action. The button would tell it to play and that point it would move to frame 2 becoming visible and continue playing until finishing...if you do not want it to loop then you would need a stop() action at the last frame of the mc.


Suggestion 2:

If you would like it to start playing immediately upon entering frame 5 or any specific frame then the actionscript on the button should have the following format:

on (release) {
gotoAndStop (5);
}

there would need to be a stop() action on that frame of the main timeline.

There would need to be no stop() actions on the first frame of the mc. Ya' Gotta Love It!

 
Hi, TulsaJeff

You are right ... I love it; thanks to you and to the incredible Flash! community which make it practically impossible for anyone to get stuck while learning this difficult hybrid environment we call Flash!.

Keep up da good work.


Regards,

Sept
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top