Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Random Hex Colors From Array



-thanks for dropping in-

This is an attempt to randomly draw 14 colors from a 21 color array. I think everything is correct, but when the 'frame' runs the script, all the objects turn black (0x000000).

Perhaps this is because of a hex color problem with Flash?
I don't know... been messing with it for hours and nothing works.

I think the problem lies in the setRGB() method.
The setRGB() method works when I place a static hex color in it (ex. setRGB(0xFF0000))
There is content in the colorsSelect[Array] when I test by writing it to a dynamic text field.
But when I plug everything together, it causes all the objects to turn black.

Any assistance or ideas would be much appreciated.
Thank you.

=========================================
**(actions in Frame 1 of main timeline)**

// new array with 21 predetermined colors
colorsArray = new Array("0xFF0000", "0x0000FF", "0x990000", "0x996600", "0x99CC00", "0xCC6600", "0xCCCC00", "0xCCFF00", "0x990066", "0x99FF66", "0x9900FF", "0x99FFFF", "0xCC00FF", "0xCCFFFF", "0xFF00FF", "0x00FFFF", "0x000099", "0x006699", "0x00FF99", "0x00FF00", "0xFFFF00");
// filled with 14 random from colorsArray
colorsSelect = new Array(14);
// keep track of random numbers generated
colorsChosen = new Array(14);

