Solved

random

Posted on 2002-04-09
3
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

739 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