Here you go.. :)

//var loopTune:Sound = new Sound(); You can change this variable to what ever you have as the new Sound()
var soundPosition:Number = 0;
function stopPlaying() {
        loopTune.stop();
        musicPlays = false;
        return (musicPlays);
}
function startPlaying() {
        if (musicPlays == false) {
                musicPlays = true;
                loopTune.start(soundPosition, 0);
        }
        return (musicPlays);
}
function pausePlaying() {
        if (this.loopTune.position > 0) {
                soundPosition = loopTune.position / 1000;
        }
        stopPlaying();
}

/*-----------------------------------------
Start/Stop Song Button Script
-----------------------------------------*/
function playStop() {
        if (musicPlays == true) {
                pausePlaying();
        } else if (musicPlays == false) {
                startPlaying();
        }
}

HTH

Karl DeSaulniers
Design Drumm
http://designdrumm.com

On Jun 5, 2009, at 6:59 AM, Rajiv Seth (Pixeldust) wrote:

Hi,

I need to create a simple flash audio player with play, pause (and/ or volume
control). It will be added to a web page.

Now the problem is if a user pauses the player, I need to retain its paused state between web pages untill he decides to play it again. And if he plays it and navigates to some other page using simple anchor (non flash), then
audio should automatically play untill he pauses it.

My idea is to store play/pause state in some variable (or XML), so that
state can be maintained. BUT I do not know how to do it.
CAN ANYONE HELP?

Rajiv
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to