Extracting the frame number from frame label

  • blind_nach
  • Born
  • Born
  • blind_nach
  • Posts: 2

Post 3+ Months Ago

I'm trying to get a frame's number from its label. It may sound strange, but I can explain it.
I have a function with this
gotoAndPlay("label")
but what I want to do is
gotoAndPlay("label" + 10)
so I can go 10 frames after the label. I thought of using a var for this, but don't know how to get a frame's number from its label.

Hope somebody can give me a hand.
THX
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Unfortunately you can't. This has always been something that kinda bugged me. I don't know if Macromedia has just not thought of it, or if the way the compiled file is set up it just isn't possible, but either way, it's just not something you can do :(
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5148
  • Loc: SC-USA

Post 3+ Months Ago

This worked for me in a real quick test.

Code: [ Select ]
on (release) {
    gotoAndStop("myLabel");
    trace(_currentframe);
    gotoAndStop(_currentframe+10);
    trace(_currentframe);
}
  1. on (release) {
  2.     gotoAndStop("myLabel");
  3.     trace(_currentframe);
  4.     gotoAndStop(_currentframe+10);
  5.     trace(_currentframe);
  6. }
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Yeah, but that would require you go to the frame first in order for the equation to work. I assume that isn't what is wanted.
  • BlaSpH
  • Born
  • Born
  • BlaSpH
  • Posts: 3

Post 3+ Months Ago

You could work arround it by putting the visible property on 0 of your movie or mc and then running through all your labels getting the _currentframe property. You could also mask the whole movie with a MC toggle visible there and swap its depth when you've finished running through al your labels. Put the label frame numbers in an array for easy acces so you can use them in your calculations.

There are many ways to Rome.

*edit You cannot toggle _visible for a whole movie i just realised :oops: So your down to an MC i guess.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 7 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.