Re: [Flashcoders] making a repeating effect

2010-02-08 Thread Gustavo Duenas

Thanks guys, I'm working on all the hearts beating at time.

Gus
On Feb 5, 2010, at 11:31 AM, .matt wrote:


I stand corrected. Carry on. ;)

.matt

On Feb 5, 2010, at 11:00 AM, "Keith Reinfeld" > wrote:



heart.name = "heart"+timer.currentCount;

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of  
Matt S.

Sent: Friday, February 05, 2010 9:53 AM
To: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect

Unless you need to assign a name or ID number to the heart, eg:

heart.name = "heart"+myCounter;

or

new Heart(myCounter);

(in which myCounter then gets saved within "heart" as idNum or  
whatever).


I guess it depends on whether the hearts just sit quietly once added
or will need to perform their own functions or be accessed at a later
time.

.m

On Thu, Feb 4, 2010 at 9:59 PM, Muzak   
wrote:
no need for the counter in the event handler, Timer has a "repeat  
count"

//Timer(delay, repeatCount)
var timer:Timer = new Timer(5000, 1000);

-

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2668 - Release Date:  
02/05/10

01:35:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-05 Thread .matt

I stand corrected. Carry on. ;)

.matt

On Feb 5, 2010, at 11:00 AM, "Keith Reinfeld"  
 wrote:



heart.name = "heart"+timer.currentCount;

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt  
S.

Sent: Friday, February 05, 2010 9:53 AM
To: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect

Unless you need to assign a name or ID number to the heart, eg:

heart.name = "heart"+myCounter;

or

new Heart(myCounter);

(in which myCounter then gets saved within "heart" as idNum or  
whatever).


I guess it depends on whether the hearts just sit quietly once added
or will need to perform their own functions or be accessed at a later
time.

.m

On Thu, Feb 4, 2010 at 9:59 PM, Muzak  wrote:
no need for the counter in the event handler, Timer has a "repeat  
count"

//Timer(delay, repeatCount)
var timer:Timer = new Timer(5000, 1000);

-

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2668 - Release Date:  
02/05/10

01:35:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] making a repeating effect

2010-02-05 Thread Keith Reinfeld
heart.name = "heart"+timer.currentCount;

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt S.
Sent: Friday, February 05, 2010 9:53 AM
To: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect

Unless you need to assign a name or ID number to the heart, eg:

heart.name = "heart"+myCounter;

or

new Heart(myCounter);

(in which myCounter then gets saved within "heart" as idNum or whatever).

I guess it depends on whether the hearts just sit quietly once added
or will need to perform their own functions or be accessed at a later
time.

.m

On Thu, Feb 4, 2010 at 9:59 PM, Muzak  wrote:
> no need for the counter in the event handler, Timer has a "repeat count"
> //Timer(delay, repeatCount)
> var timer:Timer = new Timer(5000, 1000);
>
> -
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2668 - Release Date: 02/05/10
01:35:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-05 Thread Matt S.
Unless you need to assign a name or ID number to the heart, eg:

heart.name = "heart"+myCounter;

or

new Heart(myCounter);

(in which myCounter then gets saved within "heart" as idNum or whatever).

I guess it depends on whether the hearts just sit quietly once added
or will need to perform their own functions or be accessed at a later
time.

.m

On Thu, Feb 4, 2010 at 9:59 PM, Muzak  wrote:
> no need for the counter in the event handler, Timer has a "repeat count"
> //Timer(delay, repeatCount)
> var timer:Timer = new Timer(5000, 1000);
>
> -
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] making a repeating effect

2010-02-05 Thread Keith Reinfeld
Better still: 

import flash.utils.Timer; 
import flash.events.TimerEvent; 
 
var timer:Timer = new Timer(1000, 10); 
timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true); 
timer.start(); 
 
function onTimer(e:TimerEvent):void { 
// do stuff 
if(e.currentTarget.currentCount == e.currentTarget.repeatCount){ 
e.currentTarget.removeEventListener(TimerEvent.TIMER,
onTimer); 
} 
} 
 
Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Muzak
no need for the counter in the event handler, Timer has a "repeat count" 


//Timer(delay, repeatCount)
var timer:Timer = new Timer(5000, 1000);

- Original Message - 
From: "Nathan Mynarcik" 

To: "Flash Coders List" 
Sent: Thursday, February 04, 2010 10:37 PM
Subject: Re: [Flashcoders] making a repeating effect



You can try this:

timer.addEventListener("timer",timedFunction);

var counter:int;

timer.start();

