943,585 Members | Top Members by Rank

Ad:
Aug 27th, 2008
0

flash question

Expand Post »
is it possible to get flash to play x amount of frames before completing the gotoAndPlay from a button click.
Similar Threads
Reputation Points: 27
Solved Threads: 1
Posting Whiz
kevin wood is offline Offline
347 posts
since Feb 2008
Aug 27th, 2008
1

Re: flash question

yes it is possible and here is how it is done.

firstly in frame one of the timeline a variable needs to be set. i set this as

Graphics and Multimedia Syntax (Toggle Plain Text)
  1. var frame : String;

once this has been done you next need to add the

Graphics and Multimedia Syntax (Toggle Plain Text)
  1. stop();

in the frame where you want the play head to pause. As mine then had the animation after the pause for the page exit, you will need to add this code to frame at the end of the page.

Graphics and Multimedia Syntax (Toggle Plain Text)
  1. stop();
  2. if(_level0.frame != undefined){
  3. _level0.gotoAndPlay(_level0.frame); // or gotoAndStop(_level0.frame_to_goto)... If you want it to stop on that frame...
  4. }else{
  5. trace("An error as occured!");
  6. }

this section of the code is looking for a variable to be sent to it from the button being clicked on. The code to get the variable to be sent will obviously go on to the button.

the code which goes on the button is this

Graphics and Multimedia Syntax (Toggle Plain Text)
  1. on(release){
  2. // set the variable...
  3. _level0.frame = "_page1"; // assuming that's the frame's label...
  4. //play the timeline from the next frame to frame 25...
  5. play();
  6. }

this will then pause where you want it to pause and when a button is pressed it will play the animation for the page exit then take the user to the page the have requested depending on which button is pressed.

just to clear things up a bit for any novice flashers i had a layer for the actions where all the code script went to make the play head stop and play. also i hab a layer called labels which gave the variables being sent to the script a place to go to.

where you see in the script "_page1" this are the labels for the beginning of each page.

if anyone needs help with this or i have just done a bad job of trying to explain what i have done pm me and i will help as much as i can.
Reputation Points: 27
Solved Threads: 1
Posting Whiz
kevin wood is offline Offline
347 posts
since Feb 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Graphics and Multimedia Forum Timeline: Small photos to big photos on same page
Next Thread in Graphics and Multimedia Forum Timeline: Dreamweaver - Rollover graphics in a Spry Menu





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC