Groups | Blog | Home
all groups > flash actionscript > march 2005 >

flash actionscript : Flash lineTo limit - is Flash's world round?


geo_fry
3/21/2005 12:00:00 AM
I don't know anything about the shape of the stage, but if you can't figure
anything else out, you could try to break the line into peices that are
shorter. For example, find the angle of your line (change in y over change in
x) and call it theta or something. Then take the length of your line-to-be
(distance formula - finally a practical application for highschool alegbra ;-p)
and make a loop that goes while (length > 7000). The loop draws the line to
7000*cos(theta), 7000*sin(theta). After the loop simply draw a line to
length*cos(theta), length*sin(theta). Of course if there's a way to make the
stage flat that might be much faster and easier. But, let's be honest, which is
more fun?

Best of luck
David Stiller
3/21/2005 4:59:34 PM
Diltron3000,

Flat or round, 8,000 pixels is an awful lot to ask of Flash. I
understand, for example, that it can only load JPGs of 2,880 pixels or less.
It wouldn't surprise me if the Drawing API only goes a little farther.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Diltron3000
3/21/2005 9:31:47 PM
I have been developing an app for the governement for the past two years. I
can not post any code but I think my question can be answered without it.

The app draws family trees pretty much. I have connection lines which link
the children and parent "nodes". 95% of the time it works fine. However; if a
child is a great distance from the parent (about 8000 pixels) then the line is
not drawn properly. It seems like the line tries to go the oppossite direction
as if trying to reach the co-ordinate by wrapping arouhnd the other direction.
The line will appear and disappear and also streak on the stage.

Is Flash's stage flat, or is it a globe? I appear to have reached a limit and
I have no other options at this point.

Can anyone help me figure out why flash get confused when I try to do a lineTo
over 8000 pixels?

Thanks

Dilly
Rothrock
3/21/2005 11:33:27 PM
There are a lot of supposed limits in Flash that coincide with the number
16,000. So I'm guessing that 8000 being half of that means you could go that
far in either direction ? giving a total of 16,000 pixels. I like geo_fry's
solution ? sweet!
Diltron3000
3/22/2005 3:29:17 PM
Well, the lines I am drawing are straight so I won't be converting the
cartesian co-ordinates to polar. I hope that flash can do much more than I am
throwing at it now. I plan to draw trees with over 3000 "nodes" from a
database. Right now I run into problems with loading around 1800 datums. I
have been using a string but will work on using XML or SOAP. Which is better?

I have to present this project in 1 month and need to solve the line issue
before then. I have broken the line into intervals with a loop but it never
completes the line if I use the end point as the final destination. I dont
know how else to draw a line to a point without stating the location of that
point. Any ideas?

Oh, thanks for all the help guys.
steamboy
3/22/2005 3:42:00 PM
Do you have to draw the entire image at once? Could you break it into smaller
squares and maybe only draw those you can see, or those immediately around
them? It may even speed things up a little. Owen
Diltron3000
3/22/2005 4:48:49 PM
It is a joint project with the Univ of Oklahoma. They will be working on
loading and breaking the trees into groups. However, given that those types of
modification are up to them and the fact that I have alot to do before I demo
the app in April, I need a quick fix. I can moveTo the parent node and lineTo
a mid-point and attach and arrow symbolizing that it goes on for a while.
However; when I do this there is still some streaking of a non-existant line
when moving the child node around the stage (the stage acts like a view window
and the entire tree is moved around the stage).

Has anyone ever had a problem with ghost lines?


AddThis Social Bookmark Button