Solved

random

Posted on 2002-04-09
3
267 Views
Last Modified: 2010-04-03
dear experts
i have a little problem with a random
i have some figure i attach it to movie clip with a random color and i have some other 6 movie clip it's root deffrent than the root figure
what i want to color these movie clip with the same color
 i color the figure


0
Comment
Question by:yaco
3 Comments
 
LVL 1

Accepted Solution

by:
chill0123 earned 50 total points
ID: 6978401
I am not quite sure what you are asking, but if you want to randomly display a different color each time a movie clip loads, you need to use a "randomizer" script and some variables to display a new color each time the page has been refreshed...

start by adding the below script to the first frame of a movie clip or button (on release):

onClipEvent (enterFrame) {
x = (Math.round(Math.random()*6));
     if (x == 1) {
          objColor = new Color(_root.frameColor2);
          objColor.setRGB(0x930000);
     } else if (x == 2) {
          objColor = new Color(_root.frameColor2);
          objColor.setRGB(0x666666);
     } else if (x == 3) {
          objColor = new Color(_root.frameColor2);
          objColor.setRGB(0xCC0000);
     } else if (x == 4) {
          objColor = new Color(_root.frameColor2);
          objColor.setRGB(0x330000);
     } else if (x == 5) {
          objColor = new Color(_root.frameColor2);
          objColor.setRGB(0xFF0066);
     } else if (x == 6) {
          objColor = new Color(_root.frameColor2);
          objColor.setRGB(0x339900);
     }
}

------------- end code ----------------

frameColor2 is the instance name of the movie clip that will have the background color change...

chill




0
 
LVL 6

Expert Comment

by:rootdir
ID: 6989940
See this good example for choose random color

http://www.kirupa.com/developer/flash5/randomcolor.asp
0
 

Expert Comment

by:SpideyMod
ID: 8302626
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now