Although he was defining 3 functions to change the movieclips color, i dunno why it wasnt working. Maybe if he points what was the changeColor function. :-
The following would have worked:[AS]function changeColor(movieclip, RGB) {
myColor = new Color(movieclip);
myColor.setRGB(RGB);
}
square.onEnterFrame = changeSquareColor;
function changeSquareColor() {
changeColor(square,0xff0000);
}
circle.onEnterFrame = changeCircleColor;
function changeCircleColor() {
changeColor(circle,0x999999);
}[/AS]But as Jubba pointed, could be replaced for:[AS]function changeColor(movieclip, RGB) {
myColor = new Color(movieclip);
myColor.setRGB(RGB);
}
square.onEnterFrame = function() {
changeColor(this, 0x336699);
};
circle.onEnterFrame = function() {
changeColor(this, 0x990000);
};[/AS]
But if he had used the following code, both circle and square will be set to 0x990000.[AS]circle.onEnterFrame = changeColor(this, 0x990000);[/AS]Or maybe he was pointing the setRGB method to “this”[AS]function changeColor(movieclip, RGB) {
myColor = new Color(this); //all mcs would have its RGB set to the same color
myColor.setRGB(RGB);
}[/AS]