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




Random Variables [renamed]



I've been working on a deal or no deal game (my first game) and I'm stuck. I just need a script to make 22 variables that are randomly equal to numbers 1 - 22, so I get a result like this:box01 = side09;box02 = side12;box03 = side19;......box22 = side04;thanksEDIT: I should probably clarify that all 22 numbers need to be different.



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-07-2006, 09:30 PM


View Complete Forum Thread with Replies

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

Random Motion Problems [renamed]
I am working on a project, and was using the Scripts From:
http://www.kirupa.com/developer/mx/random_motionMX.htm

In my file I have applied the scripts to multiple Movie Clip objects, and need help creating a script that will allow a series of buttons to Stop and Play the MCs. I need also to have all of the action to be frozen initialy but I think that I may have a come up with a way to do what needs to be done for that part.

I have not included the File, as I have not been able to get the bloody thing down below the Limit. I have even removed everything but one MovieClip and the Buttons. And still...."Limit for this filetype is 74.0 KB. Your file is 116.5 KB."

I am still very new to actionScripting and would appreciate any help with this project.

Thak You,
SychoPsamIII

Loading Random Background Problems [renamed]
I am looking for someone skilled with Flash, a Wizard hopefully...

I have been trying to create a .swf that loads a Random background image (like the one on Kirupa's MX tutorial on this site) ... and my skills are just too insuficient.. I got it working but the images loads in sequence too fast and my general composition and work is kinda messy...

Is there someone here who is interested in helping out ?

The project is for our website, we are a non-commercial gaming clan, and alot of programmers, but none of us have any serious Flash experience. We are able to advertise/link back to anyone who might wanna help us out.

Contact me on email: therseus@gmail.com

Loading Random Background Problems [renamed]
I am looking for someone skilled with Flash, a Wizard hopefully...

I have been trying to create a .swf that loads a Random background image (like the one on Kirupa's MX tutorial on this site) ... and my skills are just too insuficient.. I got it working but the images loads in sequence too fast and my general composition and work is kinda messy...

Is there someone here who is interested in helping out ?

The project is for our website, we are a non-commercial gaming clan, and alot of programmers, but none of us have any serious Flash experience. We are able to advertise/link back to anyone who might wanna help us out.

Contact me on email: therseus@gmail.com

[AS3] Passing Variables To PHP [renamed]
they make filereference to upload files, but don't even allow you to pass variables to php. how silly.

please tell me they correct this in actionscript 3.

Questions About Random Character Movement And Hit Detection For Game [renamed]
Hey every one i was thinking of making a new game where there are rebel smiley men( because i love smileys) and you just kill them and get as high a score as you can.

What i need to know is how i can make them have random movement.
Not just normal random movment but when it decides to walk up it will change to a different frame within the rebel and make it face the direction of its movment.

i also ened to know if when a mc moves into a invisable barrier or the rebels sight that it will try and kill the mc.

Thanks in advance

Problems With Number Variables Becoming NaN [renamed]
i don't understand what the heck is going on here. i have two variables in an onEnterFrame function, lets call them A and B. they each track a specific point on the y axis (A is dynamic). then i have a third variable X that is supposed to track A + B.

trace(A); //returns numeric value
trace(B); //returns numeric value
trace(A+B); //returns numeric value

trace(isNaN(A)); //false
trace(isNaN(B)); //false
trace(isNaN(A+B)); //false

trace(X); //returns NaN

why do i get X as NaN, when X = (A+B)? i don't get it and it's got me at the end of my rope.

please help,
Kurt

Variables In For Loop Problem [renamed]
i wanna create a photo album.this is thumbs page.


Code:
for(i=0;i<2;i++){
this.createEmptyMovieClip("logo_mc"+i+"", 999);
loadMovie(""+i+".jpg", logo_mc+i+);
}
how can i solve this problem about variables??

Variables In For Loop Problem [renamed]
i wanna create a photo album.this is thumbs page.


Code:
for(i=0;i<2;i++){
this.createEmptyMovieClip("logo_mc"+i+"", 999);
loadMovie(""+i+".jpg", logo_mc+i+);
}
how can i solve this problem about variables??

Variables Dissappear On Entering New Frame [renamed]
Hi there, i have a little problem. I have the code below, which loads in from an xml file and makes buttons and sets variables, but when we enter a new frame for somereason the variables dissapare. how can i fix this?


Code:
//
//hide the original button
this.button_mc._visible = false;
//set the starting Y position from the first button
Ystart = this.button_mc._y;
//
//create the Array
files = new Array();
//
//create the XML
var XMLreciever = new XML();
XMLreciever.ignoreWhite = true;
//onLoad Function
XMLreciever.onLoad = function(success:Boolean) {
if (success) {
//loop thru the <buttons> nodes in the XML
for (i=0; i<this.firstChild.childNodes.length; i++) {
//enter the current name attribute of the <buttons> node into the files array
files[i] = this.firstChild.childNodes[i].attributes.name;
//
//duplicate the button on the stage
duplicateMovieClip(_root.button_mc, "button_"+i, i);
//set the Y position of the new button
_root["button_"+i]._y = Ystart;
//Incremement the Ystart variable for the next button
Ystart += 35;
//set the text on the button
_root["button_"+i].textbox.text = files[i];
//set the image variables
_root["button_"+i].image1 = this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
_root["button_"+i].image2 = this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
_root["button_"+i].image3 = this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
}
}
};
//load xml file
XMLreciever.load("images.xml");
files located at http://www.zedcom.co.nz/movie3.zip

Thanks
Mattzi

Random Variables
I am doing a weather report example for a virtual wap phone.

I have three dynamic text boxs which will show the weather in three citys.

My problem is that I want to randomly call 4 different txt files with the 3 variables for the dynamic text boxes but with obviously different reports, so that every time you go in it will be different.

Can you loadVariables, but from a random txt file?

Or can you call a random variable from a txt file?

If you could help, that would be super!

Random Variables
Hello,

I am looking for a simple method to randomly display pictures that will be stored on different servers.

I would like to assign variables (A, B, C, etc...) to parts of the address where the pictures are located.

For example:

A could be assigned to
http://www.domain.com
B to second part
/pictures
C to filename
/SET100012.jpg

This way servers can be different but hold the same structure with a common directory pictures. I just have it randomly select A1 or A2 if I want 1 common B section.

Also, I want to be able to randomize C section which are the individual pictures.

Any help on this would be appreciated.

Random Variables
I am using Flash MX and wanted to make a game like "whack a mole", except im going to be using pictures of my relatives instead (they dont know it yet!). I made buttons out of their faces so that when you click them, the faces change and make a sound. I was wondering how to make the buttons appear randomly on a 4x3 stage. I know OOP but action scripting has confused me so far. Thanks.

-Matthew Walsh
walshms@cs.slu.edu

Random With Variables Mc - Help Please
random with variables mc - help please

okay, what i have is a choose section that sits at the top of the page. in the choose movieclip i have three instances of a background movie clip.

now within the background movieclip there is 9 frames. each frame has an image mc in it and a stop command, except the first frame-this has nothing in it other than a command to goto and play a random frame within the background mc timeline.

now what i need to happen is to make sure that if one of the instances of the background mc is on frame (we'll say 3) then the other two instances of the background mc are not on frame 3. they all need to be different from each other.

help please. this should be an easy set up of variables but my brain is not functioning right today.

for those of you that have no idea what i am talking about, here is a test file.

http://www.levelthirteen.com/test.html

click on the "choose" button several times. you see the three mcs that change. sometimes they are the same image, and that is what i don't want to happen. i want them to be different from each other every time.

thanks everyone
[Edited by levelthirteen on 09-20-2002 at 04:05 PM]

Variables And Random
Hi!

This is the code, i wont to make line 1 ( the box ) to
random number 1-9 and the second row 9-19 and the third
19-29 and so on, how to make that? now there is no order where
the numbers apair.

Question 2, how do you make random numbers for example

100 and 500 and 1000, its for a lotteryticket with values
that to be displayed randomly

Check example for the first question

http://m1.271.telia.com/~u27103713/

Thanks!

Help With Random Variables
i need a code to tell 13 targets(instance names 1-13),
using a random # (out of 24), to go to and play the frame
within the movie clip that corresponds with that random #.
so far so good:

on (release) {
for (i=1; i<=13; i++) {
tellTarget (i) {
rune = Math.ceil(Math.random()*24);
gotoAndPlay (rune);
}
}
}
}

but now i also need to test to make sure that random # hasn't already
been picked. i am at my wits end. no matter what i do i get repeats.
i have also tried this with a while loop but the player crashes when i do that. see attached pictures for more info.
help!!!!!!!!!!!!!!!!
randym

Random Variables?
Hi

I'm trying to create a simple game using Flash5 on XP professional - I haven't used flash for years and was never an expert:

The user can type in up to 10 names.
Click a button.
The names are displayed equidistant around a circle.
A movie plays and one of the 10 names is displayed at the end - it is picked randomly. It will either be displayed in the centre of the circle, or i may use a rotating pointer which stops on one of the names.

I'm afraid I haven't got very far with this. So far all I've managed to do is create 10 fields, input names, click a button, and display the names.

Can anyone help me do the following:
1 how do i get flash to recognise how many names have been input?
2 is it possible to tab between text boxes rather than having to click in each separately?
3 how can i get flash to work out angles between each name displayed around a circle - ie if there are 2 names, then they will be placed at 180degree intervals, 3 names = 120degree etc.
4 how can i get flash to randomly pick one of the input names?

I've tried looking at flash help, and action scripting reference but i don't know where to start.

Thanks in advance

Random Variables
hiya!

i was wondering is its possible to do random variables?

like, if a had 2 variables, min = 10 and max = 15,

then what i wanna do is make an event that
randomly chooses a value between the numerical values
of min and max, (10 - 15)

any ideas?

thnx a bunch!!

Random Variables Not The Same
i'm kinda new, so please be nice to me!!

i have 9 variables that contain random values. how would i go about making sure none of the variables are the same or equal one another? i know i could write a ton of "if" statements, but theres gotta be a better way. maybe a "for" loop? anyway to go about this would be greatly appreciated.

Thanks,
Gena

Random Variables
How do I make it so when I press a button a variable textblock goes down a random number between 10 and 20.

Variables/random/repeating?
i need to be able to call a text file with x-amount (probably about 100) of variables in like:

&variable1=blahblahblah
&variable2=yacketyschmakety
etc etc

No probs so far... then what I need to do is to be able to use these variable by chosing five or six at random and tranfering them to named buttons with out any of them repeating...

Is this possible, am i wasting my time?
Yours in dire need of assistance
The Bombadier

Can Random Numbers = Variables?
this is what i hav at the beginning of my script

Math.randomRange = function(min, max) {
return Math.floor(Math.random()*(max+1-min))+min;
};

than later i declare this variable

var A = trace(Math.randomRange(15, 20));

m i doing this rite? how do u make variables equal a different number ever time u use it, and still set a minimum and maximum limit? what is the easiest way to do this?

Choose Random Variables
I want to know an easy way for flash to randomly select variables from a pre-existing list. For example randomly select x,y, or z? Any ideas please (for Flash 5)

Random Variables Not Working..
Okay what i'm trying to do is create a fly that hovers a bit, flies to another location, hovers a bit, flies to another location etc..

But theres some weird stuff happening i dont really understand..

heres the code i've written for now (located in the first frame of the root layer)


Code:
//all variables here
var angle=0;
var speed=0;
var movevar=0;
var setHalt=0;
var waitTime=50;
//animation:

function slide(angle,speed)
{
//make angle a radial number
angle = (Math.PI/180)*angle;
//use angle to set x speed:
var xSpeed = Math.cos(angle)*speed;
//use angle to set y speed:
var ySpeed = Math.sin(angle)*speed;

this.fly._x = this.fly._x + xSpeed;
this.fly._y = this.fly._y - ySpeed;
}
// this function adds to the angle
function rotate(angleVar)
{
angle = angle+angleVar;
}
function accelerate(accVar)
{
speed = speed+(accVar);
}

//important functions:
function wait()
{
waitTime=waitTime-1
if (waitTime==0)
{
setHalt=0;
//set to random
angle=Math.random()*360;
if(this.fly._y>550)
{
angle=225 + Math.random()*90;
}
if(this.fly._y<50)
{
angle=45 + Math.random()*90;
}
waitTime=30+Math.random()*30;
//end random
}
}
function moveStop()
{
if (movevar<11)
{
accelerate(0.5);
movevar = movevar +1;
}
if (movevar>10 && movevar <30)
{
movevar = movevar +1;
}
if (movevar==30)
{
speed=0;
movevar = 0;
setHalt=1;
}
}
//////////////////////////////////
// enterframe events: //
//////////////////////////////////
this.onEnterFrame = function()
{
if (setHalt==0)
{
moveStop();
}
if (setHalt==1)
{
wait();
}
slide(angle,speed);
}


but i'm having problems in the function wait()

this is working:

Code:
angle=Math.random()*360;


but these things dont:
this is supposed to make the fly turn back when it moves to far up or down the screen, and set the time it's hovering to a random number.

Code:
if(this.fly._y>550)
{
angle=225 + Math.random()*90;
}
if(this.fly._y<50)
{
angle=45 + Math.random()*90;
}
waitTime=30+Math.random()*30;


however, if i just set waitTime to 50 or so (not a random number), it works :S
i traced waitTime=30+Math.random()*30; and that just gives me a number, but i really have no idea why it makes the fly stop.

Anyone care for helping me out with this one?

[F8] Trouble With Variables And Random
Okay, here goes!
i am trying to create a variable that will give a random number between 1 and 5
in a movieclip on my timeline , i have 5 frames, each holding an image.
i want a random number to display a random image, i.e if the number is 1, it should go to frame 1, if its 2, it should go to frame 2.
I tried declaring the variable on the main timeline (in reality, i am working in another whole movieclip here, but my project contains so many areas that i am keeping it within this one movieclip)
using: _global.combination1==(Math.random()*5);

and including this code in the timeline of the 5 images movieclip

if(_global.combination1=1)
{gotoAndPlay(1);
}
if(_global.combination1=2)
{gotoAndPlay(2);
}
if(_global.combination1=3)
{gotoAndPlay(3);
}
if(_global.combination1=4)
{gotoAndPlay(4);
}
if(_global.combination1=5)
{gotoAndPlay(5);
}
i have tried global and local variables, but nothing seems to work!

Random Non Repeating Variables
OK I'm somewhat descent at Actionscript, but I'm brand new to arrays. I know very little about them. It seems at the moment I'm going to have to make use of them.
Here's what I'm doing:
I'm creating a flash game in which you are a UFO flying over a group of cows and you have to abduct them. It's a top view game so I have the grass moving from top to bottom and I have a movie with 5 cows and theres a controller in the _root movie that creates a random variable:
_root.cows = random(5);
Now everytime the controller movie gets to a certain frame, that frame tells the cow movie to play a certain cow (Moving from top to bottom) based on the current variable.
What's happening is when there is a repeat, the cow disapears and jumps back to the top. Seeing how there's only 5 cows you can tell this happens a lot.

Now I've researched this a bit and found that I can create an array of random numbers and splice each one as I've used it. I've tried this, copied different codes and I can't get it to work.
I'm probably placing it wrong or something, but being a man who is used to his variables, maybe I'm doing something the wrong way. Please explain, if anyone can, how I can do this....and if possible explain as if talking to a third grader. thanks

DuplicateMovieClip - Random Variables
It seems like the random variables in my duplicated movieclips are all the same, any way to change this?

To explain a bit more in detail: I got a movieclip with a few random variables and actions and I duplicate this movieclip and want the duplicate to have different random variables than the first one, but it gets identical ones.

Need To Create 12 Random Non-repeat Variables?
I need to create 12 random numbers (non-repeating) that I can call on one at a time as variables. (Ex. variables a1 thru a12 would be random numbers 1 thru 12). I want to use these later to tell an 12 MC instances to go to one of 12 frame labels and non of them be on the same label.

I've tried it a couple different ways and have come very close but each method has a different bug in it. Can anyone help?

Neo

Variables/Random Number Problems
Hey,

Im making a script which draws a comment from a text file and displays it in a dynamic text box, randomly...

n = random(6);

loadText = new LoadVars();
loadText.load("data.txt");
loadText.onLoad = function() {
comments.text = this.n;
};

so basically i define the variable n as a random number between 0 and 5, then in the data.txt file i have:

0=comment 0
1=comment 1
2=comment 2
3=comment 3
4=comment 4
5=comment 5

If i dont use the variable in this.n and use a different value it seems to work...(comments.text is the instance name of the dynamic text box)

thanks for any help

-Ross

[CS3] Placing An MC On Stage With Random Variables...
Hello, I have a MC in my library with linkage set up called "mc1" that I'd like to have "x" number of instances placed on the stage (where "x" would be a variable I could change). I'd like to have each instance be placed at a random place on the stage, also with a random rotation value, and also a random scale size from 50%-100%...

...Can anyone help me out with this? Thanks so much!!!

Random Numbers Into Variables With Loop?
hi some help on this would be greatly appreciated.

i have this code to generate 3 random numbers yeah.. and i want to pass them into var1 var 2 and var3. how do i do it?

n = 3;
for (r= 0; r < cards.length && n > 0; ++r){
if (random(cards.length-r) < n){
n--;

please help.

Scenes Based On Random Variables
I'm trying to build a program where specific scenes are played depending on a randomly generated number. So far the number is generated, but the movie doesn't play the right scene.

This is the code I have now;

var score:Number;
score = random(100)
if (score >= 95) {
gotoAndPlay("Scene 3", 1);
}
else if (score >= 80) {
gotoAndPlay("scene 4", 1)
}
else if (score >= 65) {
gotoAndPlay("scene 5", 1)
}
else if (score >= 50) {
gotoAndPlay("scene 6", 1)
}
else if (score >= 25) {
gotoAndPlay("scene 7", 1)
}
else if (score >= 0) {
gotoAndPlay("scene 8", 1)
}

Load Variables From Random Text File In Set? HELP
I need to be able to_ Load variables from random text file in a given a set._ I am using the newest flash version (fx, mx??) on Mac OS X
heres what I was emailed
"needs:_
1. we'd like this game to load numbers dynamically from a given range
of numbers rather than from a textfile._ If all the numeric variables
loaded randomly from say a range of 1 to 10 for level 1 then how can
you program to make the answer for the game?_
2. , we have to devise a
way to keep track of the number of times a user chooses the bucket and
make the bucket work that many times._ So if you click 30 times
really fast on the bucket, it will probably only work 2 or 3 times as
it has to play an animation after a click._ The bucket becomes
inactive while in animation so how do we tell it to keep working
based on clicks?_
3._ keeping track of correct answers._ So this may be a way off but
we need to keep track of the wins by a user when they enter into the game._ keep track of these wins over the course of the whole game, or based on each user. "
can anyone help me or give me code for how to do any of this? I am rather lost and don't know where to begin- please help! I am still a beginner and would love some step by step how to's thank you!

Passing Random Variables To Called Functions
I'm just getting back into Flash and AS2.0, while totally awesome, has been quite a challenge to learn for someone who dropped out of the industry around Flash 5.

Anyhow, here's my problem. I'm trying to make a menu whose elements randomly scroll up and down the y axis +/- 5-25 or so pixels (estimating that on visual needs), with some Math.random at the fringes.

I'll paste the code I have so far below. My issue is that I want EACH different menu instance that calls the function, or that the function is applied to, to be able to enter a unique random # that alters its movement. In short, I want each to move randomly from each other. It seems, no matter how I try to pass an argument to the function, that the function always operates the same on each menu item, so they move in sync.

I'm sure I'm missing something here, and I'm feeling very green about all this. Any and all help would be appreciated!

Here's the code with nothing being passed to it. I've tried to pass it different variables for each instance, but they all still behave generically. Is there a better way to do this?

mover = function() {
startY = this._y;
this.onEnterFrame = function() {
speed = (Math.random())/2;
myY = this._y;
if (myY <= startY + (Math.random()*5)) {
myToggle = 0;
}else if (myY >= startY + (Math.random()*145)+10) {
myToggle = 1;
}
if (myToggle == 0) {
this._y += speed;
}else if (myToggle == 1) {
this._y -= speed;
}
};
};
myToggle = 0;
mover.call(_root.menuBar_mc.aboutBtn_mc);
mover.call(_root.menuBar_mc.artistsBtn_mc);
mover.call(_root.menuBar_mc.releasesBtn_mc);
mover.call(_root.menuBar_mc.eventsBtn_mc);
mover.call(_root.menuBar_mc.linksBtn_mc);
stop();

Selecting A Random Variable From A List Of Variables
Hello
Im using loadVars to gather variables from a txt file.
The variables are as such - a1, a2, a3 ,a4, ...
Id like to know if its possible/how to pick one of those variables randomly.

I tried constructing the variable name with random operations but it wont acknowledge the result as a variable, it will think its a string.

Random Variables -- Easy Question You, But Driving Me Crazy.
Simple: I'm trying to create a button that plays (not loads) one of several MCs at random. Let's say I have 4 MCs with instance names MC0, MC1, etc. I would think I would do as follows:

on (press){
set ("randNumber", random (4);
_root.MC&"random".gotoAndPlay(2);
}

Besides not working, the code does seem instinctually bad to me, but it must be close. Thanks in advance.

Loading Flash Variables From Text File And Using In Random
In flash 5 I loaded variables from a text file and i can display them in dynamic text fields. (varibles are integers), but I can't do math with them or use in the Random() function. Flash recognises their values as 0. Does any one know how I could do this, thanks.

Random Integer, & Creating & Destroying Data In Variables
Ok, so this is what I have,

RandomHex(c)

generates a random Hex code from 0-F

showing as 0xHexCodeHere

Question 1: I need to destroy the circle after about 4 seconds.. Im not sure how to do that, is there any destroy variable? or can I do
Your_Var = NULL or null;

Question 2: how do I do a random int?
var int_x:Number = Math.random(0,20);
?? to generate random number from 0 - 20?

my function
CreateCircle() should create a circle
And my function move_circles(orb1, orb2, orb3, orb4, orb5)
should call it when Rad[1] is 0 (at the very center point of itself)

this is my code (it doesnt work)


Code:
//main
var main:MovieClip = this.createEmptyMovieClip("main", this.getNextHighestDepth());
main.lineStyle(0, 0x000000, 100);
_global.i = 0;
//orb 1
var orb = Array()
var code = Array()
code[0] = 0xFF0000;
code[1] = 0x00FF00;
code[2] = 0x0000FF;
code[3] = 0xFA0CE3;
code[4] = 0xCCCCCC;
var CircleRadius:Number = 10;
var int_n = 5;
_global.c = int_n;
var int_extra = 1;
var count_down = int_n+1
for (var i:Number=0; i<int_n; i++)
{
orb[i] = new MovieClip();
orb[i] = main.createEmptyMovieClip("orb"+i, main.getNextHighestDepth());
orb[i].lineStyle(count_down*10, code[i], 100);
orb[i]._x = 600;
orb[i]._y = 400;
orb[i].moveTo(CircleRadius, 0);
count_down -= 1
}



for (var i:Number = 0; i<361; i++)
{
var Radius = i*Math.PI/180;
var X = Math.cos(Radius)*(CircleRadius);
var Y = Math.sin(Radius)*(CircleRadius);
var X2:Number = Math.cos(Radius)*(3);
var Y2:Number = Math.sin(Radius)*(3);
for (var n:Number = 0; n<int_n; n++)
{
orb[n].lineTo(X, Y);
}

}
function RandomHex(c)
{
new_code=Array()
for (var i:Number = 0; i<10; i++)
{
new_code[i] = i;
}
new_code[10] = "A";
new_code[11] = "B";
new_code[12] = "C";
new_code[13] = "D";
new_code[14] = "E";
new_code[15] = "F";
c = Math.random(0,15)

}
function CreateCircle()
{
code[_global.c] = "0x"+RandomHex(code[_global.c]);
orb[_global.c] = main.createEmptyMovieClip("orb"+_global.c, main.getNextHighestDepth());
orb[_global.c].lineStyle(5, 0x000000, 100);
orb[_global.c]._x = 600;
orb[_global.c]._y = 400;
orb[_global.c].moveTo(3, 0);
_global.c += 1;
}
function move_circles(orb1, orb2, orb3, orb4, orb5)
{
_global.i += 1;
if (_global.i > 361)
{
_global.i = 0;
}
var Radius = Array();
var Rad = Array();
var X = Array();
var Y = Array();
var orb = Array();
orb[0] = orb1;
orb[1] = orb2;
orb[2] = orb3;
orb[3] = orb4;
orb[4] = orb5;
for (var i:Number = 0; i<5; i++)
{
Radius[i] = (i+1)*10;
Rad[i] = _global.i*Math.PI/5;
X[i] = Math.cos(Rad[i])*(Radius[i]);
Y[i] = Math.sin(Rad[i])*(Radius[i]);
orb[i]._x += X[i];
orb[i]._y += Y[i];
if (Rad[i] = 0)
{
CreateCircle();
}
}

}



setInterval(move_circles, 100, orb[0], orb[1], orb[2], orb[3], orb[4]);

Photogallery Issues - Preloading Movie With Random Image And Variables
hej,

ive been searching everywhere, but coulnd find it,

id like to preload movie loaded into a target MC, but this preloaded movie loads yet additional content, which is random image (an image of a variable size, and the size of the image will be passed on to flash in variables from php script) and a set of variables,

and Im totaly lost, as when i try to load it, the getBytesTotal will be only of the movie size to preload, it will not add up the image to the total size nor, which is obvious, the variables,

how to go around it for my movie not to start playing without all the variables and image having been loaded,


ok,
down to my second question

the whole thing is Im trying to build a photogallery,
after a person hits "PHOTOGRAPHY" link, the list of photogalleries is loaded and displayed into a targetet movieclip, each link to the photogallery would be generally a duplicated MovieClip, which would have a button and variable text inside of it,
what Im thinking of is when the photogalleries variables are loaded into the movie, I dont want the links-duplicated movieclips to appear just all together, but one at a framerate,
each of the links-duplicated movieclips would have a little tween, going from alpha 80 to 100 and than back again to 60, to make a wave-like appearence of the available photogalleries...

hmm.. I hope you understood, what I meant )

so my problem with the second question is, where do I put the
for(i... loop, to make the duplicate movies appear in the manner I described above?
I wrote:

onMovieClip(load) {
//set the i variable
i=1;
}
onMovieClip(enterFrame) {
duplicateMovieClip("blabla", "blabla"+i, i);
// no worries about the rest
i++;
if(i == number_of_photogalleries) {
stop();
}
}

but it somehow didnt want to work...

basicaly, what I want to achive is similar to:
reverence.rayoflight.net
and days of the month appearing on the calendar,

I also recommend to check it out, its a great databasedriven flashsite,

thanks a lot for any help,

Loading Two Swf's Next To Each Other [renamed]
ok wow!! i need HELP big time with some stuff! first of all..im trying to load an .swf movie (or file which ever it is) into my main movie...well the way im doing that is by clicking a button and then the movie loads...then im wanting to be able to click another button and load a different movie BUTTTT when i do this right now the second button's movie loads right over the first buttons movie!! what do i do?!?


also im wanting to make a text scroller with JUST the slider. how can i go about this?

p.s.
would appreciate just verbal help b/c i would like to try to do this without using someone elses stuff ...if thats ok...?!

If/else Problems [renamed]
lo all. im having trouble with a menu im workin on.
ages ago i learned how to use if statments to control a menu system like this one, but i've lost all my source files and cant remember much of the script, i remember settin variables on the buttons then usin if/else/else if actions to target frames (if button pressed = button 1 goto and play etc...) if you got 5 mins to look at the fla you shud see what im trying to do...basic i know...im just a noob. also i think i learned it in v5, the actions may have changed in v6 /v7. if anybody gets what i mean from this (vague) post and knows of any nice tutes please please let me know!
any help greatly appreciated!!
kev.

p.s. im usin v6

How Is This Menu Done? [renamed]
If you go to the www.panasonic.co.uk, you will see this amazing menu if you click "in the home & on the move". Can someone tell me how this is done please

best regards

Cd Rom Issues [renamed]
Help!!, I'm not very good at scripting, and I have been trying all day to find the answer to this simple operation, so this is like a last hope. I am developing a cdrom, and I have a main page with 8 buttons, which I want the user to click where they want to go and navigate back to and from this page. Is it better to make each of the 8 sections on new scenes, or would a separate movie for each be better. I feel that a separate movie would be better as the file size is quite large on some of the sections, but i'm not sure and could really use some advice. If I do make separate movies, then please what is the script for the buttons to navigate to the movies (i guess i would be loading .swfs'). I really need some help with this please.

Help With Sound (renamed)
I tried performing this tutorial:
Creating a Volume Control Slider http://www.kirupa.com/developer/mx/volume_slider.htm

I added my song to the library and exported the file to my desktop. The swf file plays perfectly on my desktop...the slider, stop and play button all work. The problem arises when i upload to website. It appears on the site but it doesnt play. It only says that it is downloading song and just stays like that for a considerable amount of time. I cant understand why it works on the desktop and not on the website. I think it is a quick fix... can someone can just tell me what i am doing wrong?

How To Color A Mc [renamed]
Hi Guys,

I wonder if you can help me out on this....

I want to create a color palette one side and on the other has like a white board so when a user select a color from the palette that color will appears on the white board.... How can you do that? Can you supply me a sample?

Thank you.

Bobby

Published Swf Is Way Too Big [renamed]
I need help publishing a .fla file.

any help is appreciated.

I've been toying some time now with Flash MX and websites, but never reach the point where I need to publish the .fla properly onto the net. I've reached that point now.

My problem is getting the final movie to work probaly in the browser. The final .swf movie is 2,81mb, because it contain a lot of pictures. Is that too much? When the .html and .swf is uploaded to ftp, the screen goes black in the browser, like the background color of the site, and it seems like taking forever to load the site and in the end nothing shows.

So what is the proper way to publish to fix this?

*** Renamed *** Masking Help
Is there no way I can do this with multiple MCs, each one moving around independently, but masked by the same lens MC?

Loading Two Swf's Next To Each Other [renamed]
ok wow!! i need HELP big time with some stuff! first of all..im trying to load an .swf movie (or file which ever it is) into my main movie...well the way im doing that is by clicking a button and then the movie loads...then im wanting to be able to click another button and load a different movie BUTTTT when i do this right now the second button's movie loads right over the first buttons movie!! what do i do?!?


also im wanting to make a text scroller with JUST the slider. how can i go about this?

p.s.
would appreciate just verbal help b/c i would like to try to do this without using someone elses stuff ...if thats ok...?!

If/else Problems [renamed]
lo all. im having trouble with a menu im workin on.
ages ago i learned how to use if statments to control a menu system like this one, but i've lost all my source files and cant remember much of the script, i remember settin variables on the buttons then usin if/else/else if actions to target frames (if button pressed = button 1 goto and play etc...) if you got 5 mins to look at the fla you shud see what im trying to do...basic i know...im just a noob. also i think i learned it in v5, the actions may have changed in v6 /v7. if anybody gets what i mean from this (vague) post and knows of any nice tutes please please let me know!
any help greatly appreciated!!
kev.

p.s. im usin v6

How Is This Menu Done? [renamed]
If you go to the www.panasonic.co.uk, you will see this amazing menu if you click "in the home & on the move". Can someone tell me how this is done please

best regards

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