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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash 2004 Button Actions

Status
Not open for further replies.

lou342246

Programmer
Jul 7, 2004
5
US
I am trying to create a slide show of pictures for my company. Each picture will be on it's own scene. I created two buttons: Next and Back. I converted each of these words to a symbols with button behaviors. Although when I go assigning the action prevScene or nextScene to these buttons nothing happens. I get errors that are reported. I really liked using the Actions in Flash MX because you could just select the scene you wanted from a drop down menu and it inserted all the code for you. (I think that there is suppose to be more than just something like nextScene(); displayed when you assign actions to a button. Does anyone know any good tutorials or know how to solve my problem? I looked online and could only find tutorials that told you have to change the UP, Over, Down, Hit instances.

Thanks!
 
Code:
on(release){
   nextScene();
}

or

Code:
on(release){
   gotoAndPlay("SceneName",1); //(scene,frameNumber)
}

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Why not use different frames in one scene, rather than several scenes?
Otherwise, try...
Code:
on(release){
    _root.nextScene();
}
// Or...
on(release){
    _root.prevScene();
}
 
Thank you both for your input. The reason I'm using scenes then just one scene with a bunch of frames is because of organization. I feel that I can be more organized when I use scenes. What I'm making is a slide show of 50 pictures that fad in during the first 15 frames of each scene.

I tried both of your input and I could only get the folowing code to work though:

on(release){
gotoAndPlay("SceneName",1); //(scene,frameNumber)
}

The problem with this code is that I have to go into each scene's actions that I move around to fix the order. I rather just have it play the next scene that it below it in the scene list than to have to edit actions every time I change the order.

-----------------
This code works but stops on the first frame of the next scene:

on(release){
nextScene();
}


------------------
I couldn't get this one to do anything:

on(release){
_root.nextScene();
}
// Or...
on(release){
_root.prevScene();
}

Thanks for both of your feedback. Let me know I set it up wrong for these to not work like I wanted them to.

Lou
 
If this...
on(release){
nextScene();
}
...Works, then use it. But you have to understand that nextScene() & prevScene() (like nextFrame() & prevFrame()) are not play actions. They move the playhead and stop it on that frame or scene.
Try adding a play(); action on the first frame of each scene.
 
I tried adding

on(release){
nextScene();
}

to each of my next buttons and

on(release){
prevScene();
}

to each of my back buttons. I have the play() function in the first frame of each scence and a stop function on the 20th frame of each scene (these two fuctions are on a seperate layer named actions)

But now my slideshow is skipping scenes! Will someone please take a look at it?


Thanks!
 
You would have to save a copy of your .fla in a MX only format, not MX2004. Use Save As... and change the Document type in the Save As... window.
 
I got it figured out. Thanks oldnewbie for your help! I greatly appreciate it! I met my dead line :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top