0 Replies Latest reply on Jul 19, 2007 9:37 PM by dnapoleoni

    bitmapdata problem

    dnapoleoni
      I've made some charts, and I'm trying to create a way to export the chart to an image. I've used this http://digg.com/users/Srirangan/news/dugg png encoding method, and it works fine when I set the bitmapdata object to my chart id :

      var bd:BitmapData = new BitmapData(chart_cht.width,chart_cht.height);
      bd.draw(chart_cht);

      But I want to include the text above my chart and the text below, so I decided to fill my bitmapdata object with the contents of the entire canvas, which contains every object of the application. for some reason, no matter what I set the id of my canvas to be, it keeps telling me:

      "1120: Access of undefined property canvas_cvs" (or whatever i call it)

      I found another example online that uses the same functionality http://www.jamesward.org/wordpress/2006/08/16/flex-paint-flex-display-object-to-png/ and I downloaded the source, and it's exactly the same as my code, except that the actionscript is included in the start of the mxml file and not in an imported .as file.

      Is there any reason why the bitmapdata object will accept a chart component as its source and not a canvas? and why would it work for someone else and not me, when we do it the exact same way?