Copy link to clipboard
Copied
i have created a simple program that will display an expression of faces. it was created in flash cs5 and compiled into swc.
i have added the swc in the library path. my problem is i'm not able to display it when i run it in flash builder. here is my code:
package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.utils.getDefinitionByName;
import mood.angry;
mood.angry;
[SWF(width='400', height='500', frameRate='30', backgroundColor='0x000000')]
public class Faces extends Sprite
{
public function Faces()
{
var faceClass:Class = getDefinitionByName("angry") as Class;
var faceMc:MovieClip = new faceClass() as MovieClip;
this.addChild(faceMc);
}
}
}
Copy link to clipboard
Copied
Explicitly use the class in the SWC.
That is, do:
var faceMc:angry = new angry();