Re: [Flashcoders] Animating sprite.graphics.lineTo

2008-02-01 Thread Kenneth Kawamoto

I already suggested that. The function would be:

private var v:Object;
private var a:Number;
private var b:Number;
  
private function initLine(x1:Number, y1:Number, x2:Number, y2:Number):void {
  
  a = (y2 - y1) / (x2 - x1);

  b = y1 - a * x1;
  
  v = {x:x1};
  
  this.graphics.lineStyle(1);

  this.graphics.moveTo(x1, x1);
  
  TweenLite.to(v, 3, {x:x2, onUpdate:drawLine});

}
  
private function drawLine():void {

  this.graphics.lineTo(v.x, a * v.x + b);
}

Kenneth Kawamoto
http://www.materiaprima.co.uk/


Leandro Ferreira wrote:

You could do it sending and object to TweenLite and monitoring its variables
to create lines from A to B.


   Leandro Ferreira


On 1/29/08, Merrill, Jason <[EMAIL PROTECTED]> wrote:
  

Tried on another Flash  list without any luck, so I'll try here.

I'm trying to see if there is a way to combine TweenLite and the draw
functions (i.e. sprite.graphics.lineto) to slowly draw a line from point
A to point B. Maybe there isn't, but I thought I would ask.

Is it possible or would it have to be accomplished instead by drawing
slowly from point A to a point approaching B, then clearing, drawing
further, then clearning, etc. until the endpoint is reached? I'd like
to avoid that because it's 1) kludgy, 2) processor intensive, 3) time
consuming to code, 4) does not use easing (easily anyway), and 5) would
not look smooth. Any thoughts?

Oh, and any method suggested has to be done dynamically with the draw
API, not a timeline solution, since this is in regards to rendering a
dynamic graphic.  Thanks.


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


Re: [Flashcoders] Animating sprite.graphics.lineTo

2008-02-01 Thread Glen Pike

Not sure about TweenLite, but there is some useful stuff here:

http://www.reflektions.com/miniml/template_permalink.asp?id=254

and here:

http://labs.zeh.com.br/blog/?p=104

Leandro Ferreira wrote:

You could do it sending and object to TweenLite and monitoring its variables
to create lines from A to B.


   Leandro Ferreira


On 1/29/08, Merrill, Jason <[EMAIL PROTECTED]> wrote:
  

Tried on another Flash  list without any luck, so I'll try here.

I'm trying to see if there is a way to combine TweenLite and the draw
functions (i.e. sprite.graphics.lineto) to slowly draw a line from point
A to point B. Maybe there isn't, but I thought I would ask.

Is it possible or would it have to be accomplished instead by drawing
slowly from point A to a point approaching B, then clearing, drawing
further, then clearning, etc. until the endpoint is reached? I'd like
to avoid that because it's 1) kludgy, 2) processor intensive, 3) time
consuming to code, 4) does not use easing (easily anyway), and 5) would
not look smooth. Any thoughts?

Oh, and any method suggested has to be done dynamically with the draw
API, not a timeline solution, since this is in regards to rendering a
dynamic graphic.  Thanks.



Jason Merrill
Bank of America
GT&O L&LD Solutions Design & Development
eTools & Multimedia

Bank of America Flash Platform Developer Community


___
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


  


--

Glen Pike
01736 759321
www.glenpike.co.uk 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Animating sprite.graphics.lineTo

2008-02-01 Thread Leandro Ferreira
You could do it sending and object to TweenLite and monitoring its variables
to create lines from A to B.


   Leandro Ferreira


On 1/29/08, Merrill, Jason <[EMAIL PROTECTED]> wrote:
>
>
> Tried on another Flash  list without any luck, so I'll try here.
>
> I'm trying to see if there is a way to combine TweenLite and the draw
> functions (i.e. sprite.graphics.lineto) to slowly draw a line from point
> A to point B. Maybe there isn't, but I thought I would ask.
>
> Is it possible or would it have to be accomplished instead by drawing
> slowly from point A to a point approaching B, then clearing, drawing
> further, then clearning, etc. until the endpoint is reached? I'd like
> to avoid that because it's 1) kludgy, 2) processor intensive, 3) time
> consuming to code, 4) does not use easing (easily anyway), and 5) would
> not look smooth. Any thoughts?
>
> Oh, and any method suggested has to be done dynamically with the draw
> API, not a timeline solution, since this is in regards to rendering a
> dynamic graphic.  Thanks.
>
>
>
> Jason Merrill
> Bank of America
> GT&O L&LD Solutions Design & Development
> eTools & Multimedia
>
> Bank of America Flash Platform Developer Community
>
>
> ___
> 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] Animating sprite.graphics.lineTo

