a num amount of time and then add speed which i define to its
y and boom another var which i defined to its x.
Can someone tell me whats wrong
I have a movie clip called Firework that have these parameters on it
name:gravity----var:grav---default value:10
name:launches----var:launch---default value:30
name:numspark----var:numspark---defauly value:5
// I wrote this in an earlier frame called Init var spark:MovieClip = Firework.Spark; var gravity:Number = Firework.grav; var launches:Number = Firework.launch; var num:Number = Firework.numspark; var gravup:Number = 0.05; // inside Firework there is an movieclip called Spark // num is the number of sparks i will have
This works fine but here comes my problem
var count = 1;
for (i=1; i<num; i++) {
var speed:Number = launches-gravity;
gravity *= 1.04;
var ran2:Number = random(8);
var heading = "spark"+i;
duplicateMovieClip(spark, heading, i);
var boom:Number = random(40)-20;
eval(heading)._x += boom;
eval(heading)._y -= speed;
trace(eval(Firework.heading)._y);
if (ran2 == 1) {
eval(heading).gotoAndPlay(2);
count++;
}
}
if (count == num) {
gotoAndPlay("wait");
}
let me explain what im trying to do, im trying to duplicate a
movieclip called spark num amount of times and set its name to
heading. Then i will add the value boom to heading's x and speed
to heading's y.Then i make a random number called ran2, the code
will then play over and over, which i ensured with a frame
actionscript command, until ran2 equals 1. Then i will play frame
2 in heading and add 1 to count. Finally i have a if statement
saying that if count == num then ill goto and play a frame called
wait.
words highlighted in red doesn't work
Edited by FlashGameboy, 22 January 2006 - 08:35 PM.
