RE: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-06 Thread neo binedell
Well even if you did not have access to it you
could just calc the color intensity yourself
and use a color transform or if you were lazy
just create a tween (converted to keyframes) 
going from white to black and set an overlay 
color.

~neo

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Count
Schemula
Sent: 04 July 2006 09:22 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] 50 stars blinking... app gets too slow

Also, FWIW, I think I've heard that brightness is a lot less processor
intensive than alpha.

Assuming that we have access to the brightness property.

On 7/4/06, Marcelo de Moraes Serpa [EMAIL PROTECTED] wrote:
 Very good example Bernard. Thank you :)

 Marcelo.

 On 7/3/06, Weyert de Boer [EMAIL PROTECTED] wrote:
 
  Works well if you ask me.
  ___
  Flashcoders@chattyfig.figleaf.com
  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
 
 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-04 Thread Marcelo de Moraes Serpa

Very good example Bernard. Thank you :)

Marcelo.

On 7/3/06, Weyert de Boer [EMAIL PROTECTED] wrote:


Works well if you ask me.
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-04 Thread Count Schemula

Also, FWIW, I think I've heard that brightness is a lot less processor
intensive than alpha.

Assuming that we have access to the brightness property.

On 7/4/06, Marcelo de Moraes Serpa [EMAIL PROTECTED] wrote:

Very good example Bernard. Thank you :)

Marcelo.

On 7/3/06, Weyert de Boer [EMAIL PROTECTED] wrote:

 Works well if you ask me.
 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Marcelo de Moraes Serpa

It´s random. While some are fading in, others are fading out and so on. I
used Fuse to iterate through the stars created and attach the onEnterFrame
event on each of them.

How I would animate each of them at different times using only one
onEnterFrame event?

Maybe the best solution would be to build this animation on the stars
timeline in Flash IDE...

Thanks,

Marcelo.

On 7/3/06, Michael Bedar [EMAIL PROTECTED] wrote:


50 onEnterFrames running at the same time could definitely be the
problem.

Maybe you could consider making one onEnterFrame script that controls
all of your star animations.. do they all animate ALL the time, or
are only some on at any given time? If nothing else, make sure that
movieclips that are not actively doing something are not wasting cycles.


On Jul 3, 2006, at 1:38 PM, Marcelo de Moraes Serpa wrote:

 I´ve created 50 star movieclips with random sizes, rotation and
 scale. Till
 there, everything went fine, the sky´s got good looking, but the stars
 needed some life, so I thought in adding a fade-in / fade-out
 tween to
 each of them - and here comes the problem - I´ve attached a
 onEnterFrame
 event to each of them and have written a simple code that does the
 blinking.
 It works, but the app gets too slow. I don´t know if it´s becouse
 of the
 rendering engine that doesn´t manage to render 50 stars blinking or
 if it´s
 becouse of the 50 onEnterFrame events with code to do the fade-in/
 fade-out.
 Any ideas?

 Thanks in advance.
 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Scott Hyndman

It seems much more likely to me that it's alpha related. Remove the
alpha-related code and see if it still occurs.

Scott

On 03/07/06, Marcelo de Moraes Serpa [EMAIL PROTECTED] wrote:

It´s random. While some are fading in, others are fading out and so on. I
used Fuse to iterate through the stars created and attach the onEnterFrame
event on each of them.

How I would animate each of them at different times using only one
onEnterFrame event?

Maybe the best solution would be to build this animation on the stars
timeline in Flash IDE...

Thanks,

Marcelo.

On 7/3/06, Michael Bedar [EMAIL PROTECTED] wrote:

 50 onEnterFrames running at the same time could definitely be the
 problem.

 Maybe you could consider making one onEnterFrame script that controls
 all of your star animations.. do they all animate ALL the time, or
 are only some on at any given time? If nothing else, make sure that
 movieclips that are not actively doing something are not wasting cycles.


 On Jul 3, 2006, at 1:38 PM, Marcelo de Moraes Serpa wrote:

  I´ve created 50 star movieclips with random sizes, rotation and
  scale. Till
  there, everything went fine, the sky´s got good looking, but the stars
  needed some life, so I thought in adding a fade-in / fade-out
  tween to
  each of them - and here comes the problem - I´ve attached a
  onEnterFrame
  event to each of them and have written a simple code that does the
  blinking.
  It works, but the app gets too slow. I don´t know if it´s becouse
  of the
  rendering engine that doesn´t manage to render 50 stars blinking or
  if it´s
  becouse of the 50 onEnterFrame events with code to do the fade-in/
  fade-out.
  Any ideas?
 
  Thanks in advance.
  ___
  Flashcoders@chattyfig.figleaf.com
  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

 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Weyert de Boer

Marcelo de Moraes Serpa wrote:

It´s random. While some are fading in, others are fading out and so on. I
used Fuse to iterate through the stars created and attach the 
onEnterFrame

event on each of them.
Well, you could define variable in each star instance and give up a 
fadeSpeed whereby it's -5 or +5. This way the one will decresed or 
increased by two. Example:


