1 Reply Latest reply on Jan 3, 2011 4:16 AM by Anirudh Sasikumar

    cannot display movieclip from swc

    adc_newbie

      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);
              }
          }
      }