PDA

View Full Version : Buttons arrgghh


snowbabe
07-22-2005, 05:27 PM
I forgot how to do it.. has it really been that long?

Ok, I did a button that changes colour on the "over, down & hit" state.. BUT.. where do I script the button?

Basically I have the 1st scene completed.. and I have a stop on the scene... this button is to take the user to the next scene.. .. how and where do I put the action script to make it work.. ?

I would appreciate any help.. thanks : )

Cota
07-22-2005, 05:38 PM
Generally, most button actions are in the on(release) handler. There are a few ways to go about that. The old fashioned way, or the dynamic, all through code way. The old fashioned way is smiple click on one of the button states, bring up the actions panel, and code away.

snowbabe
07-22-2005, 05:52 PM
I went to the button symbol in the library, double clicked it to bring the 'states' up.. I then opened the actions palette and cannot do anything to it.. I get the message...

"current selection cannot have actions applied to it"

I havent done this in a loong time & I used to be able to.. what am I doing wrong? The only tutorials on buttons I can find explain the different states & nothing about what the script should say - or where it goes..

I'm tearing my hair out with frustration because I know the answer is simple & I will kick myself.

Cota
07-22-2005, 06:00 PM
Its been awhile for me too, I dont remember if you had to add a keyframe or not. Or you can just apply the actions directly to the button while its on the stage.

snowbabe
07-22-2005, 10:41 PM
My coding..

ahead.onRelease = function () {
gotoAndPlay("scene1","frame1")
}

I think the coding is right as I don't get an action script error prompt, but it doesn't work at all when I enable buttons & actions .. OR when I export the movie..

The button appears on frame 50. so I made a new layer, entered a keyframe on frame 50 of that & opened the action script panel.. that is where I entered the script..

Can anyone tell me what I have done wrong?

Or point me in the direction of a GOOD tutorial that doesn't just show the up over down & hit states.. I can't find one anywhere after looking for the past 4 hours..

EDIT: I now know about "instance names" in the properties panel.. .lol.. I solved it in the end.. took me like 4 & a half hours but still.. thanks for the help from ppl, always apreciated

Cota
07-23-2005, 12:30 AM
Yeah, instance names are important.... :D
One more thing for you to consider, its my opinion, and the opinions of many others, that you try your best to avoid scenes....they are buggy at best.

snowbabe
07-23-2005, 01:46 PM
thankyou for the advice.. what do you suggest otherwise?

Cota
07-24-2005, 01:37 AM
I just use a variety of movieclips....I also find it easier to keep track of everything and I just feel like I have more control using movieclips....

snowbabe
07-24-2005, 06:30 PM
movieclips?

You mean make a new movie for each stage & load that up instead of going to the next scene?

Cota
07-25-2005, 06:10 AM
Exactly....