// fill colorsSelect array with 14 random colors from colorsArray
for (var randColor=0; randColor<14; randColor++) {
var randNum = Math.floor(Math.random()*21);
for (var compColor=0; compColor<14; compColor++) {
if (randNum== colorsChosen[compColor]) {
var randNum = Math.floor(Math.random()*21);
continue;
}
}
colorsChosen[randColor] = randNum;
cchosen = colorsArray[randNum];
colorsSelect[randColor] = cchosen;

===========================================

**(in Frame actions to generate object colors)**

if ((i <= 7) and (p == 0)){
var pleasepiece = _root.menu["ppiece"+i];
var piececolor = new Color(pleasepiece);
var pieceC = String(_root.colorsSelect[i]);
piececolor.setRGB(pieceC);
i++;
}

------------------

I know there must be ways to streamline and clarify this code. Perhaps my actions should be on the onClipEvent()?
But I had this working with random hex colors and static values. what is the block here?

Thanks again.



FlashKit > Flash Help > Flash ActionScript
Posted on: 02-06-2002, 04:38 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Creating 10 Random Circles With Random Colors
hi folks.

I´m trying to write a simple function: create 10 circles (with random coordinates) and the circles should have random colors.

How can I assign the random colors? Is there an AS function that can help me?

Random Colors
Hello all.
In my flash file, I would like the background (or other) colour to change every time the frame loads. How do I code that?

Random Colors
hi there,
clicking a button to create numbers between 1- and 10...and when the number =5 let bgcolor=green, if numbers=1 let the color be "red" and so on..
thanks a lot

Random Colors..Again
Hello

I'm planning ti have random colors on buttons; the thing is, the random function returns an integer and I need hexadecimal values for my colors. So is there a way to transform an integer into a haxadecimal value or should I create a function that does it? can anyone give advice/help?

Random Colors
circle = new Color(circle_mc);
circle = setRGB.Math.random(0xFF0000);
Just learning so I have a question.

what am i missing in this code to make a movieclip keep changing colors. i have this script on a frame. Do I need a loop? Could someone send me a example with some explanation.

Please Help Me...random Colors
hello
i have used duplicateMovieClip to create a star trail that follow
the mouse
and now i want to color them random
help me...
good luck
meisam_mohseni@hotmail.com

Random Colors
How would you go about creating Random Colors?
I was messing around and tried
this.color = Math.random(256);
ive also tried
this.color = Math.random(256*rgb);

lol, help anyone? thnx

Random Colors
I was wondering if there was a way to have a random color generator, but changing the color of the image automatically in a set time.

Random Muted Colors?
How do I script a function that will create a random muted color for my movie?

Random Lines Of Different Colors
can anyone please suggest where I'd find the code that could have horizontal lines of different sizes and colors just appear gradually - building slowly and eventually filling the screen with various lines?

It's for a screensaver

Random Web Safe Colors
Hi All,

Happy New Year!

How can one generate randomly a web-safe color to an object?

Thanks in advance for your assitance.

Random Transition Of Colors
Hey,

I was wonder how i would get the effect, like at this site http://www.alessiopizzicannella.com/...zicannella.php, unlike this one were once you press a picture it changes the color, i would like just a random change of colors, for background, looping.

Thanks

[help] Random Colors Tutorial
according to the tutorial "random colors"

http://www.kirupa.com/developer/flash5/randomcolor.htm

i cant find the "expert mode" after i click the "action"
is it because the flash version i using ??
currently im using Flash 8

^^'
im noob in flash
can some1 tell me y ??
ty

Random Web Safe Colors
Hi All,

Happy New Year!

How can one generate randomly a web-safe color to an object?

Thanks in advance for your assitance.

Random Colors For DuplicateMovieClips
how can i duplicate a movieClip and choose thier colors randomly from an array. any help would be appreciated.

Array Of Colors
I'm trying to make an array of colors. I have uint's representing my colors now:

var btnColor:uint;
btnColor = 0x999999;

But when I trace these button colors, they come out funny. The color above comes out as:

10066329

And this is the way they get pushed into my array. I tried converting them to Strings:

arrBtncolor.push(String(btnColor));

But it was the same 10066329 that got put into the array.

It must be a small thing I'm doing wrong, but so far, I haven't figured out what it is. Help, please?

Array Of Colors
I'm trying to make an array of colors. I have uint's representing my colors now:

var btnColor:uint;
btnColor = 0x999999;

But when I trace these button colors, they come out funny. The color above comes out as:

10066329

And this is the way they get pushed into my array. I tried converting them to Strings:

arrBtncolor.push(String(btnColor));

But it was the same 10066329 that got put into the array.

It must be a small thing I'm doing wrong, but so far, I haven't figured out what it is. Help, please?

Generating Finite Random Colors
I've got some words floating around a screen using action scripting. Each word needs to be 1 of 4 specific colors: OxIE506E, Ox5F690F, 0xB93714, and Ox9B0F37. But I want each word's color to be randomly generated from those four possibilities. I know this is simple, but I can't quite work it out.

Here's an advanced version of the problem, less crucial. If there are say, 4 different words, is there a way to randomly choose from those 4 colors but not have the same color picked twice?

Smooth Transition Between Random Colors
how can I make a smooth transition between random colors?
so far I have this done:

this is on the frame action:

myColor= new Color (_root.box);
_root.b1.onRelease = function(){
myColor.setRGB(_global.rndColor)
}

and this is in a movie clip which is off stage, generating a random
value:

onClipEvent (enterFrame) {
_global.rndColor=Math.round(Math.random()*0xffffff );

}

There is a nice one in the tutorials, but I'm not able to use it for some reason. Maybe because it is not for MX 2004.

can anybody help?

Once Again, Im Experimenting With Random Shapes And Colors
heres a code i made

Code:
i = 0;
for (amount=random(100)+1; amount>0; amount--) {
_root.createEmptyMovieClip("p"+i, i);
_root["p"+i]._x = random(550)+10;
_root["p"+i]._y = random(400)+10;
i++;
}
_root.createEmptyMovieClip("l", i+2);
_root.createEmptyMovieClip("bg", i+1);
rggb1 = random(100);
rggb2 = random(100);
rggb3 = random(100);
rggb = "0x"+rggb1+rggb2+rggb3;
bg.lineStyle(1, 0x000000, 0);
bg.beginFill(rggb, random(100));
bg.lineTo(Stage.width, 0);
bg.lineTo(Stage.width, Stage.height);
bg.lineTo(0, Stage.height);
bg.lineTo(0, 0);
bg.endFill();
l.moveTo(p0._x, p0._y);
while (i>0) {
thick = random(10)+1;
b = random(2);
alpha = random(40)+60;
rgb1 = random(100);
rgb2 = random(100);
rgb3 = random(100);
rgb = "0x"+rgb1+rgb2+rgb3;
l.lineStyle(thick, rgb, alpha);
if (b == 1) {
l.beginFill(rgb, alpha-10);
} else {
l.endFill();
}
l.lineTo(_root["p"+i]._x, _root["p"+i]._y);
i--;
}
generates random abstract thingy maboby i liked how it looked :-) some of you probably wont like it because its sorta stupid but i just like it cause it looks nice and i like basically everything made in purecode

swf:
http://img56.imageshack.us/my.php?image=apitest3fw.swf