2008-01-30 Thread Merrill, Jason
Thanks Michael, Thanks Kenneth, good ideas.

Jason Merrill
Bank of America  
GT&O L&LD Solutions Design & Development 
eTools & Multimedia 

Bank of America Flash Platform Developer Community



 

>>-Original Message-
>>From: [EMAIL PROTECTED] 
>>[mailto:[EMAIL PROTECTED] On Behalf 
>>Of Mendelsohn, Michael
>>Sent: Wednesday, January 30, 2008 8:49 AM
>>To: Flash Coders List
>>Subject: RE: [Flashcoders] Animating sprite.graphics.lineTo
>>
>>Jason,
>>
>>I recently put together a bar chart, rendered entirely by 
>>code in AS2, where the points must be connected by a line.  I 
>>draw the entire line (which might look like a profile of the 
>>Rocky Mountains) in one mc, and set a mask over it in another 
>>mc.  I use the tween class on the _width property of the mask 
>>mc, and tween it from a width of 0% to 100%.  It worked out 
>>great.  With the tween class, I could control the duration of 
>>the time it took to draw out the line.  The key is that the 
>>complete line is plotted out only once.  Email me offlist if 
>>you want to see it.
>>
>>Michael Mendelsohn at fmglobal period com
>>
>>- Michael M.
>>
>>
>>___
>>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] Animating sprite.graphics.lineTo

2008-01-30 Thread Mendelsohn, Michael
Jason,

I recently put together a bar chart, rendered entirely by code in AS2,
where the points must be connected by a line.  I draw the entire line
(which might look like a profile of the Rocky Mountains) in one mc, and
set a mask over it in another mc.  I use the tween class on the _width
property of the mask mc, and tween it from a width of 0% to 100%.  It
worked out great.  With the tween class, I could control the duration of
the time it took to draw out the line.  The key is that the complete
line is plotted out only once.  Email me offlist if you want to see it.

Michael Mendelsohn at fmglobal period com

- Michael M.


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


[Flashcoders] Animating sprite.graphics.lineTo

2008-01-30 Thread Kenneth Kawamoto

Any straight line can be described as this simple equation: y = ax + b

If you have the starting point (x1, y1) and the end point (x2, y2), it's 
easy to work out two constants a and b.


The beauty of TweenLite is you can tween any property of any object 
(thanks Jack!). In this case you will create an Object (let's call it 
"v") with a property "x", which you tween from x1 to x2.


Then onUpdate, you just do lineTo(v.x, a * v.x + b). Simple.

Sorry if this is already answered (I'm on digest).

Kenneth Kawamoto
http://www.materiaprima.co.uk/


Tried on another Flash  list without any luck, so I'll try here.

I'm trying to see if there is a way to combine TweenLite and the draw
functions (i.e. sprite.graphics.lineto) to slowly draw a line from point
A to point B. Maybe there isn't, but I thought I would ask.  


Is it possible or would it have to be accomplished instead by drawing
slowly from point A to a point approaching B, then clearing, drawing
further, then clearning, etc. until the endpoint is reached? I'd like
to avoid that because it's 1) kludgy, 2) processor intensive, 3) time
consuming to code, 4) does not use easing (easily anyway), and 5) would
not look smooth. Any thoughts?

Oh, and any method suggested has to be done dynamically with the draw
API, not a timeline solution, since this is in regards to rendering a
dynamic graphic.  Thanks.



Jason Merrill
Bank of America  
GT&O L&LD Solutions Design & Development 
eTools & Multimedia 


Bank of America Flash Platform Developer Community

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


[Flashcoders] Animating sprite.graphics.lineTo

2008-01-29 Thread Merrill, Jason

Tried on another Flash  list without any luck, so I'll try here.

I'm trying to see if there is a way to combine TweenLite and the draw
functions (i.e. sprite.graphics.lineto) to slowly draw a line from point
A to point B. Maybe there isn't, but I thought I would ask.  

Is it possible or would it have to be accomplished instead by drawing
slowly from point A to a point approaching B, then clearing, drawing
further, then clearning, etc. until the endpoint is reached? I'd like
to avoid that because it's 1) kludgy, 2) processor intensive, 3) time
consuming to code, 4) does not use easing (easily anyway), and 5) would
not look smooth. Any thoughts?

Oh, and any method suggested has to be done dynamically with the draw
API, not a timeline solution, since this is in regards to rendering a
dynamic graphic.  Thanks.



Jason Merrill
Bank of America  
GT&O L&LD Solutions Design & Development 
eTools & Multimedia 

Bank of America Flash Platform Developer Community


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