0
votes

in Flash CS4 I created two FLA file.

In the First File: - I draw a shape; - I convert it to a MovieClip; - I link a MyClip class with a simple trace in the constructor; - I export the whole file as MyClip.SWC;

In the Second File: - I go to Edit > Preferences > ActionScript > ActionScript 3 settings and I add -in the Library Path- the file MyClip.SWC; - on the first frame of this swf I write var myClip:MyClip = new MyClip(); addChild(myClip);

I don't know what I'm doing wrong but when I compile (export swf) the class gets loaded (I see the trace in the output window) BUT I can't see the graphics associated to MyClip. It seems MyClip.SWC only contains the code of that clip.

What am I doing wrong? Is it even possible what I'm trying to do?

Can you help me? Thanks!

1

1 Answers

0
votes

What you're trying to do is very possible, and as far as I see you are doing it right. Maybe you made a mistake linking the graphic movieclip to the class?

To make sure, first remove any graphic object from the stage of your first .fla file (the one you are compiling into a .swc), and then write on the first frame the code:

var myClip:MyClip = new MyClip();
addChild(myClip);

You should see both the trace AND the graphic associated, otherwise there might be something wrong there. When you get it to work on the first .fla file, it should work as well on the one that loads the .swc