• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

cannot display movieclip from swc

New Here ,
Dec 29, 2010 Dec 29, 2010

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

Views

500

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 03, 2011 Jan 03, 2011

Copy link to clipboard

Copied

LATEST

Explicitly use the class in the SWC.

That is, do:

var faceMc:angry = new angry();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines