# Using scenes and marking them as dirty in AS2

**URL:** <https://forum.kirupa.com/t/using-scenes-and-marking-them-as-dirty-in-as2/301430>\
**Category:** flash\
**Created:** [December 9, 2009, 8:14am UTC](https://forum.kirupa.com/t/using-scenes-and-marking-them-as-dirty-in-as2/301430 "2009-12-09T08:14:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sensut](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sensut](https://forum.kirupa.com/u/sensut)\
**Post date:** [December 9, 2009, 8:14am UTC](https://forum.kirupa.com/t/using-scenes-and-marking-them-as-dirty-in-as2/301430/1 "2009-12-09T08:14:59Z")

</div>

I am Not a regular AS developer but had learnt it in college.

Here is the problem  
**Facts**  
I have a movieclip with \> 80 scenes.  
Each scene has a backbutton, a nextbutton and a re-play button.  
The user may use the re-play button to play the audio.  
**Requirement**  
The audio must play the first time the scene is visited  
On subsequent visits (via the back button or other links) the audio must not play automatically.  
**Problem**  
How to mark the scene as visited to avoid the audio playing on subsequent visits

- 

Solution logic that I have is  
 \*Use the movieclip.scenes array  
create a 2 dimension array  
store the scene name (from the scenes array) in index 0  
and the state in index 1  
use the currentscene property to check the value of the state from the 2 dimensional array  
play the audio if the state is not dirty

\*\*I need  
\*\*the code and where to put it  
(I put all my actions on a separate layer called action, will that do?)

This is really urgent as at the moment it is a show stopper on an important project
