Search code examples
actionscript-3flashgraphicsflashdevelopdisplayobject

Using graphics in FlashDevelop


I've been programming ActionScript 3 for some while and I've recently decided to ditch Flash Professional in favour of FlashDevelop. I'm glad of the choice, but I eventually found a small problem: Since I don't have access to Flash Professional's graphics library there's a lot of code that tries to reference non-existent clips. Let's work with this example where MC1 is an element of the FlashPro library:

public class GraphicElement
{
    public var clip:DisplayObject;

    function GraphicElement(theClip:DisplayObject)
    {
        this.clip = theClip;
    }
}

//And in another Class:

var myGraphic:GraphicElement = new GraphicElement(new MC1() as DisplayObject);

In FlashDevelop, "new MC1()" means nothing. How do I import graphics to use with the DisplayObject class?


Solution

  • Fixed. What I said was a very complicated phrasing for "How do I embed images to my project?" Found the answer here: http://www.streamhead.com/how-to-use-images-in-actionscript-3-with-flashdevelop-and-some-other-as3-tips/