• flickr
  • linkedin
  • twitter
  • rss
Get frame number from label AS3

Get frame number from label AS3

function getFrameByLabel(yourMovieClip:MovieClip, frameLabel: String ):int
 {
       var scene:Scene = yourMovieClip.currentScene;

       var frameNumber:int = -1;

       for( var i:int ; i < scene.labels.length ; ++i )
       {
            if( scene.labels[i].name == frameLabel )
                frameNumber = scene.labels[i].frame;
       }

       return frameNumber;
  }

Src: http://stackoverflow.com/questions/4846858/as3-simple-way-to-get-the-frame-number-of-a-frame-label

Tech Reference:

Larry's a 30-something chap interested in travel, being a dork and changing the world via less boring training.

Leave a reply