A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11255 Flash Movies | 9 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Knife Butterfly
» Title: SkullCandle
» Description: Simple Skull with a candle burning on it.
» More by Knife Butterfly


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

Featured Site

» Posted in the Flash Kit Links section
» Title: Cesar Kobashikawa - online portfolio
» Comments: Cesar Kobashikawa's Portfolio


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

» FLV Converter for Mac
» After Effects Quality Effect using AS3
» FLV to 3GP: Convert video files from FLV (Flash Video) to 3GP for Mac
» create Christmas business flash presentation with hyperlinks
» Let Photos Show Your Happy Family this Christmas and Upload YouTube
» PowerPoint show to DVD slide show--- PPS to DVD
» How to burn FLV to DVD for Mac
» How to Create Christmas Flash Greeting Ecard with photos and music
» Getting Started In Flash
» Unknown Tag: Title10
Random Tutorial | Add Site

bbm.netBBM.net is designed to save you time and deliver the highest quality royalty-free music for your multimedia projects. Features include: over 450 Music Loop Packages from some of the best composers in the business, our music search engine to speed your selection process, alternate music versions & bonus sounds to use for rollovers or transitions, free technical support and free consulting.

Click here for details »

Junior Interactive Project Manager
Aquent
US-PA-Philadelphia

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.62 Votes: 48
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.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

Whitepapers and eBooks

Symantec Whitepaper: Converging System and Data Protection for Complete Disaster Recovery
Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
  Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Symantec Whitepaper: Comprehensive Backup and Recovery of VMware Virtual Infrastructure
MORE WHITEPAPERS, EBOOKS, AND ARTICLES