CustomEvent TypeError: Error #1034: Type Coercion failed

TypeError: Error #1034 Type Coercion failed: cannot convert com.events::CustomEvent@###### to com.events.CustomEvent.
at flash.events:EventDispatcher/dispatchEventFunction()
….blah,blah,blah,blah

This was an error I was getting and I couldn’t figure out what was causing it. Turns out its a simple fix. I was loading a swf that dispatches a CustomEvent. To get rid of this error I just needed to import the CustomEvent Class in the main class that is loading the other swf.

import com.events.CustomEvent;

Then somewhere in you main class, you add

CustomEvent;

Tags: ,

2 Responses to “CustomEvent TypeError: Error #1034: Type Coercion failed”

  1. PolariodNinja Says:

    Thank you! You’ve saved my neck!

  2. eccheung4 Says:

    awesome! that is one nasty bug

Leave a Reply