Skip to main content
Participant
April 8, 2008
Question

AS Newbie question

  • April 8, 2008
  • 3 replies
  • 365 views
Is it possible to write a function that can look forward in time and find specific named keyframes then evaluate the state of objects (position, etc.) on that frame?
This topic has been closed for replies.

3 replies

kglad
Community Expert
Community Expert
April 8, 2008
the render event doesn't set objects on-stage. it just executes some time after the playhead enters the frame when everything in that frame has been instantiated (or ready for use).
kglad
Community Expert
Community Expert
April 8, 2008
no, not at all. you can direct the playhead to a frame, user the render event to ensure everything on stage at that frame is rendered and then execute code from the calling frame that references objects on that new frame.
KapinatorAuthor
Participant
April 8, 2008
So I could in theory write a loop in the first frame that iterates the playhead from frame to frame looking for a specific keyframe then once I find it I could call "render" to set the objects on the stage then access those objects in action script to evaluate their postion, etc...?
kglad
Community Expert
Community Expert
April 8, 2008
you can reference frame labels in as3, but you can't "look forward in time".
KapinatorAuthor
Participant
April 8, 2008
So in order to do something in AS at a keyframe you must add AS to that specific frame?