Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:37:29+00:00 2026-06-09T17:37:29+00:00

Does anyone know of any libraries or tools for importing an SVG file into

  • 0

Does anyone know of any libraries or tools for importing an SVG file into actionscript on the fly? I need to be able to import an SVG file into flash and convert it to a movieclip or preferably a flat 3d object. The end goal here is to implement a vector file with Augmented reality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:37:31+00:00Added an answer on June 9, 2026 at 5:37 pm

    A great library for this can be downloaded here: http://code.google.com/p/as3svgrendererlib/
    It is easy to implement and reliable. Note that there are two ways to implement the code. I prefer the following because it gives you more control:

         private function loadSVG(url:String):void {
            ProcessExecutor.instance.initialize(stage);
            ProcessExecutor.instance.percentFrameProcessingTime = 0.9;
    
            loader = new URLLoader();
            loader.dataFormat = URLLoaderDataFormat.TEXT;
            loader.addEventListener(Event.COMPLETE, svgLoaded, false, 0, true);
    
            try {
                loader.load(new URLRequest(url));
            } catch (error:Error) {
                trace(error);
            }
        }   
        private function svgLoaded(e:Event):void {
            var svgString:String = loader.data as String;
            var svgDocument:SVGDocument = new SVGDocument();
            svgDocument.parse(svgString);
    
            this.addChild(svgDocument);
        }
    

    The other way is shorter and might be the way to go when you only have to load a small SVG or just a few.

    public function loadSVG(url:String) {
            ProcessExecutor.instance.initialize(stage);
            ProcessExecutor.instance.percentFrameProcessingTime = 0.9;
    
            var svgDocument:SVGDocument = new SVGDocument();
            svgDocument.load(url);
            addChild(svgDocument);
        }
    

    Two important notes:
    1. I could not seem to be able to capture the width or height of the SVGs and the parent Sprite had a width and height of 0 after loading the SVG. I solved this by making all the SVGs the same size before loading them into AS3. After that I knew the dimensions I used the ScaleX and scaleY to resize the loaded SVGs.
    2. The stage has to exist before you can use this code. adding the following code will make sure you won’t run into problems:yourDisplayClass.addEventListener(Event.ADDED_TO_STAGE, loadYourSVGs);

    Now how you convert this to a flat 3D object depends on your 3D Library. I have worked with Away3D where you can use bitmapmaterial on your Sprite3D. The Sprite3D class would be the object to use. I hope your 3D Library supports the use of MovieClips so that you can add them to your 3D Object. Else you will have to use to extract the bitmapMaterial from the movie clip as i have done in the following example:

    public function movieClipToBitmapMaterial(mc:MovieClip):BitmapMaterial {
            var bmData:BitmapData = new BitmapData(mc.width, mc.height, true, 0xFFFFFF);
            bmData.draw(displayObject);
            return new BitmapMaterial(bmData);
        }
    

    Your input in the above function will be the movieclip onto wich you have loaded your SVG.

    I am not sure of this but I think that by using this function you will loose the ability to scale as much as you like without loosing quality.

    I hope my input was of some help!
    Good luck

    PS: don’t forget to add the SWC from the link to your project and to check out the provided examples. Please note as well the excellent comment of shaunhusain on your original question. You might not have to use 3D Library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know any as3 libraries that allow you to scale, rotate, skew, etc..
Does anyone know of any libraries that decode one or more of the multitude
Does anyone know of any Java SDKs/libraries for communicating via the TL1 protocol that
Does anyone know of any free and working external libraries for reading emails in
Does anyone know of any C++ Libraries which I can easily integrate in a
Does anyone know of any embeddable Software/libraries for android/ios/etc that will provide web server
Does anyone know of any free/open-source text recognition libraries in C/C++/Objective-C? Basically something that
Does anyone know of any tests apps out there (or even libraries that can
Does anyone know of any C container libraries? I am looking for something which
Does anyone know of any libraries that one can use to parse a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.