test.alphaSpeed = +5;
test._alpha = 0;

test2.alphaSpeed = -5;
test2._alpha = 100;

this.onEnterFrame = function() {
   test._alpha = test._alpha + test.alphaSpeed;
   test2._alpha = test2._alpha +  test2.alphaSpeed;
}

Yours,
Weyert de Boer

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread ryanm
I´ve created 50 star movieclips with random sizes, rotation and scale. 
Till there, everything went fine, the sky´s got good looking, but the 
stars needed some life, so I thought in adding a fade-in / fade-out 
tween to each of them - and here comes the problem - I´ve attached a 
onEnterFrame event to each of them and have written a simple code that 
does the blinking..
It works, but the app gets too slow. I don´t know if it´s becouse of the 
rendering engine that doesn´t manage to render 50 stars blinking or if 
it´s becouse of the 50 onEnterFrame events with code to do the 
fade-in/fade-out.

Any ideas?



Bottom of the page...
http://www.horsefish.net/elementalfx/what.html

ryanm 


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Marcelo de Moraes Serpa

Thank you all for the replies! :)

@ryanm: I will take a look at this article tonight, seems very interesting.
@Weyert: I didn´t really understand your technique Weyert. Could you please
make it more clear!? How would I iterate through 50+ stars movieclips and
apply it?

Cheers,

Marcelo.

On 7/3/06, ryanm [EMAIL PROTECTED] wrote:


 I´ve created 50 star movieclips with random sizes, rotation and scale.
 Till there, everything went fine, the sky´s got good looking, but the
 stars needed some life, so I thought in adding a fade-in / fade-out
 tween to each of them - and here comes the problem - I´ve attached a
 onEnterFrame event to each of them and have written a simple code that
 does the blinking..
 It works, but the app gets too slow. I don´t know if it´s becouse of the
 rendering engine that doesn´t manage to render 50 stars blinking or if
 it´s becouse of the 50 onEnterFrame events with code to do the
 fade-in/fade-out.
 Any ideas?


Bottom of the page...
http://www.horsefish.net/elementalfx/what.html

ryanm

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Weyert de Boer
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++;
}
___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Marcelo de Moraes Serpa

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++;
}
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Marcelo de Moraes Serpa

Hmmm... looking better at this loop, I don´t think it would do the smooth
fade-in/fade-out I would like to achieve. I guess the best solution still is
animating this fade-in/fade-out using the flash IDE and then do a play() in
the script. I would have only to add a line of script in the last keyframe
of the star animation to make it loop.

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++;
 }
 ___
 Flashcoders@chattyfig.figleaf.com
 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




___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Weyert de Boer
Well, the negative will make your movieclip fadeout, and a positive one 
will fadein. But yes.



.



___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Adrian Park

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++;
 }
 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Marcelo de Moraes Serpa

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++;
  }
  ___
  Flashcoders@chattyfig.figleaf.com
  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
 
 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Bernard Visscher
Following Weyerts suggestion to update all stars in 1 onEnterFrame.. Here is
a little demo (150 stars): http://www.debit.nl/flashcoders/stars.html

This is the code, just place it in the first frame and make a MovieClip and
export it for AS with the name star

var starCount:Number = 150;
var stars:Array = new Array();
var alphaSpeed:Number = 5;

for(var a:Number = 0 ; astarCount ; a++){
var tmpStar:MovieClip =
this.attachMovie(star,star+a,this.getNextHighestDepth());
tmpStar._x = Math.random() * Stage.width;
tmpStar._y = Math.random() * Stage.height;
tmpStar.alphaSpeed = (Math.random()0.5?1:-1) * ((Math.random() *
alphaSpeed) + 1);
stars.push(tmpStar);
}

onEnterFrame = function(){
var i:Number = 0;
while(istarCount){
stars[i]._alpha += stars[i].alphaSpeed;
if(stars[i]._alpha = 0){
stars[i]._alpha = 0;
stars[i].alphaSpeed *= -1;
}
if(stars[i]._alpha = 100){
stars[i]._alpha = 100;
stars[i].alphaSpeed *= -1;
}
i++;
}
}

Greetz,

Bernard

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] Namens 
 Marcelo de Moraes Serpa
 Verzonden: maandag 3 juli 2006 21:11
 Aan: Flashcoders mailing list
 Onderwerp: Re: [Flashcoders] 50 stars blinking... app gets too slow
 
 Hmmm... looking better at this loop, I don´t think it would 
 do the smooth fade-in/fade-out I would like to achieve. I 
 guess the best solution still is animating this 
 fade-in/fade-out using the flash IDE and then do a play() in 
 the script. I would have only to add a line of script in the 
 last keyframe of the star animation to make it loop.
 
 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++;
   }
   ___
   Flashcoders@chattyfig.figleaf.com
   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
  
 
 
 ___
 Flashcoders@chattyfig.figleaf.com
 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
 

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] 50 stars blinking... app gets too slow

2006-07-03 Thread Weyert de Boer

Works well if you ask me.
___
Flashcoders@chattyfig.figleaf.com
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