2 Replies Latest reply on Feb 7, 2009 1:19 PM by honyk

    Adding graphics dynamically

      Hello Everyone,
      do you think there is any method how to add to my app a new graphics stored in XML variable? In code below I've tried type casting, but it fails in runtime... In reality this XML code will be read from the server and slightly modified before display. Any ideas are welcome.
        • 1. Re: Adding graphics dynamically
          rtalton Level 4
          There is no type "Graphic", so this will generate an error.

          I think what you want to do is draw something using either the mx.graphics class or the flash.display.Graphics class. Then you can read in your xml file, store into individual variables ("width", "height", "color", etc.), and finally use the variables to draw the graphic.
          • 2. Re: Adding graphics dynamically
            honyk Level 1
            Thanks for quick response! My XML file is FXG (SVG clone) file, but loaded into XML variable. Now it is probably to soon to solve these issues as this is still in beta state, but I am curious if there will be any more straightforward way than making own 'SVG' parser and renderer...
            I am beginner in Flex so maybe there is better way still unknown to me how to load FXG-style format directly. I hope :-)