AS3 setting depth index of a display object on the timeline: Bug


A project had a ‘flipbook’ which used nextFrame and prevFrame to move through content which was different for every frame. Pretty old school but it made workflow quick in development. The trouble came with “smart images” embedded on these per-frame pages.

These had a class associated with them and part of the class behavior was to set the depth of a clicked smart image to the highest level in that frame. Although these images were defined in the timeline at only one frame, with blank keyframes on either side, the act of setting the depth index would effectively put the smartimage DisplayObject on every frame of the containing movie clip!

Keep and eye out for this when doing development that shares timeline and script in AS3.

An excellent (as always) discussion of AS3 depth management can be found at kirupa.com forums

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s