(Flash 8) Random Colors On Movieclips?
Hello. I have a question regarding the dynamic coloring of movieclips. I want to be able to specify a limited number of binhex values, and have those colors applied randomly to a movieclip.

I made a little diagram to show what I mean:



The original clip will be in simple black and white . . . but I'm looking for a way to apply those binhex values to the duplicated clips' color areas in random arrangements.

I can't seem to find any specific information on this anywhere. Any help would be MUCH appreciated. Thanks so much!

Smooth Transition Between Random Colors
how can I make a smooth transition between random colors?
so far I have this done:

this is on the frame action:

myColor= new Color (_root.box);
_root.b1.onRelease = function(){
myColor.setRGB(_global.rndColor)
}

and this is in a movie clip which is off stage, generating a random
value:

onClipEvent (enterFrame) {
_global.rndColor=Math.round(Math.random()*0xffffff );

}

There is a nice one in the tutorials, but I'm not able to use it for some reason. Maybe because it is not for MX 2004.

can anybody help?

Generating Colors In An Array
A beginning AS3 question..
Experimenting with simple timers and I want to appear one of a set of colors randomly on timer fire using the below code:


var myTimer:Timer = new Timer(1000);
myTimer.addEventListener(TimerEvent.TIMER, timerFunction);

function timerFunction(event:TimerEvent) {

var myColour:Number = Math.floor(Math.random()*0xFFFFFF);
this.graphics.beginFill(myColour);
this.graphics.drawRect(event.target.currentCount*2 5,1, 25,25);
}

myTimer.start();


This works to randomly generate a color, but I want to call one of a set of colors. this.graphics.beginFill only takes a numeric value or a fixed color value.

How would I add the var here to activate my set?

