I found this great tutorial ON THIS SITE ->HERE<- and it does 99% of what I would need it to do but it would appear that it is for AS 2.0 as it makes use of the song identifier which is no longer in AS 3.0.
so…
How would this be done in AS 3.0?
what I would ideally want would be for the user to have the ability to pause the song at their will…
AND
I would like to have it automatically pause when they entered a certain frame on the timeline and then resume when the exited…
(I have some Videos that I don’t want the site music to overlap with the movies audio)
any pointers or directions would be greatly appreciated.
this is the original AS as posted by nathan99
[AS]Sound.prototype.pause = function():Void {
//Stop the sound
this.stop();
//Record position
this.newPosition = this.position/1000;
};
pauseButton.onPress = function():Void {
//Alternate state
paused = !paused;
if (paused) {
//Pause the sound
my_sound.pause();
} else {
//Continue playing at the Sound.newPosition value
my_sound.start(my_sound.newPosition);
}
};
//Create Sound Object
my_sound = new Sound();
//Attach the sound with the linkage identifier of “song”
my_sound.attachSound(“song”);
//Start the sound
my_sound.start(0);[/AS]