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

Reply via email to