Search code examples
flashactionscript-3flash-cs5flashdevelopcoercion

Flash Error #1034: Type Coercion failed when running with Flash Develop


I have compiled an SWC and am using it in a flashdevelop project.

When I compile the project all is fine, but when I run/debug the project I get:

[Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@43e3f99 to fl.controls.Button.

The following line is causing the fault:

public var loginPanel:loginControl  = new loginControl();  

LoginControlView is the movieclip name. loginControlView is the asset name. and there is a class called loginControl that extends loginControlView

The LoginControlView movieclip contains 2 textboxes and a button (fl.controls)

The project runs fine if I compile/run/debug from the Flash IDE.

Any suggestions?


Solution

  • Ok I found a solution. Included in my classpaths was a path to the fl.controls folder of the flash install. But the fl.controls where also being exported with my SWC. I assume having two definitions of the same class was causing the problem, because when I removed the classpath all worked fine.