SyntaxScrewer's Blog

August 19, 2011

SWF in a SWF in a SWF SHELL = Exception fault: TypeError: Error #1034: Type Coercion failed:

Filed under: ActionScript 3.0,Flash — geekymaira @ 2:59 pm

Hello folks!!

I got stuck with this bugging bug!! and I just HAD to share it.
So, I had a Main SWF that loaded up a MapClass swf and a SHELL that loaded up the Main swf. Everything worked when I debugged the Main SWF alone. But as soon as I debugged the shell, I got the following error.

Exception fault: TypeError: Error #1034: Type Coercion failed: cannot convert a.b.c::MapEvent@c899eb1 to a.b.c.MapEvent.
	at com.iomedia.components::MapDocumentClass/onMapButtonClicked()
My Project structure was

        MapClass.fla   //SRC path set as   "../../src"   DOCUMENT CLASS: a.b.c.MapDocumentClass

Basically, I had 3 levels of nesting of swf's.

When I compiled the file it automatically compiled the event class and had it ready for the Erroneous Swf to use. So everything was peachy!
However, when I compiled the SHELL SWF, it didn't compile the Event Class because there was no reference to it in the class.

The solution :

1) Create  a dummy variable for the event in the class
2) Import the Event Class so that it gets compiled.

Everything worked after that!!

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: