Go Back   kirupaForum > Flash > ActionScript 1.0/2.0

Reply
 
Thread Tools Display Modes
Old 11-24-2009, 01:37 PM   #1
wuzzi2ya
Registered User
AS2:SharedObject, Unable to start sound back after refresh

I have a toggle to mute and unmute sound in this movie. If sound is on and refresh with SharedObject sound plays again. Also I can toggle between the sound before refresh. The issue: when selecting mute then refresh, the movie plays back muted but the ability to un-mute is no longer available (at least not before another refresh).

Problem: toggle to mute then refresh of browser. Mute is fine but no ability to toggle back to sound.

Code:
Code:
var my_snd_obj:Sound = new Sound();
my_snd_obj.start(0,1);
my_snd_obj.attachSound("my_audio");
my_snd_obj.setVolume(15);
var my_so:SharedObject = SharedObject.getLocal("userPref");
if (my_so.data.stopped == undefined) {
    my_snd_obj.start(0,1);
    my_snd_obj.setVolume(15);
    stateCopy._visible = false;
    trace("stopped == undefined");
} else {
    my_snd_obj.setVolume(0);
    trace("else");
}

var volumeOn:Boolean = true;
btnSoundOff.onRelease = function():Void  {
    if (volumeOn) {
        my_so.data.stopped = 1;
        my_snd_obj.setVolume(0);
        my_so.flush();
        stateCopy._visible = true;
        trace("stopped == 1 " + my_so.data.stopped);
    } else {
        my_snd_obj.setVolume(15);
        my_so.clear();
        stateCopy._visible = false;
        trace("stopped ==  else 1" + my_so.data.stopped);
    }
    volumeOn = !volumeOn;
};
Any suggestions? Any and all help is greatly appreciated!
wuzzi2ya is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Old 11-25-2009, 06:15 PM   #2
wuzzi2ya
Registered User
Quote:
Originally Posted by wuzzi2ya View Post
I have a toggle to mute and unmute sound in this movie. If sound is on and refresh with SharedObject sound plays again. Also I can toggle between the sound before refresh. The issue: when selecting mute then refresh, the movie plays back muted but the ability to un-mute is no longer available (at least not before another refresh).

Problem: toggle to mute then refresh of browser. Mute is fine but no ability to toggle back to sound.

Code:
Code:
var my_snd_obj:Sound = new Sound();
my_snd_obj.start(0,1);
my_snd_obj.attachSound("my_audio");
my_snd_obj.setVolume(15);
var my_so:SharedObject = SharedObject.getLocal("userPref");
if (my_so.data.stopped == undefined) {
    my_snd_obj.start(0,1);
    my_snd_obj.setVolume(15);
    stateCopy._visible = false;
    trace("stopped == undefined");
} else {
    my_snd_obj.setVolume(0);
    trace("else");
}

var volumeOn:Boolean = true;
btnSoundOff.onRelease = function():Void  {
    if (volumeOn) {
        my_so.data.stopped = 1;
        my_snd_obj.setVolume(0);
        my_so.flush();
        stateCopy._visible = true;
        trace("stopped == 1 " + my_so.data.stopped);
    } else {
        my_snd_obj.setVolume(15);
        my_so.clear();
        stateCopy._visible = false;
        trace("stopped ==  else 1" + my_so.data.stopped);
    }
    volumeOn = !volumeOn;
};
Any suggestions? Any and all help is greatly appreciated!

well thanks again. apparently this is not possible...
wuzzi2ya is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:17 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com