1
votes

I'm now moving some of my projects to FB from Flash CS5. I've got a question:

In CS5 when I wanted to add some images I just imported them to the library, put them into some movie clip, assigned it to some class Image (you know - this option export for actionscript) and then used code like

image:Image = new Image();

this.addChild(image);

How do I work with images in FB when I don't have a library? I mean that I do not want to load them from somewhere but i want to include them into my swf file.

1

1 Answers

4
votes

You must export SWC File.

refer a following process.


Export for ActionScript.

enter image description here


in Library mouse right click and Export SWC File click and name set "Image"

enter image description here


in your flash builder project make a asset folder. and your SWC files drag and drop or copy.

enter image description here


in your project mouse right click and Properties click.

enter image description here


Actionscript Build Path - Library Path - Add SWC Folder click and input a asset

enter image description here

enter image description here


you should following code Load a Class.
package
{
    import flash.display.Sprite;
    
    public class TestProject extends Sprite
    {
        public function TestProject()
        {
            var image:Image = new Image();
            addChild(image);
        }
    }
}

enter image description here