Now that I have read that file into flash I now need to parse it out so that I can break down that file and redraw it in flash. Do you by chance understand that text file?
Now that I have read that file into flash I now need to parse it out so that I can break down that file and redraw it in flash. Do you by chance understand that text file?
The text file looks like line coordinates if I’m not mistaken?
The reason I think that is because of the last line in that txt file.
(EndOfDWF)
This whole file is a CAD file with just x,y coordinates.
1st line is the file version.
2nd and 3rd line is the view or the stage size.(2 points that make a rectangle)
4th line is the background color.
5th line is the object colors.(3 stands for green)
6th line displays a square. P 5 tells you that their is 5 points and all the points are after that.
The next set of points start at p 37 which is a circle.
And the next set starts at p 4 which is a triangle.
I just dont know how I am suppose to break this down in flash so that flash will read the coordinates for me. I have already manually put in all the coordinates which will be in the master file that I have included.
Yes on the 1st question. I want flash to plot the coordinates for me. I think I need to create an array and parse the array but I am not very sure. Also ontop of just reading in the coordinates I need to be able to scale them down as will because they are so large. I think if I divide all the coordinates by 1000 that would be better also. So I also need to create a scale function to go along with the rest.
Last edited by dm2757; 08-23-2007 at 12:19 PM.
Reason: forgot something
Yes on the 1st question. I want flash to plot the coordinates for me. I think I need to create an array and parse the array but I am not very sure.
I see what your trying to do. This could be a very hairy script trying to get this. The only way I can thing about do this would be make each line its own var. such as:
and then send that into flash but if you have somthing more elabrate than this it could get very hairy and time consuming fast. I'm sure there is a better way of doing this I just can't think of one at the moment. I'll think about it and get back with you.
Yeah I know this is not going to be an easy process. The 1st thought you had, I had already pretty much done in the master file that I had sent you. Since I have already read the text file into flash so now it is in fla. format it will make it easier to read the coordinates but that still doesnt mean it is easy. I have never had to do anything like this before. So honestly I dont even know whre to start. I will continue to try to figure out how to write this script at the same time as you try. I really appreciate this.
Have you figured anything out yet? I have kinda been working on it and throwing a few things together and flash is trying to pick apart the data but not really. the files I am including are the txt file, the text fla file and the square fla file is the one I am working on to parse the data.
This is what I came up with. I figured out that in order for this to work I have got to break up the text file into individual elements. I need to create an array and parse out each individual element. Does that sound about right to you?
Errr...I didn't read this whole thread, only this last page, but is your goal to make a text file, then Flash uses that file to draw lines in Flash? Well, I think that you should use XML. You'd have a bit of learning to do, though actually, I'm not gonna say "There's some really good tutorials on Flashkit!". Well, for each time I asked to learn XML, someone said that, which made me mad since I hate sifting through those thousands of tutorials.
Just E-mail me, and then when I get back I'll make an example and e-mail you it back.
I have this file that has 3 shapes in it and they are separated by the P's and # next to it. I cant just create an array script in flash to read this file so I need to rewrite it. I guess what the question is how would you create this file in a list style format that flash can read? The file is nothing but x,y coordinates. I need to create and array that will be able to be drawn in flash.
Last edited by dm2757; 08-24-2007 at 05:36 PM.
Reason: more detail
Notice that this example is very simple and is for very simple situations.
If you need a more control over what you're loading, and the data itself, you should consider using XML.
XML, unlike a text file, can be very descriptive and can offer a strong structure for the data.
@dm2757:
you are officially now on my ignore list,- this is propably your 7th or 8th new post post regarding the same matter - each post comes only with a little text and without any direction
People like you are wasting valueable resources here
Can you take a look at this text file, I rewrote in a different format that was easire for me. How do I use script to display the shapes in this file in Flash 8? I appreciate any help that I can get.