Feature request for Flash Player 11 – Query Graphics Data

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 !

Update: This feature has shipped in Flash Player 11.6/AIR 3.6 - See here.

Comments (9)

  1. sakri wrote:

    Would be really cool if this would extract vector data from text characters!

    Thursday, August 28, 2008 at 1:32 pm #
  2. Tek wrote:

    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.

    Thursday, August 28, 2008 at 2:23 pm #
  3. Thibault Imbert wrote:

    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.


    Thursday, August 28, 2008 at 4:46 pm #
  4. jeanphilippe wrote:

    Hi Thibault,
    What do you mean really by Query Graphics Data ?
    Are you thinking about FXG 1.0 graphic format like in Flex 4 ?

    Friday, August 29, 2008 at 7:48 am #
  5. ynk wrote:

    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 :)

    Friday, August 29, 2008 at 11:56 am #
  6. mama wrote:

    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.

    Friday, September 5, 2008 at 1:51 pm #
  7. Pedro wrote:

    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.

    Monday, November 3, 2008 at 10:16 pm #
  8. personman wrote:

    If nothing else, I would like to see some Cubic Bezier curve support. What’s two more parameters to the curveTo() method?

    Friday, June 19, 2009 at 11:32 pm #
  9. Dave wrote:

    I second that… the lack of cubic bezier support is a huge thorn in the side of developers.

    Thursday, December 24, 2009 at 6:00 pm #

Trackbacks/Pingbacks (3)

  1. Drawing API with Starling - ByteArray.org on Saturday, October 6, 2012 at 6:07 am

    [...] about some new APIs we could add to Flash Player and AIR to make this extension even more powerful. Graphics query, [...]

  2. Drawing API with Starling | TechnoVeille on Monday, October 8, 2012 at 8:55 pm

    [...] about some new APIs we could add to Flash Player and AIR to make this extension even more powerful. Graphics query, [...]

  3. Query Graphics Data – getGraphicsData() - ByteArray.org on Thursday, November 1, 2012 at 11:47 pm

    [...] by Thibault Imbert If you guys have been reading this blog for a while, you may remember that post about querying graphics data. I really wanted this back in the days for AlivePDF to query any [...]