function timedFuntion(e:TimerEvent):void{
 if(counter <= 1000){
var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;
counter++;
}else{
timer.stop();
}
}
--Original Message--
From: Gustavo Duenas
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect
Sent: Feb 4, 2010 3:14 PM

I've downloaded thanks
on other matters, when you say using a timer, you mean something like  
this ( I've have this from a tutorial, mixing with my idea);


something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
 var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:


Completely un-helpful for your code, but you could also give HYPE a
whirl. Have been having a blast playing with it lately. I think the
above task is one of the examples.



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Gustavo Duenas
I did it, and you know it works, I put an event listener for the  
timer.stop the code is like this:


stop();
import flash.utils.*;
import flash.display.*;



var timer:Timer = new Timer(100, 100);

timer.addEventListener("timer",timedFunction);
var newX:Number = stage.stageWidth;
var newY:Number = stage.stageHeight;

timer.start();
timer.addEventListener(TimerEvent.TIMER_COMPLETE, timerStop);
function timedFunction(e:TimerEvent):void{
var heart:MovieClip = new Heart();
heart.x = Math.random() * (stage.stageWidth);
heart.y = Math.random()* (stage.stageHeight);
heart.width=heart.width * Math.random();
heart.height=heart.height  * Math.random();
addChild(heart);

}
function timerStop(e:TimerEvent):void{
timer.stop();
}

now I'm gonna look in google how to make the size of the heart more  
consistent...


now I'm going to be off-the air, going to church.

Cya friends


Gus


On Feb 4, 2010, at 5:40 PM, Jim Lafser wrote:

Add second param when instantiate Timer which indicates how many  
times it should repeat. If don't specify, then defaults to 0 which  
means run forever.

Add an event listener for the Timer.timerComplete event.
I think the listener you've already got should be registering for  
the Timer.timer event instead of "timer".



--- On Thu, 2/4/10, Gustavo Duenas  
 wrote:



From: Gustavo Duenas 
Subject: Re: [Flashcoders] making a repeating effect
To: "Flash Coders List" 
Date: Thursday, February 4, 2010, 4:14 PM


I've downloaded thanks
on other matters, when you say using a timer, you mean something  
like this ( I've have this from a tutorial, mixing with my idea);


something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:


Completely un-helpful for your code, but you could also give HYPE a
whirl. Have been having a blast playing with it lately. I think the
above task is one of the examples.

http://hype.joshuadavis.com/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Jim Lafser
Add second param when instantiate Timer which indicates how many times it 
should repeat. If don't specify, then defaults to 0 which means run forever.
Add an event listener for the Timer.timerComplete event.
I think the listener you've already got should be registering for 
the Timer.timer event instead of "timer".


--- On Thu, 2/4/10, Gustavo Duenas  wrote:


From: Gustavo Duenas 
Subject: Re: [Flashcoders] making a repeating effect
To: "Flash Coders List" 
Date: Thursday, February 4, 2010, 4:14 PM


I've downloaded thanks
on other matters, when you say using a timer, you mean something like this ( 
I've have this from a tutorial, mixing with my idea);

something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:

> Completely un-helpful for your code, but you could also give HYPE a
> whirl. Have been having a blast playing with it lately. I think the
> above task is one of the examples.
> 
> http://hype.joshuadavis.com/
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] making a repeating effect

2010-02-04 Thread Merrill, Jason
>> The second param limits the number of times it can fire.

True, both methods will work. However, if you use the second repeatCount
parameter, then you won't know when it's finished so you can remove your
listener unless you also add a listener to listen for the timerComplete
event as well - so you'd have two listeners running instead of one and
have to remove both of those listeners.  Doesn't matter either way IMO,
just be sure you remove the listeners when it's finished if you don't
need it anymore.  


Jason Merrill 

Bank of  America  Global Learning 
Learning & Performance Soluions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Keith
Reinfeld
Sent: Thursday, February 04, 2010 4:42 PM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] making a repeating effect


var timer:Timer = new Timer(5000, 1000);

The second param limits the number of times it can fire.

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
Duenas
Sent: Thursday, February 04, 2010 3:14 PM
To: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect

I've downloaded thanks
on other matters, when you say using a timer, you mean something like  
this ( I've have this from a tutorial, mixing with my idea);

something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
  var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:

> Completely un-helpful for your code, but you could also give HYPE a
> whirl. Have been having a blast playing with it lately. I think the
> above task is one of the examples.
>
> http://hype.joshuadavis.com/
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2665 - Release Date: 02/04/10
01:35:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] making a repeating effect

2010-02-04 Thread David Hunter

http://pastebin.com/m2b549c17
of course i guess you could put the code inside the makeHeart() function 
straight in the myTimerTrigger() function.
you could write it without the second argument in new Timer() and just restart 
the timer every time it completes and use a variable to increment and check if 
it has reached the desired count. this situation might be better if you need to 
change "on the fly" how many it will make once the timer has started. i'm not 
that up on timers, i tend not to use them much.
hope that solves it for you.
david

> From: gdue...@leftandrightsolutions.com
> To: flashcoders@chattyfig.figleaf.com
> Subject: Re: [Flashcoders] making a repeating effect
> Date: Thu, 4 Feb 2010 16:14:02 -0500
> 
> I've downloaded thanks
> on other matters, when you say using a timer, you mean something like  
> this ( I've have this from a tutorial, mixing with my idea);
> 
> something like this?
> 
> import flash.utils.*;
> 
> var timer:Timer = new Timer(5000);
> 
> timer.addEventListener("timer",TimedFunction);
> 
> 
> timer.start();
> 
> function timedFuntion(e:TimerEvent):void{
>   var heart:MovieClip = new Heart();
> heart.x = Math.random * stage.stageWidth;
> heart.y = Math.random * stage.stageHeight;
> 
> }
> 
> the question is , how can I stop this?
> 
> Gus
> On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:
> 
> > Completely un-helpful for your code, but you could also give HYPE a
> > whirl. Have been having a blast playing with it lately. I think the
> > above task is one of the examples.
> >
> > http://hype.joshuadavis.com/
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> 
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
_
Send us your Hotmail stories and be featured in our newsletter
http://clk.atdmt.com/UKM/go/195013117/direct/01/___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Gustavo Duenas
ok, now can repeat them until the end of the times...how can I make  
them to stop at certain number like 200 for example


gus


On Feb 4, 2010, at 4:14 PM, Gustavo Duenas wrote:


I've downloaded thanks
on other matters, when you say using a timer, you mean something  
like this ( I've have this from a tutorial, mixing with my idea);


something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:


Completely un-helpful for your code, but you could also give HYPE a
whirl. Have been having a blast playing with it lately. I think the
above task is one of the examples.

http://hype.joshuadavis.com/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] making a repeating effect

2010-02-04 Thread Keith Reinfeld

var timer:Timer = new Timer(5000, 1000);

The second param limits the number of times it can fire.

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
Duenas
Sent: Thursday, February 04, 2010 3:14 PM
To: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect

I've downloaded thanks
on other matters, when you say using a timer, you mean something like  
this ( I've have this from a tutorial, mixing with my idea);

something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
  var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:

> Completely un-helpful for your code, but you could also give HYPE a
> whirl. Have been having a blast playing with it lately. I think the
> above task is one of the examples.
>
> http://hype.joshuadavis.com/
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2665 - Release Date: 02/04/10
01:35:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Nathan Mynarcik
You can try this:

timer.addEventListener("timer",timedFunction);

var counter:int;

timer.start();

function timedFuntion(e:TimerEvent):void{
  if(counter <= 1000){
var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;
counter++;
}else{
timer.stop();
}
}
--Original Message--
From: Gustavo Duenas
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect
Sent: Feb 4, 2010 3:14 PM

I've downloaded thanks
on other matters, when you say using a timer, you mean something like  
this ( I've have this from a tutorial, mixing with my idea);

something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
  var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:

> Completely un-helpful for your code, but you could also give HYPE a
> whirl. Have been having a blast playing with it lately. I think the
> above task is one of the examples.
>
> http://hype.joshuadavis.com/
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] making a repeating effect

2010-02-04 Thread Merrill, Jason
>>the question is , how can I stop this?

Just keep a variable that keeps count.  Increment the "countHearts" or
whatever you call it variable every time the timer function runs.  When
you reach 1000, stop the timer, remove the timer listener, set it to
null and you're done.

Jason Merrill 

Bank of  America  Global Learning 
Learning & Performance Soluions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
Duenas
Sent: Thursday, February 04, 2010 4:14 PM
To: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect

I've downloaded thanks
on other matters, when you say using a timer, you mean something like  
this ( I've have this from a tutorial, mixing with my idea);

something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
  var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:

> Completely un-helpful for your code, but you could also give HYPE a
> whirl. Have been having a blast playing with it lately. I think the
> above task is one of the examples.
>
> http://hype.joshuadavis.com/
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Jim Lafser
If you want to see the hearts to appear one at a time you need to add them at a 
rate slower than your frame rate (give the stage a chance to update). Might 
want to use setInterval to add the hearts.
 
hth

--- On Thu, 2/4/10, Nathan Mynarcik  wrote:


From: Nathan Mynarcik 
Subject: Re: [Flashcoders] making a repeating effect
To: "Flash Coders List" 
Date: Thursday, February 4, 2010, 3:16 PM


Add each heart to the stage with alpha at 0. Then use a tween engine to fade 
the heart in with a delay. Use your "i" variable as the delay in seconds. 


--Original Message--
From: Gustavo Duenas
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] making a repeating effect
Sent: Feb 4, 2010 2:00 PM

Hi Guys, I'm trying to accomplish this:
so far I a mac named heart which is hence a heart, so I'm trying to  
make a repetition of it along the screen until it reach the number of  
1000
or less, but so far I don't have the effect of its repeating one to  
one, instead I have all of them at the same time, there is a way to do  
this, maybe I'm losing something if anyone of you knows a site where  
that effects is explained for not left brainers as me, let me know.

Gus.

here is my code

stop()

import flash.display.*;



for(var i:Number=0; i<5000; i++){

var heart:MovieClip = new Heart();

heart.width= Math.random()*i *2;
heart.height=Math.random()*i * 2;
heart.x=Math.random()*i *2;
heart.y=Math.random()*i *2;
addChild(heart);
trace(heart);
}

//true is I have a lot of hearts on the screen but I would like those  
to start appearing one to one.



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Gustavo Duenas

I've downloaded thanks
on other matters, when you say using a timer, you mean something like  
this ( I've have this from a tutorial, mixing with my idea);


something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
 var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:


Completely un-helpful for your code, but you could also give HYPE a
whirl. Have been having a blast playing with it lately. I think the
above task is one of the examples.

http://hype.joshuadavis.com/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Jer Brand
Completely un-helpful for your code, but you could also give HYPE a
whirl. Have been having a blast playing with it lately. I think the
above task is one of the examples.

http://hype.joshuadavis.com/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] making a repeating effect

2010-02-04 Thread Nathan Mynarcik
Add each heart to the stage with alpha at 0. Then use a tween engine to fade 
the heart in with a delay. Use your "i" variable as the delay in seconds. 


--Original Message--
From: Gustavo Duenas
Sender: flashcoders-boun...@chattyfig.figleaf.com
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] making a repeating effect
Sent: Feb 4, 2010 2:00 PM

Hi Guys, I'm trying to accomplish this:
so far I a mac named heart which is hence a heart, so I'm trying to  
make a repetition of it along the screen until it reach the number of  
1000
or less, but so far I don't have the effect of its repeating one to  
one, instead I have all of them at the same time, there is a way to do  
this, maybe I'm losing something if anyone of you knows a site where  
that effects is explained for not left brainers as me, let me know.

Gus.

here is my code

stop()

import flash.display.*;



for(var i:Number=0; i<5000; i++){

var heart:MovieClip = new Heart();

heart.width= Math.random()*i *2;
heart.height=Math.random()*i * 2;
heart.x=Math.random()*i *2;
heart.y=Math.random()*i *2;
addChild(heart);
trace(heart);
}

//true is I have a lot of hearts on the screen but I would like those  
to start appearing one to one.



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] making a repeating effect

2010-02-04 Thread David Hunter

use a Timer() so everytime it elapses it triggers a function to generate a 
single heart and add it to the display list in a random place and size. 
increment a counter variable every time the function runs and when it gets to 
1000 then get it to cancel your timer.
hope that helps.
david

> From: gdue...@leftandrightsolutions.com
> To: flashcoders@chattyfig.figleaf.com
> Date: Thu, 4 Feb 2010 15:00:26 -0500
> Subject: [Flashcoders] making a repeating effect
> 
> Hi Guys, I'm trying to accomplish this:
> so far I a mac named heart which is hence a heart, so I'm trying to  
> make a repetition of it along the screen until it reach the number of  
> 1000
> or less, but so far I don't have the effect of its repeating one to  
> one, instead I have all of them at the same time, there is a way to do  
> this, maybe I'm losing something if anyone of you knows a site where  
> that effects is explained for not left brainers as me, let me know.
> 
> Gus.
> 
> here is my code
> 
> stop()
> 
> import flash.display.*;
> 
> 
> 
> for(var i:Number=0; i<5000; i++){
> 
> var heart:MovieClip = new Heart();
> 
> heart.width= Math.random()*i *2;
> heart.height=Math.random()*i * 2;
> heart.x=Math.random()*i *2;
> heart.y=Math.random()*i *2;
> addChild(heart);
> trace(heart);
> }
> 
> //true is I have a lot of hearts on the screen but I would like those  
> to start appearing one to one.
> 
> 
> 
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
_
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders