-
I would like to operate a button code without having to use the hard coded go to and stop/play scripts in the button options.
I have a random generating script that I used in Hippani and would like to use this to play animations unfortunately the GotoAndStop(1) commands in my code do not work in KM:var R=Math.floor((Math.random()*6)+1);
if(R==1){GotoAndStop(0);
}
if(R==2){GotoAndStop(1);
}
if(R==3){GotoAndStop(2);
}if(R==4){
GotoAndStop(3);
}if(R==5){
GotoAndStop(4);
}
if(R==6){GotoAndStop(5);
}These links describes this movie clip method:
One problem with your code is the case issue (javascript is case sensitive). Naming in CreateJS follows the same naming and naming conventions of Flash.
The method can take a number argument or a string argument.
The number argument is the number of tween frames from the start of the movie (or movie clip). Tween frames are not the same as key frames (unless the number of tweens between key frames is zero). The string argument is the name of the key frame if it has been given a name (click on key frame in list of key frames and edit the name).
Hi Bob.
Thanks again for the links. I’ll have a go and see how I come up.
Cheers
D.KFound your post interesting to read. I cant wait to see your post soon. Good Luck with the upcoming update. This post is really very interesting and effective.
I found this post very interesting and informative. Thank you for sharing your special thoughts with us. I definitely share this with my peeps.
That’s very pleasure to read that the member of this forum are so supportive by the way i am new here!
You must be logged in to reply to this topic.