A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: MXMLC / AS3 importing movieclip assets???

  1. #1
    Member
    Join Date
    Mar 2004
    Posts
    45

    Question MXMLC / AS3 importing movieclip assets???

    Hi Everyone,

    I've recently switched from using Flash CS3 to compile my programs, to the free Flex SDK and am using MXMLC to compile AS files.
    But, I have a question...
    I have some movieclips developed in Flash, which I would like to use in my AS files...how can I import them and use them in my AS files?

    Hope someone can help out!
    It'd be much appreciated!

    Cheers!
    David

  2. #2
    Member
    Join Date
    Mar 2004
    Posts
    45

    Lightbulb Figured it out!

    OK, I figured it out....so here is how it's done (Thanks to Keith on Bit-101 for this info).

    Code:
    package {
    
    	import flash.display.Sprite;
    
    	public class App extends Sprite {
    
    		[Embed(source="myLibrary.swf", symbol="SomeLinkageID")]
                    private var SomeLinkageID:Class;
    		
    		public function App() {
    			var mySpriteInstance:Sprite = new SomeLinkageID();
                            addChild(mySpriteInstance);
    		}
    
    	}
    
    }
    How it works: build an swf file of symbols you want as library items in Flash. I have called it "library.swf" but you can replace that with your own name.
    Set each symbol's export settings to embed on first frame and export for Actionscript.
    Write down the symbols' Linkage ID names and use these to replace "SomeLinkageID" in the above example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center