AS3: TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::SimpleButton
If you get an error like this in an actionscript 3 Flash file:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::SimpleButton@61422481 to [symbolname].
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at classname()[/path_to/as/classname.as:34]
Check the symbol named in [symbolname] to make sure it is specified as a Movie Clip rather than a button.
Other possible reasons for the error are given in:
ei ,
Have you encountered this kind of error in Flex
“Type Coercion failed: cannot convert mx.charts.events::ChartIemEvent to ListEvent”
Thanks
Cyianite
Thanks for the tip. It lead me to my solution. I found that I had a button and a movie clip with the same instance name. I am building a prototype of a user interface and I just put an invisible button on top of a button graphic. I had both named the same thing. The 1034 error message was not very helpful. I supose it would be wise to just add an event listener to the movie clip and skip the invisible button :).
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@34c7f511 to fl.motion.AnimatorFactory.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at ProjectDraft_fla::MainTimeline()
I am getting this error. How do I fix it?
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::AVM1Movie@2d1630f9 to flash.display.MovieClip.
how can i solve this type of error
—–