It is too late for Flash Player 10 but there is one feature I would love to see in the next version of the Flash Player. In Flash Player 10, we have a brand new enhanced drawing API which definitely make things easier when you want to draw things with ActionScript. Unfortunately this feature is only working in one direction.
We are able to inject some new graphic data with the new Graphics.drawGraphicsData() method but we are not able to query the graphic data from an existing DisplayObject. If we had a method like Graphics.getGraphicsData(), we would be able to very easily extract at runtime data from vectors drawn in the IDE or programatically and do whatever we want with it.
I am thinking about three things especially :
- Inject graphics data in a PDF with some parsing (Flash Player Graphics Data to SVG for instance). Even if SVG specification does not contain all the drawing api Flash Player features, these would be some good first steps. This would be the dreaming feature for AlivePDF. What would be more than awesome would be an Adobe Reader FXG compatible but this is another topic.
- This way we could also store easily a DisplayObject anywehere (database, shared object, etc.).
- Developers would be able to manipulate any vectors drawn by designers on the timeline much more easily and interact with them.
Come on guys ! We raised our voice for FileReference, if you would be happy having such a feature, vote for it !
Comments (9)
Would be really cool if this would extract vector data from text characters!
I vote for this feature!
I often use “print as PDF” from Flash to get vector results of what I have displayed on the screen. Many vector information are available (many aren’t too, as effects, bitmapdata, etc…).
A way to have all those vector information at runtime would be great. Good idea to ask for Thibault, many thanks from the community.
Are you sure that the key feature of Graphics.drawGraphicsData() is not that vector are rendered immediately (to bitmap so) and that it cannot be accessed as vector anymore ?
This can be implemented elsewhere and differently anyway.
Hi Tek,
The idea behin Graphics.drawGraphicsData() is to simplify drawing operations. As soon as you pass a vector full of IGraphicsData objects you then have your Shape object created.
The key is that if you did not saved the data you used to create it, you will not be able to retrieve them. More than that, having such a feature would allow us to retrieve graphics data from existing Displayobject’s created in the IDE.
Thibault
Hi Thibault,
What do you mean really by Query Graphics Data ?
Are you thinking about FXG 1.0 graphic format like in Flex 4 ?
JP
Hi there
it might be optimized and may need a rebuild, but i’m currently working on some classes which allows people to play with curves, just as u said. Feel free to contact me if u wanna know more about
getGraphicsData() is certainly one of the things I’m really waiting since a long time. At the moment, it’s impossible to simply change the color of a shape or a stroke, with this method it could be possible.
But if it is added in Flash player 11, it’s really important that the shapes and stroke are considered as independants in the swf as in the IDE and not as a big an unique shape that we cannot use.
Certainly a very good idea. I wonted this feature since when i started using flash 2 years ago. I still often have problems to draw things with as3, would be nice to just click “copy drawing to as3″ or sth similar.
If nothing else, I would like to see some Cubic Bezier curve support. What’s two more parameters to the curveTo() method?
I second that… the lack of cubic bezier support is a huge thorn in the side of developers.