-
Actionscript 2.0 Buttons?!!?
Hey all,
Having a bit of trouble with actionscript 2.0 in Flash CS3 PRO.
On scene 1, layer 6, frame 1 I have stopped the animation. On frame 1, I have a button with a title, I want it so when i (press) it goes to frame 2. The problem is that when I test the scene, a syntax error comes up:
1087: Syntax error: extra characters found after end of program. on (press) {
I know its something simple, what am I missing. We are just learning it.
Thanks
-Calvin
-
Ryan Thomson
when you say the button has a title do you mean an instance name on the properties bar? If so remove the code you applied to the button, then below your stop action on the timeline put this:
yourbuttontitle.onPress = function(){
gotoAndStop(2);
}
where 'yourbuttontitle' would be replaced with whatever instance name you called your button. Not sure what's wrong with yours without seeing it, but if your just learning i highly recommend doing it this way, much better coding practice.. if you need an example let me know welcome to flashkit
-
Hey,
Thanks for the the code but it isn't working. How come i'm not allowed to right-click on the button and do the actions inside the instance but with CS3 i have to do it in the layer unlike Macromedia Flash. Here is the error:
1119: Access of possibly undefined property onPress through a reference with static type flash.display:SimpleButton. sceneplay.onPress = function(){
Its all on the same layer.
-
It sounds like you don't have your publish settings set to Actionscript 2 (they're Actionscript 3 by default in CS3). Are you positive you've set it to Actionscript 2?
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
|