-
Button Actionscript
I am new to this so, It may be simple to some but not to me.
I created a button it's instance name is "button1"
This is the action script
button1.onPress = function() {
trace("test");
}
This is the error I get
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Statement must appear within on handler
button1.onPress = function() {
What I tought would happen is that when I right click on the button, I would get a message "test"
what am I doing wrong?
-
village idiot
I just replicated what you told me and it worked fine for me. I get the out put, test. Make shure you are putting the action in frame one and not on the button. I think thats your problem. I dunno. Try redoing it, i did it in 2 seconds.
Last edited by BlackCow237; 02-10-2006 at 03:46 PM.
This is our world now, the world of the electron and the switch. We exist without nationality, skin color, or religious bias.
-
Banned
Yeps, works fine for me too... As BlackCow237 said, make sure that the actions is on the frame... Or maybe try to put the action on the same layer frame on which your button is ( sometimes that can occure too, but don't think that thats the prob here )...
-
-
village idiot
I could be wrong but im pritty shure that when you say on (press) it is on the button so you dont have to define its name and when you say button1.onPress it is on the main frame because you have to define the name of the button.
This is our world now, the world of the electron and the switch. We exist without nationality, skin color, or religious bias.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|