Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find currentframe of this scene in AS?

Status
Not open for further replies.

theotrain

Programmer
Mar 5, 2003
150
MX
as i understand it, if my main timeline is running through scene2 and its on the fifth frame, the root._currentframe will be 5 + however many frames there are in previous scenes.

so what if i want to know the _currentframe for the scene that is playing, meaning the actual number of the frame as it is in the timeline, not as its related to the entire movie will all the scenes considered?

is it possible without knowing the # of frames in previous scenes to figure out the current frame# as it shows in the timeline? (also is it possible to find out the # of frames in a scene using actionscript?)

or, as i suspect, is the whole "scene" concept a visual organization convenience with absolutely no relevance to actionscript? any clues appreciated...
 
good question. i just meant that i didnt want to set a hard variable in case the number of frames in prior scenes changed. it just seemed sloppy.

as it is i just created a variable at the beginning of the scene in question, like:

[tt]
sceneStartFrame = _currentframe;
[/tt]

and used that to calculate the desired frame in the scene as needed. like:

[tt]
gotoAndPlay(250-sceneStartFrame);
[/tt]

i dont know why i didnt think of it immediately.

anyway, thanks oldnewbie, you rock...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top