-
How can I change an instance of movie clip without actually changing the movie clip?
...Im sure its very easy if you know how.
-
Senior Member
To change the colour of a movie clip you need to use the colour object
first give the clip an instance name you can noew either use the setTransform or setRGB methods, setRGB is prbably more straight forward so i'll use that one here
for example if you have a movie clip and a button on the main timeline and you want the clip to change colour when the button is pressed if you gave the clip the instance name myClip, this action attached to the button would change the colour of the clip to ff9900 (orange)
on (release) {
myColor = new Color(_root.myClip); // create a new color object
myColor.setRGB(0xff9900); // change the color with setRGB
}
you could turn the clip a random colour using
on (release) {
myColor = new Color(_root.myClip);
myColor.setRGB(Math.random() * 0xffffff);
}
-
FK's Geezer Mod
Hey catbert303, I'm just starting on more advanced AS, can you explain what the '0xffffff' does?
-
Senior Member
The 0xffffff is a hexidecimal value (like in html where you can set a colour using hexidecimal. for example #ffffff is white, that is red, blue and green are all set to the maximum value, ff) in flash to use a hexidecimal value you prefix it with 0x
These values are especially useful when dealing with colours
http://www.macromedia.com/support/fl...robject04.html
-
FK's Geezer Mod
Great, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|