Hey String3
Basically it does the following:
If you click on the object “onePlus” it moves to the frame with the label “page1”, which you have already understood.
the function has been written really short, so maybe this helps you to understand it:
function onOnePlusClick(evt:MouseEvent):void {
//declare a integer called frameNumb
var frameNumb:int;
//get the frame number of the label "page1" from the Object "pages" and store it in frameNumb
frameNumb = getFrame("page1",pages);
//add 4 (frames) to the number you received in the line before
frameNumb += 4;
//go to the frame you calculated in the two rows before
pages.gotoAndStop(frameNumb);
}
in order to receive the frameNumber of a label they use this function:
//function needs to receive a string (frame label) and a movieclip, the function returns an integer
function getFrame(frLabel:String, mc:MovieClip):int {
//go through every frame label the movieclip has
for (var i:int = 0; i<mc.currentLabels.length; i++) {
//if the label correspond...
if (mc.currentLabels*.name == frLabel) {
//...return the frame of the label (the function exits after it returns a value)
return mc.currentLabels*.frame;
}
}
//if the for loop has finished without finding the label, it returns -1
return -1;
}
the function onLabelCheckClick calls the function “isFrameLabel”.
If you have a question here, please ask again!
the function “isFrameLabel” basically does the exact same thing like the function “getFrame” but it returns true if the frame label is found and false if not.
Hope that clears things a little up.
I think it’s a good idea to figure out things you didn’t understand. But sometimes you can get worked up in a topic and you just don’t see any progress, in that case i would recommend to let it go for a couple of days, focus on something else and then get back to it when your mind is clear again.
If there are any further questions don’t hesitate to post
Bye
Carlo