|
-
1> If you are getting 1010 you var is set wrong.
You will have
You want
The "" means it processes the var as a string so you are asking it to add 10 to the string ie 10+10=1010, without the "" it becomes a math problem 10+10=20
2> Your Actions Frame want to be at the highest level and spam the few length ie
My example shows the timeline
_root level
actions - F1 -> F10
Movieclip - F3 -> F4
Our Root level spans 10 frames in this instance, the actions covers all 10. You want to cover all your frames with the action line.
If you go to a frame without the var on it, when it next goes to a frame with it, will reset.
3> Try to avoid buttons, you want your code at the highest level possible to avoid issues, and make decoding easier.
You can use a movieclip as a button, and the following code on the _root timeline actions.
Code:
myButton.onPress = function(){
gotoAndPlay("styxgood1");
exp += 10;
mymc.Styxexp += 10 ;
}
Out of interest why do you have 2 exp vars in 2 different places?
This is a image from one of my project to show you what I mean by the actions covering all.
fk1x.png
Trust my code, and not my english.
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
|