PDA

View Full Version : duplicate movie clip



wyclef
July 27th, 2003, 03:28 PM
Hi, Can someone explain to me how I can increase the quantity at a given time being displayed... and the _y: line of code please?


play();

amount = 5000;
i= 0;

this.onEnterFrame = function(){

valueObj = {_x: Math.random()*710,
_y: Math.random()*-550 + 550,
_xscale: Math.random()*100,
_yscale: Math.random()*100,
_alpha: Math.random()*100
}

if(amount>0){
flower.duplicateMovieClip ("mc"+i, i, valueObj);
i++;
amount--;
trace("reflectEnter");
}

}

upuaut
July 28th, 2003, 10:52 AM
probebly something like
your question is a little unclear however without the original FLA file.


play();
amount = 8000;
i= 0;
this.onEnterFrame = function(){
valueObj = {_x: Math.random()*710, _y: Math.random()*-600 + 600, _xscale: Math.random()*100, _yscale: Math.random()*100, _alpha: Math.random()*100 }
if(amount>0){
flower.duplicateMovieClip("mc"+i, i, valueObj);
i++;
amount--;
trace("reflectEnter");
}
}

wyclef
July 28th, 2003, 11:38 AM
increasing the amount doesn't solve the problem. I want to be able to increase the general quantity appearing on the stage or decrease. here is the fla

wyclef
July 30th, 2003, 09:17 AM
Does anyone have any ideas about this?

upuaut
July 30th, 2003, 09:48 AM
ok, this is what I did with it. Try punching this in and see how it differs


play();
amount = 100000;
i= 0;
this.onEnterFrame = function(){
valueObj = {_x: Math.random()*710,
_y: Math.random()*550,
_xscale: Math.random()*50+50,
_yscale: Math.random()*100+100,
_alpha: Math.random()*50+50
}
if(amount>0){
flower.duplicateMovieClip ("mc"+i, i, valueObj);
i++;
amount--;
trace("reflectEnter");
}
}

I think that the number of them doesn't look like it's increasing because they are all squeezed in at the bottem. I solved the _y location by making it a straight random 1 - 550, instead of what they had it set at.

I've also upped the alpha levels to between 50 and 100 % rather than 1 - 100%, and tweeked the scaling a little.

play around with the numbers.

Question. Can I ask who's effect this is. I'd like to use a variation of it, and I always give credit to originators when I can.

wyclef
July 31st, 2003, 02:55 PM
I don't remember where this script came from, it's basically been modified a bunch of times so it's kind of a new version.

So I tried yer code and it still feels more like fireflies than stars, it's not an even randomness blend across the stage but more like insects. I don't know, if you have any more suggestions that would be great. Thanks!

wyclef
August 4th, 2003, 10:19 AM
Here is what I have so far, basically it still feels like a bunch of fireflies rather than twinkling stars. Could someone please help me make this look more like a twinkling start field? Thanks!

wyclef
August 4th, 2003, 04:33 PM
:pope: any ideas?