Hey, I am trying to do this:
Inside a movie clip this what should be happening
When a user rolls over MC mc should turn green
When user roll out if green go back to original color = black
When user clicks MC turn red
If MC is red When user rolls back onto MC stay red and NOT turn green
But when MC is red and clicked again, MC goes back to green
here’s what I got so far:
(inside the MC)
colorObj = new Color(this);
colorObj.setTransform({ra:100, rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0});
state = 0;
this.onRollOver = function() {
colorObj.setTransform({ra:100, rb:0,ga:100,gb:45,ba:100,bb:0,aa:100,ab:0});
if (state != 0){
colorObj.setTransform({ra:100, rb:69,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0});
}
//trace(state);
}
this.onRollOut = function() {
if (state == 0) {
colorObj.setTransform({ra:100, rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0});
}
}
this.onPress = function() {
state = 1;
colorObj.setTransform({ra:100, rb:69,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0});
if(colorObj = ({ra:100, rb:69,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0})){
//trace("Turn green");
}
}