SWC Code doesn't run.
Copy link to clipboard
Copied
I have an SWC set up so that it imports into another FLA. In the FLA, I have some code like this:
var mp:MovieClip = new MP() as MovieClip;
addChild(mp);
MP is a MovieClip in the SWC typed as a class called 'MP'.
MP has code in it that should execute when it's added. But it doesn't. Does anyone know why?
Thanks in advance.
Copy link to clipboard
Copied
Hi.
Please try...
var mp:MP = new MP();
addChild(mp);
... and see if it works.
If not, can you provide the files?
Regards,
JC
Copy link to clipboard
Copied
Thanks for replying!!
Doesn't work. At least not any better than what we had.
How do i get you files? I'd love to troubleshoot this without that bother though.
Essentially, I have code that is unwrapped (not in a function) and should simply execute when this thing is added (set up listeners, init stuff, blah blah). And it doesn't execute on launch.
If I put it in an 'init()' function and call it (mp.init()), it works. But I'd rather it just execute automatically.
Copy link to clipboard
Copied
Hi.
I see.
Please upload to Google Drive, Dropbox, WeTransfer, or any other file sharing service and paste the link here if this is not a problem for you.
Regards,
JC

