Be a Supporter!

Button Problem

  • 425 Views
  • 5 Replies
New Topic Respond to this Topic
Gi-go
Gi-go
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Member
Level 28
Filmmaker
Button Problem 2007-06-13 14:23:31 Reply

Alright I have Flash CS3, and this never used to happen to me in Flash 8.
I have a button set with this code (Yes my AS is set to 2.0)

on (release) {
gotoAndPlay("OpenCredits", 1);
}

But when I click it, it just plays the same scene again. The scene that the button is on.

Whats going on?

ReNaeNae
ReNaeNae
  • Member since: Sep. 1, 2004
  • Offline.
Forum Stats
Member
Level 29
Blank Slate
Response to Button Problem 2007-06-13 14:52:49 Reply

Scenes are evil... just use frame labels and it should work :)

Gorilla-Studios
Gorilla-Studios
  • Member since: Nov. 18, 2005
  • Offline.
Forum Stats
Member
Level 28
Blank Slate
Response to Button Problem 2007-06-13 15:34:45 Reply

Yeah don't use scenes, use frame labels. Click on a frame and in the properties panel will be a input box to input your label for that frame.

To use:

_root.myButton.onPress = function() {
_root.gotoAndPlay("ILoveRenae");
};


Gorilla Studios || A game is like sex, its better when its free

BBS Signature
Snubby
Snubby
  • Member since: Dec. 4, 2004
  • Offline.
Forum Stats
Member
Level 21
Game Developer
Response to Button Problem 2007-06-13 16:08:33 Reply

Try a frame label instead, they are more reliable. On the frame you want to play, make a keyframe and on the Properties Inspector type in a frame label. Then just say,

on (press)
{
_root.gotoAndPlay ("nameoflabel");
}

ReNaeNae
ReNaeNae
  • Member since: Sep. 1, 2004
  • Offline.
Forum Stats
Member
Level 29
Blank Slate
Response to Button Problem 2007-06-13 16:36:34 Reply

At 6/13/07 03:34 PM, Gorilla-Studios wrote: _root.myButton.onPress = function() {
_root.gotoAndPlay("ILoveRenae");
};

LOL!! That's the best frame label ever!!! <3

ChilliDog
ChilliDog
  • Member since: Feb. 16, 2007
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Button Problem 2007-06-13 16:42:37 Reply

At 6/13/07 02:52 PM, ReNaeNae wrote: Scenes are evil... just use frame labels and it should work :)

Are you just saying this for CS3?
Because I'm using Flash 8 and I've never had a problem with scenes.
I use code identical to what he posted.


AS: Main

Don't read this sentence.