Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a layer "fly" in a curve

Status
Not open for further replies.

paasonen

Programmer
Aug 14, 2000
1
FI
I've been working on this for a sometime now. The basic problem is that I have a picture of an arrow that should fly in a curve from a certain point (top: 150, left: 350) to the far left edge of the screen.<br><br>I've managed to get the 125x5-sized layer to fly straight from its starting point to the edge of screen but making it do the curve like a real object shot in the air seems to be a &quot;mission: impossible&quot; :)<br><br>Can anyone help? Ple-ee-ase? :)
 
What kind of curve are you trying to create? <p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br>
 
This is why you needed to learn calculus in school :eek:) (Straight algebra should do the trick in a pinch).<br><br>Treat the screen like a coordinate plane. That's not hard, you're already doing that- but put on your x/y coordinate plane math helmet and switch paradigms.<br><br>Any kind of path can be described by a function. Obviously, a linear function won't work for you- that's the straight line you already have. Play around a bit until you get something that you like. A graphing calculator would be the ideal tool; maybe 1/x^2 or ln (x) would suit your needs. If you don't have a graphing calculator, try drawing a picture, posting it to the web, and letting people on here try getting an equation.<br><br>Once you have an equation, it's easy. Basically, you're implementing the graphing calculator yourself by drawing out the graph with your arrow.<br><br>try something like this:<br>for (x=0, y=0; y&lt;150; x++, y = 1/x^2) {<br>&nbsp;&nbsp;// move layer to position (x, y)<br>}<br><br>that should actually end up being pretty easy. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Hi use dreamweaver and timelines then fix the timeline that u want the layer to fly the way u want it to

regards
 
instead of a for loop, use setInterval()...otherwise you will only see the end result jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top