Highlighted

SWC Code doesn't run.

Contributor ,
Jun 20, 2019

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.

Views

113

Likes

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

SWC Code doesn't run.

Contributor ,
Jun 20, 2019

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.

Views

114

Likes

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
Jun 20, 2019 0
Adobe Community Professional ,
Jun 21, 2019

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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Jun 21, 2019 0
Contributor ,
Jun 21, 2019

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.

Likes

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
Reply
Loading...
Jun 21, 2019 0
Adobe Community Professional ,
Jun 22, 2019

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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Jun 22, 2019 1