I just want to create sparkling stars at random. I can place the twinkling star to one random location but that is fixed while i close the window. I want to place the star at different random locations in the same window. I googled and i found action script code but that dosnt useful for a movieclip animation.
code:
onClipEvent(enterFrame)
{
_x=_x=random(250);
_y=_y=random(250);
}
by this actionscript to the movie clip, I can executes continuously but it is very fast one.
code:
onClipEvent(load){
_x= random(200);
_y= random(200);
}
this choses random location but the location is static while i close the window.
I want to Place the movieclip at different location just after finishing of the previous one. How to do that one?
Thank You very much for that code. Now only I understand a little bit about onClipEvent. I was tried to make a starry night using the same movieclip. i succeeded a little bit. But I am not satisfied. I just make duplicates of my movie clip 50 times and places thats at random positions by this code.
code::
for(var i=1;i<=50;i++){
newname = "star1"+i;
star1.duplicateMovieClip(newname,i);
newname._x = random(750);
newname._y = random(550);
}
star1 is my instance name in properties. I got 50 stars at random positions when i set actionscript code as
onClipEvent(load){
_x= random(800);
_y= random(600);
_alpha = 100;
}
onClipEvent(enterFrame)
{
if(_alpha<=0){
_x = random(700);
_y = random(599);
_alpha = 100;
}
else {
_alpha--;
}
}
all stars just dimmed slowly and disperses, then a new set of stars appears. But all the 50 stars starts and disperses at the same time.
I want to chose some of stars at random to start at beginning, before finishing of the movieclip the second set is to be started. How to set such a condition and where to set. pls refer the attached file.
yep the code works perfect but i am unable to find meaning of these codes. Actually what these code does? Can you please explain a little bit how it is executed?