# Tracking scenes with as2

**URL:** <https://forum.kirupa.com/t/tracking-scenes-with-as2/319624>\
**Category:** Uncategorized\
**Created:** [February 27, 2011, 12:23am UTC](https://forum.kirupa.com/t/tracking-scenes-with-as2/319624 "2011-02-27T00:23:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmtanner](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jmtanner](https://forum.kirupa.com/u/jmtanner)\
**Post date:** [February 27, 2011, 12:23am UTC](https://forum.kirupa.com/t/tracking-scenes-with-as2/319624/1 "2011-02-27T00:23:16Z")

</div>

I have an interactive story divided into scenes. At the end of each scene a button appears. This occurs on a frame on the timeline.

There are two different buttons that might appear based on whether a prior scene has been viewed or not.

For example, there are Scene\_1 and Scene\_2. At the end of Scene\_2 one of two buttons will appear. The buttons will be either “Go see Scene\_1” or “Return to Main Menu”.

If the user has already seen Scene\_1, Flash will know that and automatically go to the frame in Scene\_2 that contains the button “Return to Main Menu”.

Conversely, if the user has not seen Scene\_1, Flash will know and automatically go to the frame in Scene\_2 that contains the button “Go see Scene\_1”.

I imagine there would be an action frame at the end of Scene\_2 that will contain the as2 code to enable this action.

Perhaps something like, but probably not at all like the following:

if (“Scene\_1”, last frame == true){gotoAndPlay(“frame#”);}else{gotoAndPlay(“frame#”);}

Any help is greatly appreciated.

Thanks!
