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

thank you so much