Skip to main content
Known Participant
April 24, 2015
Answered

Im new to Actionscript 3.. when i clicked the green circle it turns into red and i want it to stay that way?

  • April 24, 2015
  • 1 reply
  • 928 views

Im new to Actionscript 3.. when i clicked the green circle it turns into red and i want it to stay that way but it wont saved.I dont know but the color wont saved help anyone?... but its flushing.

the instance name for the movie clip is green


heres the source code

var myS:SharedObject = SharedObject.getLocal("sdsds");

var my_color:ColorTransform = new ColorTransform();

my_color.color = 0xFF0000;

green.object = myS.data.me;

green.addEventListener(MouseEvent.CLICK... myClick);

function myClick (e:MouseEvent):void{

trace("I was clicked!");

green.transform.colorTransform = my_color;

trace(myS.flush());

}

trace(myS.data.me);

This topic has been closed for replies.
Correct answer kglad

use:

var myS:SharedObject = SharedObject.getLocal("sdsds",'/');

var my_color:ColorTransform = new ColorTransform();

my_color.color = 0xFF0000;

if(myS.data.my_color){
green.transform.colorTransform=my_color;
}

green.addEventListener(MouseEvent.CLICK,myClick);

function myClick (e:MouseEvent):void{

green.transform.colorTransform = my_color;

myS.data.my_color=true;

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 24, 2015

use:

var myS:SharedObject = SharedObject.getLocal("sdsds",'/');

var my_color:ColorTransform = new ColorTransform();

my_color.color = 0xFF0000;

if(myS.data.my_color){
green.transform.colorTransform=my_color;
}

green.addEventListener(MouseEvent.CLICK,myClick);

function myClick (e:MouseEvent):void{

green.transform.colorTransform = my_color;

myS.data.my_color=true;

}

Known Participant
April 24, 2015

can you tell me how to make it a save file in flash  so it can trace it?

Known Participant
April 27, 2015

are you making an air application or a web-based (something that will be displayed in a browser and saved on a file server) application?


its a stand alone app sir kglad