Hi Adrian! Thanks a lot for sharing your valuable experiences ;)
Marcelo.
On 7/3/06, Adrian Park <[EMAIL PROTECTED]> wrote:
A method I've often used to get around this kind of processor hogging is
to
set it up that only, say, 10 stars are animating at any one time (i.e.
only
10 have onEnterFrame handlers set or even better, following Weyert's
suggestion, update only 10 at a time using a single onEnterFrame handler).
As with Weyert's suggestion, the speeds that each star animates is random
and, as each star finishes it's cycle, you randomly select another star to
animate through one 'twinkle' cycle. I find this approach gives a really
natural feel to the effect as well.
I'd also echo Scott's observation that it could well be the _alpha
blending.
Flash gets tired really quickly when you give it alpha calculations and,
the
bigger the area of the screen it is making alpha calculations on, the
quicker it gets tired!
Adrian P
On 7/3/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote:
>
> Ok Weyert...:) now I think I´ve got the point - each star would have a
> different speed, so, they would blink at different time rates, right?
And
> with only one loop to achieve this, I would prevent myself of attaching
an
> onEnterFrame to each of the stars...
>
> Marcelo.
>
> On 7/3/06, Weyert de Boer <[EMAIL PROTECTED]> wrote:
> >
> > Well, what you do is you add +5 or -5 to the current _alpha value.
> > Meaning you will increase or decrease the current alpha value by 5.
It's
> > like writing instance._alpha = instance._alpha - 5 (or + 5). Of
course,
> > you can use some sort of loop to update all movieclips/stars i.e:
> >
> > var starsCount = 50;
> > var i =0;
> > while ( i < starsCount ) {
> > var currentStar = _root[ "star" + i ]._alpha ;
> > currentStar._alpha = currenStar._alpha + currentStar.alphaSpeed;
> > i++;
> > }
> > _______________________________________________
> > [email protected]
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com