|
-
XRave
MC problems [HELP]
I got a MC here and it's gonna be a tic-tac-toe game, I put "stop" AS on all 3 Frames in the movieclip.
The First frame is empty, The second is cross, and the third is circle.
I placed the MC onto the stage, but now i face a AS error, I am using a made-up AS:
Code:
On(Press)
This.gotoAndStop("2")
If(This.gotoAndStop("2")
GotoAndStop("3")
Nope it's not working.
Anyone got some fresh ideas?
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Hey
Ok, first of all remember that when you gotoAndStop(); to a frame, its a number. This means that there is no " " around it
Secondly, "This" should be "this" (it will turn blue).
Finally, if thats on a movieclip, it needs to be in a handler.
Ok now try this, place the following code on the first frame of your actions layer:
code: mcInstance.onPress = function(){
this.gotoAndStop(2);
if (this._currentframe ==2){
this.gotoAndStop(3);
}
}
}
Another few reminders. Put ; after your code lines and remember that IF statments must be wrapped in {} brackets. Finally its gotoAndStop() not GotoAndStop();
If your using a premade code such as "if" , "this" , "gotoAndStop();" it will turn blue , thats a way of making sure you typed it correctly
Last edited by Osteel; 11-25-2005 at 10:02 AM.
-
XRave
Cool, Thanks.
You are saving my life here man!
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
XRave
No I got it blue alright, but its quite stupid sometimes and it don't work on me...
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Haha, well good to know you got it now
-
XRave
 Originally Posted by Osteel
Hey
Ok, first of all remember that when you gotoAndStop(); to a frame, its a number. This means that there is no " " around it
Secondly, "This" should be "this" (it will turn blue).
Finally, if thats on a movieclip, it needs to be in a handler.
Ok now try this, place the following code on the first frame of your actions layer:
code: mcInstance.onPress = function(){
this.gotoAndStop(2);
if (this._currentframe ==2){
this.gotoAndStop(3);
}
}
}
Another few reminders. Put ; after your code lines and remember that IF statments must be wrapped in {} brackets. Finally its gotoAndStop() not GotoAndStop();
If your using a premade code such as "if" , "this" , "gotoAndStop();" it will turn blue , thats a way of making sure you typed it correctly 
Wait a minuit, Flash don't reconise my instance name... What should I name it?
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
XRave
I added a stop in front of that AS mind
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
It doesnt recognize your instance name?
Give it something like 'test' and then change the code accordingly
code: _root.test.onPress = function(){
this.gotoAndStop(2);
if (this._currentframe ==2){
this.gotoAndStop(3);
}
}
}
-
XRave
stop();
_root.test.onPress = Function(){
this.gotoAndStop(2);
if(this._currentframe ==2){
this.gotoAndStop(3);
}
}
}
Still don't, the bold bit's still black....
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
XRave
Maybe i should test the movie.. I didn't bother to do that yet...
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Haha tongxn - it wont turn blue ...
Instance names will remain black. BLUE lettering is for premade built in Flash functions such as gotoAndStop(), stop(), trace();
Things like that
Sorry to confuse you
-
XRave
Nope the stop function is not working!!!
EVERYTHING HAPPENS TOOOO MEEEEEEEEEE! WYYYYYYYY?!
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
XRave
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Oh wait I see your mistake
Remember, function is LOWER CASE 
Spelling counts 
Also there is a mistake in my code too , there should only be two closing brackets:
code: _root.test.onPress = function(){
this.gotoAndStop(2);
if (this._currentframe ==2){
this.gotoAndStop(3);
}
}
Last edited by Osteel; 11-25-2005 at 01:54 PM.
-
XRave
No I don't think that works.....
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Really, I tested it and it worked fine for me ...
1) Make a movieclip and give change its instance name to test
2) On the very first frame of your main timeline, paste that code ...
3) Run the program and click on your movieclip
By the way, go to www.carpages.ca and click the games link at the top. Check out my very first (pretty cheap) car racing game
-
XRave
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
XRave
They are amazing.. How did u do the hittest on the forest bit?
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
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
|