xboxscene.org forums

Author Topic: Actionscript Help  (Read 104 times)

yaazz

  • Archived User
  • Hero Member
  • *
  • Posts: 1370
Actionscript Help
« on: February 23, 2005, 06:17:00 PM »

hey guys, I have recently delved into the wonderful world of flash/actionscript.  
I am trying to make a tic tac toe game, and what I have done so far is add a movie clip, that basicly acts like a button, except it has more frames (an X frame and a O frame)

In the layer that the movie clip is drawn on, I have the code
QUOTE


var snackcake=1 ;



In the movie clip Itself, I have the following code

QUOTE

on (rollOver) {
   gotoAndStop(2);
}
on (press) {
   gotoAndStop(3) ;
}
on (release){
   if (snackcake=1){
   gotoAndStop(4);
   snackcake=0
   }else if (snackcake=0){
   gotoAndStop(5);
   snackcake=1
   }
}
on (rollOut){
   gotoAndStop(1)
}


It works, and when you click on it, it goes to the frame with "O" in it, but the variable does not change, and when you click on it again (after rolling off), or clicking on another movie clip (with the exact same code)  it does not change to "X"

what am I doing wrong?
 <
Logged

yaazz

  • Archived User
  • Hero Member
  • *
  • Posts: 1370
Actionscript Help
« Reply #1 on: February 25, 2005, 07:06:00 AM »

sad.gif no one knows? ahh crap, that means I ave to join another forum and ask them, and probally get flamed. Being a noob sucks. <
Logged

Comcipher

  • Archived User
  • Sr. Member
  • *
  • Posts: 421
Actionscript Help
« Reply #2 on: February 27, 2005, 09:09:00 PM »

Try going to www.flashkit.com , the entier site is nothing but flash tutorials and help, and the forums over there are really great for questions like this. <
Logged

yaazz

  • Archived User
  • Hero Member
  • *
  • Posts: 1370
Actionscript Help
« Reply #3 on: March 02, 2005, 12:48:00 PM »

I figured out the problem. I should have had if (x==1){ condition} <
Logged