var myArray:Array=new Array("0x000000","0x0000FF","0x00FFF0","0x0FFFFF") ;
var i:int;
for(i=0;i<myArray.length;i++){

Random Colors Ever Time You Open A Movie
I was looking at my friend webpage and he has it so that everytime you open the site, the background is a different picture (it cycles through about 5) and the color scheme of the nav. menu is different. does anyone know how to do that?

BeginGradientFill - PROBLEM WITH COLORS ARRAY
I got a HUGE problem with beginGradientFill function, as it says in the manual I pass it an array with bunch of color numbers (example "0x000000"). I let the user input these colors from the component properties window, so the array contains string variables (i assume) and i think thats where the problem lies! In the manual it shows u doing this:

colors = [0x000000,0xFFFFFF];

if you do this:

colors = ["0x000000","0xFFFFFF"];

ITS NOT GOING TO WORK. The question, how do i translate these text array elements into appropriate object type?

Please help

Assigning Random Colors To A Movie Clip On Load
i have a movie clip that consists of a circle, i want when the movie clip loads that it will have a random color assigned to it. here is some code i have found relating to random colors, i am not sure on how to use it.

Code:
var color:Number = Math.random() * 0xFFFFFF;
If any one could give me an answer or comment that would be awasome

eric

Pls Help: Need To Create New Array Taking 3 Random Entries From An Existing Array
Hello

I have a 2d array:

qTeeth[1] = [How many teeth do we have?, 1-10, 11-20, 21-30, 11-20]
etc.

It goes [question, option1, option2, option3, real answer]

I now just want to extract 3 or so of these entries and create a new array with them. Since I want to just use 3 or so questions randomly from a large array of questions.

Does anyone know a good tidy script to do this with??


Thanks in advance,
Ben.

Detecting Which Random AttachMovie Loaded From Random Array
I'm building a Freecell type card game. I've got an array that loads all of the cards (actually, the linkage names for each card loaded from the library with attachMovie). I randomize the array before I "deal the cards" onto the stage.

Here's a little code snipet where "deal" starts off equaling 0 and "cardDeck" is the value from my array (for example, c5 equals 5 of Clubs):


Code:
if (deal<52) {
_root.createEmptyMovieClip("card"+deal, deal);
_root["card" + deal].attachMovie(cardDeck[deal],cardDeck[deal],deal);
deal++
}
There's more, of course. My problem is - How can I detect which card loaded into which movie? For example, I know I have a movie called _root.card6 at the bottom of the first column, how can I know what card is loaded into _root.card6?

Generate Random Value From Array 'excluding' The Current Array Value
getting my head round flash (sorta!)...

ok, nearly got this working; i have 11 movie clips on the root timeline and a empty controller movie. what i need to happen is for a random movie clip to play. when it reaches a point in it's own timeline, it sets the playNext variable to true and the controller movie clip works out the next random movie to play.

the problem comes when the controller 'randomly' picks the movie clip thats already playing! then the whole thing breaks...

is there a way that i can say 'generate me a random clip to play from this array 'excluding' the currently playing movie clip'?

any suggestions would be grand.

this is what i have on my controller clip:

onClipEvent (load) {
//define a new array
video_array = new Array();
//list each of the videos
video_array[0] = "zero";
video_array[1] = "one";
video_array[2] = "two";
video_array[3] = "three";
video_array[4] = "four";
video_array[5] = "five";
video_array[6] = "six";
video_array[7] = "seven";
video_array[8] = "eight";
video_array[9] = "nine";
video_array[10] = "ten";
//this is the count of how many elements (videos) are in your array
max = video_array.length;
//set the playNext to true
_root.playNext = true;
}
onClipEvent (enterFrame) {
//if playNext is true
if (_root.playNext) {
//generate a new random video to play
randomNumber = Math.floor(Math.random()*max);
//store the name
randomVideo = video_array[randomNumber];
//tell that video to play
_parent[randomVideo].gotoAndPlay(13);
//record the video we are playing
crntVideo = randomVideo;
//set playNext to false
_root.playNext = false;
}
}

Generate Random Value From Array 'excluding' The Current Array Value
getting my head round flash (sorta!)...

ok, nearly got this working; i have 11 movie clips on the root timeline and a empty controller movie. what i need to happen is for a random movie clip to play. when it reaches a point in it's own timeline, it sets the playNext variable to true and the controller movie clip works out the next random movie to play.

the problem comes when the controller 'randomly' picks the movie clip thats already playing! then the whole thing breaks...

is there a way that i can say 'generate me a random clip to play from this array 'excluding' the currently playing movie clip'?

any suggestions would be grand.

this is what i have on my controller clip:

onClipEvent (load) {
//define a new array
video_array = new Array();
//list each of the videos
video_array[0] = "zero";
video_array[1] = "one";
video_array[2] = "two";
video_array[3] = "three";
video_array[4] = "four";
video_array[5] = "five";
video_array[6] = "six";
video_array[7] = "seven";
video_array[8] = "eight";
video_array[9] = "nine";
video_array[10] = "ten";
//this is the count of how many elements (videos) are in your array
max = video_array.length;
//set the playNext to true
_root.playNext = true;
}
onClipEvent (enterFrame) {
//if playNext is true
if (_root.playNext) {
//generate a new random video to play
randomNumber = Math.floor(Math.random()*max);
//store the name
randomVideo = video_array[randomNumber];
//tell that video to play
_parent[randomVideo].gotoAndPlay(13);
//record the video we are playing
crntVideo = randomVideo;
//set playNext to false
_root.playNext = false;
}
}

Random Array, Array Name Selected Randomly
Random Array, Array Name selected Randomly

Here is the code:

var RDNumber2x:Array = [2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36, 38,40];

var RDNumber3x:Array = [3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54 ,57,60];

var RDNumber4x:Array = [4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,7 2,76,80];

var RDNumber5x:Array = [5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85, 90,95,100];

var RDNumber6x:Array = [6,12,18,24,30,36,42,48,54,60,66,72,78,84,90,96,102 ,108,114,120];

var RDNumber7x:Array = [7,14,21,28,35,42,49,56,63,70,77,84,91,98,105,112,1 19,126,133,140];

var RDNumber8x:Array = [8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128 ,136,144,152,160];

var RDNumber9x:Array = [9,18,27,36,45,54,63,72,81,90,99,108,117,126,135,14 4,153,162,171,180];

var RDNumber10x:Array = [10,20,30,40,50,60,70,80,90,100,110,120,130,140,150 ,160,170,180,190,200];

var RArray:Array = ["RDNumber2x","RDNumber3x","RDNumber4x","RDNumber5x ","RDNumber6x","RDNumber7x","RDNumber8x","RDNumber 9x","RDNumber10x"];

var RArrayBox:String;
var RArrayBoxS = 0;


RArrayBox = RArray[Math.floor(Math.random() * RArray.length)];


RArrayBoxS = RArrayBox[Math.floor(Math.random() * RArrayBox.length)];


trace(RArrayBoxS);

Heres The error:

ReferenceError: Error #1069: Property 6 not found on String and there is no default value.
at randomarray_fla::MainTimeline/randomarray_fla::frame1()

What I am trying to atchieve is randomly selecting the array name and then randomly selecting something from that array.

So I am randomly selecting from a randomly selected array

Can anyone help with my problem?

Setting Colors With .setRGB (myColor); What Is The Code To Set The Colors 0xRGBB?
sliderColor = new Color(sliderButton);
trackColor = new Color(track);
arrowColor = new Color(arrows);
sliderColor.setRGB(myColor);
trackColor.setRGB(myColor);
arrowColor.setRGB(myColor);

hmm...i got a scroller that i want to turn white and black
this is what it is set to..
what is the code ? is it hex color code? this is weird

help would be appreciated thanks.

In Regards To The "Creating Random Colors In Flash 5" Tutorial.
Original Tutorial Link: http://www.kirupa.com/developer/flash5/randomcolor.htm

I have played around with it and made it "rollover" instead of "release".
However, i don't really like the random colors selected.

Can i choose a certain color series (yellow for instance; light yellow, dark yellow).

Or make it turn into a specific number of colors on the same square; it can randomly select from a series of colors i have listed?

Flash Colors Vs. HTML Colors
I'm having a issue with the colors on a client site we created matching up. I think this is a pretty unique problem. Here is the url: URL I created the flash to appear as if it was under the swoosh, but to give the masking effect of the images are appearing from under the swoosh I had to include part of the swoosh in my flash movie. By doing that I have a color issuse on monitors using 16 bit color. My boss is getting on my case to try and find an answer for this problem and he is the type that doesn't take no for an answer. He wants it fixed and that's the way it is! If anyone could ge me an advice that would be greatly appreciated!

Random Array
I'm back again. I just started with arrays a few weeks ago and am trying to get my big stupid head around them . I know how to retrieve them but what I want to do is when the user comes to a site he sees a random name every time . So in the main timeline I set a variable with an array called quotes
quotes["john","david", "Joseph", "ted","tim", "Jack"] I think you get the idea . Then in mc I have a dynamic text field called quote the code I have in there is
onClipEvent (enterFrame) {

Random Array Again
I still cant get this to work . I have a array set up in the main timeline .
quotes=["john","david", "Joseph", "ted","tim", "Jack"]
temp=parseInt( Math.random ()*5);
randomName=quotes[temp];

Random Mc`s From An Array...
Could someone help me out with this problem:
When I load an .swf with 12 thumbnails, I want the thumbs to fade in from alpha 0 to alpha 100, one by one (mc`s have alpha 0 when loaded).
The thumbs must be faded in a different order each time the movie is loaded.
I have made a start on it with this code, placed on the first frame on the main timeline. On the second frame is a loop action.

//
fade = new Array (image1, image2, image3, image4, image5, image6, image7, image8, image9, image10, image11, image12);
fadecount = fade.length;
index = Math.round (Math.random()*(fadecount-1));
to_fade = fade[index];

fadein = to_fade._alpha;
fadein++;
//

Somehow I have to store the faded mc`s in an array and pick another random number until the fade-array is empty.

Am I on the right track here?

Random Array Nearly There
not set the timer totally up yet.this is so that it waits a while before ti picks again.

problem with this script more than one plays at a time..whats wrong?
please help?


onClipEvent (enterFrame) {
if (timer ==1 ){
startArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
endArray = [];
while (startArray.length>0) {
i = Math.floor(Math.random()*startArray.length);
// a random item from startArray
item = startArray[i];
// add this item to endArray
endArray.push(item);
// and them remove it from startArray
startArray.splice(i, 1);
// objArray.splice(i, 1);
_root.world["alien"+i].gotoAndPlay(2);
timer++;
}

} else {
timer++;
}
}

Random Array
i need to make something that will randomly access data from an array.

like on the pokie machines. except i need text.

all i have now is

text = new Array("blah1","blah2","blah3","blah4","blah5")

rand = random([text])

can someone help

Random Value Array
I am creating some kind of minesweeper. I must take 10 values out of an array but when a value is already taken it must take another. Can somebody help ...

Kenny



for (var i = 0; i<aantalbommen; i++) {
var bommenlijst = new Array(11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 38, 39, 40, 41, 42, 43, 44, 47, 48, 49, 50, 51, 52, 53, 56, 57, 58, 59, 60, 61, 62, 65, 66, 67, 68, 69, 70, 71);

posbom_temp = random(bommenlijst.length);

posbom = bommenlijst[posbom_temp];
this["vakje"+posbom].blokjestype.blokjestype = "mijn";
trace('bom '+i+': positie '+posbom);
}

Random Array
Im making a game and I need to be able to choose 10 numbers at random between 0 and 100 and put them into an array then I need to be able to find the biggest of the numbers and set that number as a variable so I can test if the wright answer is chosen. That wasn't expained very well, so...erm ill draw something



array: 10 random number (0-100)

function answer: this would find the biggest number in the array and set that number as a variable called "answer"

I need this very quickly so any help would be greatly appreciated.

Random Array
How can I create a grid of tiny grey squares (EG:100x50 squares), and have them turn into a different color (eg black) randomly one by one?

http://sony.net/

I want to achieve something like those squares and those types of transitions.

Also, anybody know a good font that looks like that?

Thanks


--iMat

Random Array
this script loads a RANDOM SWF into mcholder

-----------

lastNumber = randomNumber;
movies = new Array("3com.swf", "abes.swf", "abta.swf");
tempMovies = movies;
newMovie = Math.floor((Math.random()*tempMovies.length));

_root.mcholder.loadMovie(tempMovies[newMovie]);

--------

Now I want to random the rest of the array but not the elements that were loaded before...

example:
- first time: it will random between 1-3... I got a 2
- second time: it will random 1 or 3.... I got a 3
- third time: I will get a 1
- fourth time: it will random between 1-3 AGAIN

and so on...
someone help me pleaase...

Random Array
Hi

Is there a function that randomizes the order of all elements in an array.

thanks
scarlac

Random Array
Hi all!!!, I want to acces an array using random, how can I use it??

Thanx for the help

Mike

Random Array
var question = new Array;

question [0] = "string 1";
question [1] = "string 2";
question [2] = "string 3";
question [3] = "string 4";

My goal is when next time the array loads, the sequence should be changed randomly like,

question [3] = "string 1";
question [1] = "string 2";
question [0] = "string 3";
question [2] = "string 4";


( or )

question [0] = "string 3";
question [1] = "string 1";
question [2] = "string 0";
question [3] = "string 2";

no repetation should be there, all the 4 strings should be assigned for 4 arrays.

XML To Array Then Random
Hi All.

I have created an xml doc that holds 2 values (although I will be adding to the values in time)


HTML Code:
<?xml version="1.0"?>
<urls>
<url>
<name>AAAAA.swf</name>
</url>
<url>
<name>BBBBBB.swf</name>
</url>
</urls>
I want to load these two values into flash then put them into an array, then use "random" to choose a random id from the array.
I want the script to still work if there are more valus in the xml.. here is where im at:


HTML Code:
function loadXML(loaded) {
if (loaded) {
_root.urls = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
} else {
trace("file not loaded!");
}
}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("urlz.xml");

urlvar = ["YSYC.swf", "CS_Havering3.swf"];

// i = urlvar.length;
// k = Math.floor(Math.random()*i);
loadMovieNum(urlvar[k], 2);

stop();
I think my issue here is getting the values into the array and getting the array length 2i"

Random Array
can anybody help me to choose a random array and not choose it again if it play again
so i pick one randomly from it and i don't need it again








Attach Code

myarray1 = new Array(1, 2, 3);
myarray2 = new Array(4, 5, 6);
myarray3 = new Array(7, 8, 9);
r2 = random(3)+1;
mm = eval("myarray"+r2);

Random FLV's From Array
Hi!
I' am trying to randomly load 10 short video clips. The script below doesn't work properly. It plays the first video clip randomly, but then nothing else happens. Please answer my questions below.

script:

var VideoArray = new Array();
VideoArray = ["Q1.flv", "Q2.flv", ......"Q10.flv"];

var currentVideo =random(9);

my_video.play(VideoArray[currentVideo]);

var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
VideoArray = random (9)
};
my_video.addEventListener("complete", listenerObject);

QUESTIONS:

1. How to randomly load FLV's?
2. How to make the loaded videos not play automatically?

Thanks for your help.


German
Please check my script and suggest ways to make it work.

Copyright © 2005-08 www.BigResource.com, All rights reserved