-
Two questions
I have a movieclip named physicalMenu and inside of it on frame 2 is a button named attack1Btn.
I am using the code
Actionscript Code:
physicalMenu.attack1Btn.onRelease = function() { if (players_turn == true && player_attack == false && player_magic == false) { player_attack = true; player.gotoAndPlay('attack1'); } }
to specify what I want the button to do. The problem is that its not working.
I think its because the actionscript is looking for the button on frame 1 of the physicalMenu movieclip. (If the button is on frame 1 the code works fine.)
So my 2 questions are
1. Why isnt the code working?
2. How can I make it work without adding actionscript to the individual button?
-
Prid - Outing
Where are the variables, players_turn, player_attach and player_magic located? Inside the physicalMenu movieclip, or outside of it?
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
-
Prid - Outing
Oh, I see why it's only working on frame 1. It's because you set the actionscript for the code for the button on Frame 1 of that movieclip, and they ain't refreshed when the button is on another frame. Use this code:
Actionscript Code:
onEnterFrame = function(){ physicalMenu.attack1Btn.onRelease = function() { if (players_turn == true && player_attack == false && player_magic == false) { player_attack = true; player.gotoAndPlay('attack1'); } } }
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Thanks so much! This worked perfectly!
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
|