# Reset sound cue point (position) in Flash 8

**URL:** <https://forum.kirupa.com/t/reset-sound-cue-point-position-in-flash-8/212512>\
**Category:** flash\
**Created:** [January 11, 2007, 5:08pm UTC](https://forum.kirupa.com/t/reset-sound-cue-point-position-in-flash-8/212512 "2007-01-11T17:08:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashMem](https://avatars.discourse-cdn.com/v4/letter/f/f6c823/32.png) [@FlashMem](https://forum.kirupa.com/u/FlashMem)\
**Post date:** [January 11, 2007, 5:08pm UTC](https://forum.kirupa.com/t/reset-sound-cue-point-position-in-flash-8/212512/1 "2007-01-11T17:08:05Z")

</div>

Hi Everyone…

I have a simple sound control panel that changes the tune, starts/stops at a cue point, adjusts volume.

The action I’m getting is that the change tune function works, but on pause/play, the cue point starts from the old tune’s cue point, therefore there’s a big forward jump when play starts again. I’m trying to reset sound position and therefore var cue when I do that.

I am missing something here, so would appreciate some insights from the group. You can see it at [www.sleepingdeer.com/web2/](http://www.sleepingdeer.com/web2/) (lower right)

Buttons are named playMusic, stopMusic, newMusic

var arrayIndex = 0; // array index initialized to first element of the array

musicArray = new Array //musicArray loaded with available tunes and paths (progressive download)

var cue = 0;

/////////////// look up duration of sound file on load success

var newBgSound:Sound = new Sound();

// determine which sound file to play according to initial the array index = 0

newBgSound.loadSound(musicArray[arrayIndex], true);

// stopMusic button

this.musicControls.stopMusic.onRelease = function() {  
\_root.newBgSound.stop();  
cue = Math.round(newBgSound.position/1000);  
// stores the position in seconds of the sound play head

};

// payMusic button  
this.musicControls.playMusic.onRelease = function() {  
\_root.newBgSound.start(cue,3);

};

// newMusic button

this.musicControls.newMusic.onRelease = function() {  
if (arrayIndex == musicArray.length-1) {  
arrayIndex = 0;  
}else{  
arrayIndex++;  
}  
if (newBgSound.position \> 0) {  
} // try to reset sound position

```
newBgSound.loadSound(musicArray[arrayIndex], true);
_root.newBgSound.start(0,3);
newBgSound.position = 0;
cue = Math.round(newBgSound.position/1000); 

```

};
