Copy link to clipboard
Copied
How can I be saving the value of a Boolean variable, so that when I open the file, it can be with the settings in which I left?
I created the variable to the top of the frame:
var audio:Boolean = true;
And I added the conditions for the buttons:
if(audio == true) {
Sound.play();
}
But every time I have to open the application preference is reset to true, wanted to leave with that preference be saved in the case of boolean, true (on) or false (off).
can anybody help me? Please.
Thanks in advance!
A sharedObject is still appropriate for a local application. The only reason to use anything else would be storage size requirements.
Copy link to clipboard
Copied
How / where is this application implemented?
Copy link to clipboard
Copied
Hello Ned!
A button created from the addEventListener...
Let's say X button:
function X (Event:MouseEvent):void
{
if(sound == true) {
som = false; // bool
}
trace("mute")
}
Is something like this could help me?
Copy link to clipboard
Copied
What I meant was... is this a web interface or a local application only on the user's machine? For the web use a Shared Object. For a local application you might want to look into utilizing a data file to store information you wish to retain
Copy link to clipboard
Copied
Local application, the second option in case.
Copy link to clipboard
Copied
A sharedObject is still appropriate for a local application. The only reason to use anything else would be storage size requirements.
Copy link to clipboard
Copied
Use the SharedObject class.