How about just a single function (ala LOTR -- "one ring to rule them all")
and just pass it a 1 or -1 to indicate the direction?

/* Initialize index: */
var index:Number = 0;
/* Declare var frames as an array and populatec with frame labels: */
var frames:Array = ["scene1", "scene2", "scene3"];
/* Get length of array: */
var max:Number = frames.length;
//
/* Attach function to forward button: */
_root.forward.onRelease = function() {
        frameChange(+1);
};
//
/* Attach function to backward button: */
_root.backward.onRelease = function() {
        frameChange(-1);
};
//
frameChange = function (nbrDir) {
        index = (index+nbrDir+max)%max;
        trace(frames[index]);
        gotoAndPlay(frames[index]);
};

Also, I notice that one of your comments describes these as "scene
labels", but note that scene labels can only be targeted from the _root of
the level AND you cannot use variable references (including arrays) for
scene label designations -- must be actual string literal: the actual
scene name  surrounded with quote marks. For the above to work, those must
be frame labels, not scene labels.

-- 
Byron "Barn" Canfield


> Hey all...
>
> I need some help with the below code... I am trying to set-up a dynamic
> way to jump from label to label on the main timeline of my animation...


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to