Is it possible to draw a path in flash, and access the points from AS?
For example if I have a map and I add hidden paths along various roads, I then later want to animate traffic or growing lines along these predefined paths from code.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have never tried it, but technically it should be possible using a library like as3swf, which is a SWF parser written in actionscript.
You would have to parse the SWF containing the path using the parser library and then extract the needed coordinates from the output.
That procedure seems horribly backwards to me though. A simpler, more feasible approach would be to draw your paths in Flash, select them and export them using:
File > Export > Export Selection..., then export asAdobe FXG. This will export your Paths as FXG XML file.You can then parse the FXG file in flash and extract the path coordinates that are interesting for you. Shouldn’t be that hard to implement. Also have a look at the Path class docs, as it contains some information about how coordinates are stored and should be interpreted.