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...
Well, here is what I got so far... Still working on it, and it prob is
not optimal, but maybe you all will have some suggestions:
/* Initialize index: */
var index = 1;
/* Declare var frames as an array: */
var frames:Array = new Array();
/* Pop array with scene labels: */
var frames = ["scene1", "scene2", "scene3"];
/* Get length of array: */
var max = frames.length;
/* Attach function to forward button: */
_root.forward.onRelease = function() { goCheckForward(); }
/* Attach function to backward button: */
_root.backward.onRelease = function() { goCheckBackward(); }
goCheckForward = function() {
/* If index is >= array length, zero-out var index: */
if(index >= max) { index = 0; }
gotoAndPlay(frames[index]);
trace(frames[index]);
index++; /* add one to var index */
}
/* Still working on this function... buggy atm. Suggestions? */
goCheckBackward = function() {
index--;
gotoAndPlay(frames[index]);
trace(frames[index]);
}
Any help, suggestions, thoughts, tips would be greatly appreciated.
Many thanks in advance,
Cheers,
Micky
_______________________________________________
[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