• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 457
  • Last Modified:

Navigate to previous frame label?

Hi! I have a fairly complex multi-tiered navigation system in my Flash MX site. Each item when it unloads completes a tween before moving to the next frame label specified in a variable. Simple enough, once you get down to it.

BUT, I want to do something I do very easily in Director: move back and forth sequentally by label. Since the items are in the timeline one after another I can acheave a "Next Label" by simply specifying no label to jump to, but I can't figure out how to go back.

I have considered using a variable to store the label of the previous item... but I'd rather do it dynamically.

So, is there a function I don't know about? Is there a way to refer to the list of labels as an array? I could deal with that.
0
signless
Asked:
signless
1 Solution
 
rexmorCommented:
_root.ctr = 0;
_root.minMarker = 1;
_root.maxMarker = 10;
movieclip.prototype.next = function(n) {
     if ((_root.ctr>minMarker) and (_root.ctr<_root.maxMarker)) {
          _root.ctr += n;
          this.marker = "marker"+_root.ctr;
          _root.gotoAndPlay(this.marker);
     }
};


//calling the function
//next
on (release) {
     next(1);
}
//back
on (release) {
     next(-1);
}


note: your label should be "marker1,marker2..."

hope this helps

rex
0
 
signlessAuthor Commented:
Well... yes this will do it. I'd really like to use a more dynamic method (use any labels) but they are actually named with numbers currently anyway...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now