A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11337 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5828 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.


Random Links | Add your own Flash Related Links
Flash Tutorials 1280 Tutorials 7 New Tutorials Added!
What's New | Top100

» Make a Flash Slide Show Screen Saver
» Simple flash making tutorial for thanksgiving
» Create flash banner for website
» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» Unknown Tag: Title10
Random Tutorial | Add Site

Trading Customer Accounting (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Actionscripting

Categories Custom color
Author: Vlad Craita | Website: http://www.siteok.home.ro |

 
Page 1
1

This tutorial will show you how you can change the color of a movie clip. Three easy steps must be completed.

Step 1:

Draw a rectangle, bigger than the dimensions of you scene. The color doesn't matter.
Now that you've done that make it a symbol, by pressing F8, the type should be Movie Clip.
Click OK. Name this instance 'background'. Make it cover the whole scene.

Step 2:

In another layer make a button by drawing something and pressing F8, then Ok with the Button property selected.
Right click the button and click copy. Then click paste. Do this 5 times. Now align in
an order the buttons, like i did. Click the first button, and from the property panel click the Color
property and select Tint. Then choose a color(don't forget to write down the code of the color, we'll use it later-the code
is that combination of numbers with letters, numbers or just letters, like 00CC00). Do this for each of your buttons. Of course
with another color. It should look like mines, except for the colors, which are your own options.

Step 3:

Now we have two layers. One with the background and another one with the buttons.
Click frame one, no matter the layer, and open the Actions panel.
Because we have more than one button we will use a fuction. A function can be used by more
than one button if the code is identical. This is what a personalized fuction does. There are other types of functions, but they are not good in our case. We don't want the buttons to have an identical code, because if we need to make a change in the code we'll have to select each time a button and modify it's code. It takes a while to do this so with functions it's a lot easier.
The buttons are using a function, and when we want to change the script we'll just have to change the content of the function.
We won't have to involve the buttons in this process. So it will take less time.
I hope you understand the importance of the function in this tutorial, even if i can't explain it better.
Now for the script. Insert a function by double clicking the name 'function'(or click on the place where the code will
be added and then press ESC+fn). In the Name box type the name of the function - i typed 'customcolor'. In the parameters field type 'thecolor' or anything else you want. Insert an 'evaluate' action. Press ESC+ev or just double click its name.
Write 'something=new Color(background)'. 'something' is a variable that will contain the information of a color for the
movie clip named background. Lets give this variable an information about the color that the background will have.
So insert another 'evaluate' action. Type 'something.setRGB(thecolor)'. RGB means Red Green Black. Any color is a combination of those colors, and in () variable that holds the code assigned to a color.

Now we have to make the buttons use this function.
Select the first button. Insert an 'evaluate' action (ESC+ev), and type the name of the function, in my case 'customcolor()'.
In () type the code of the color for that button which you've writen, with 0x in front of it. For my first button i've typed 'customcolor(0x000000)'.
The parameter 'thecolor' from the function will be in this case 0x000000(black).
Do this for all of the buttons, and in () type the code for the colors. I have 0xFF0000(red), 0xFFFF00(yellow),0x0066FF(blue),
0x663333(brown),0x00FF00(green).
That's all. You've finished. The final script shoul look like this:
for the frame:        function customcolor(thecolor) {
                                 something=new Color(background);
                                 something.setRGB(thecolor);
                             }


for the buttons:   on (release) {
                           customcolor(0x000000);
                          }

Of course, in the () is a code different for each button.

If you want more colors you'll have to make another button, color it with Tint so you can see what color will be selected
and then type the code for the button - the code will look like the one above, it will have something else in the brackets.

Thank you for your patience in reading my tutorial.

For questions email at vladbz@yahoo.com .


1

» Level Intermediate

Added: : 2003-10-07
Rating: 8.65 Votes: 49
Hits: 1179
» Author
Website designer from Romania who likes to play with Flash, JavaScript and Dreamwever.
» Download
Download the files used in this tutorial.
Download (7 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs