4 Replies Latest reply on Sep 6, 2012 5:09 PM by SVGToFlashPlease

    svg and as2

    kostis alexandris

      i managed to load an svg tiny file on flashlite 3.0. Is there any way to load an svg file dynamically through as2? (i suppose that as long as it is loaded in flashlite there is also a way to load it by as2). Thank you in advance!

        • 1. Re: svg and as2
          kglad Adobe Community Professional & MVP

          you can use the loadvars class to load an svg or use the xml class.  you'll find it easier to parse your svg file if you using the xml class.

          1 person found this helpful
          • 2. Re: svg and as2
            kostis alexandris Level 1

            First of all, thank you for your immediate response! maybe my question was a little vague! but i do not only want to load an svg (and parse it) but mainly i want to render it in as2 (is there for example anything like loadAndPlay(mytinysvgfile.svg) command?).   Thank you again!

            • 3. Re: svg and as2
              kglad Adobe Community Professional & MVP

              no.  you'll need to create your own code to parse the svg file.

               

              you can search for an as2 framework that someone else created and made available.  i'm not sure that exists but if creating your own code is out of the question that would be an option you might want to check.

              1 person found this helpful
              • 4. Re: svg and as2
                SVGToFlashPlease

                Have to tried the itechnica PathToArray class to parser and render your SVG.

                 

                Info can be found here ->http://flash-creations.com/notes/sample_svgtoflash.php

                 

                If you have successfully tried it then could you please let me know. I tried with my SVG and I am running into problems. My svg image when opened through a browser shows a green circle with a black border. But when I run it through the parser, I see a solid black circle. The parser first draws the green circle and then overlays the black circle on top creating the reverse effect. The browser somehow knows which object is the foreground and which is the background but the parser doesnt. The parser seems to be doing the right thing

                in terms of drawing out the path instructions correctly, and in the order it appears in the xml, but the final result is wrong.

                 

                I am hoping you have some tips to share. I can provide more details when I hear back.