views:

156

answers:

1

I have a very simple .fla file. There's a shape on the stage with a fill, and I want to change its colour when the movie starts.

Googling seemed to suggest:

myColor = new Color(myClip);
myColor.setRGB(0xFFFF00);

but it didn't seem to work. Any suggestions?..

+1  A: 

Is your shape a movieClip? does your clip have an instance name of "myClip"? That looks like what could be causing the issue.

In Flash, go to Window->Properties, that will launch the properties panel. If the shape isn't a MovieClip, it will just say "shape". Right-click on the shape and select "Convert to Symbol" you can name it whatever you want, but make sure "Movie Clip" is selected for type.

Once you've done that, there should be a text field on the Properties panel. It will say "instance name" when you hover on it. Enter "myClip" (no quotes). That should fix this.

If that isn't the problem, it could be a scope issue. make sure the clip and code are on the same timeline and that "myClip" isn't nested somewhere.

nerdabilly