8 Replies Latest reply on Jan 23, 2007 1:51 PM by kglad

Blinking starfield out of one mc - the final question

I have create one tweening star in a mc.
Its´s a bitmap which is blinking and changing colors in a animated circle.

I´ve got one answer from shikozel who´s answered this:
>you need to give your star movie clip a linkage name. lets say star_mc. Then loop 100 times. in each
>loop you attach the >star_mc in a random place on the stage. lets say the width of your stage is
>500wx500h. The code should look like that:

>for(var i:Number=0;i<100;i++){
>star_mc=_root.attachMovie("star_mc","star_mc"+i,_rott.getNextHiestDepth())
>star_mc._x=random(500)
>star_mc._y=random(500)
>}

And the final question is:
Cool, this is the first step- to spread the mc all over.
But I wonder if they can be spread in time. Why?
- So every star is moving and blinking individual in time.
- Now the starfield moving and blinking as a group, where every
star is in the exactly same position in their tweening
process, in time.
(the blinking status is exactly the same for eveyone)
In other words:
How to create a starfield where every star is blinking and
changing it´s colors individual?
:b/]
• 1. Re: Blinking starfield out of one mc - the final question
try:

1 person found this helpful
• 2. Re: Blinking starfield out of one mc - the final question
Ok, now i´m thinking - could setIntervall solve the problem?
• 3. Blinking starfield out of one mc - the final question
KGLAD
Ok , I´m gonna try that
• 4. Re: Blinking starfield out of one mc - the final question
setInterval() would be one approach, but then the appearence of your stars would be staggered. ie, you would be adding one (or a few at a time) and if you add a few at a time, they would be sync'd and probably give an satisfactory appearence.
• 5. Re: Blinking starfield out of one mc - the final question
I`ve tried:
for(var i:Number=0;i<100;i++){
star_mc=_root.attachMovie("star_mc","star_mc"+i,_root.getNextHighestDepth())
star_mc._x=random(500)
star_mc._y=random(500)
}
star_mc.gotoAndPlay(Math.ceil(random(star_mc._totalframes))

Then I get syntax error

Where´s my lack of programmig skill in above?
• 6. Re: Blinking starfield out of one mc - the final question
it was mine. that should be:

1 person found this helpful
• 7. Re: Blinking starfield out of one mc - the final question
WOW - now it´s great!!
Just make a cool bitmap picture with glow.
Animate it with a guide layer above (on spiral curve or something like that)
Create a few keyframe where you changes color and size.
Create a link to that mc in you library.
After that, apply this code om the frst frame and it looks like GOD has done it.
But he was not - it was done here in this forum.
I really like that!!
Thanks a lot to both for helping me.out

Anyway here´s the working code:
for(var i:Number=0;i<100;i++){
star_mc=_root.attachMovie("star_mc","star_mc"+i,_root.getNextHighestDepth())
star_mc._x=random(500)
star_mc._y=random(500)
star_mc.gotoAndPlay(Math.ceil(random(star_mc._totalframes)));
}

Please, just one question:
- are you, KGLAD, working at Macromedia or something like that?
• 8. Re: Blinking starfield out of one mc - the final question
you're welcome, highlander.

and no i don't work for mm. i'm a pediatrician who used to be a mathematician. but i have been doing a fair amount of flash professionally in the last 6 months.
1 person found this helpful