I have a bit of a problem… I’m trying to do my friends flash project for university.. it’s actually really easy stuff but I have basically no knowledge of AS3 as I stopped using flash in place of full time coding a few years ago. Anyway it’s gotta be in tomo morn so if anyone break this code down for me I (and my poor friend) will be eternally indebted..
What does this line do:
var numFrames:int = this.dances_mc.totalFrames;
There is a symbol called dances_mc on the first frame of the timeline, in which there are 5 or so frames and a stop function. Each of these frames contains different text and an image. There is a completed demo in which the button causes the text and image to change and this loops back round at the end.
The AS in the file looks like this:
trace("movie starts"+this.dances_mc.totalFrames);
var index_num:Number= 1;
var numFrames:int = this.dances_mc.totalFrames;
// Your code goes here
stop();
I need to write an Event Handler that displays the next dance each time the button is pressed. Then improve the Event Handler so that once the last dance is displayed, pressing the button will display the first dance again.
Thanks in advance !!
The line in question is telling you how many frames are in that movieClip, so you can know when to loop back to the first frame.
In place of your //your code goes here: