1 Reply Latest reply on Apr 3, 2014 6:02 AM by Justin_G

    Embedding an SWF Movieclip gives error: "cannot convert box_swf to flash.display.MovieClip"


      Hello, I'm getting an odd error on some very simple code.

      I have an swf that contain a movieclip with the Linkage name 'Box'. The movieclip has an animation of 30 frames, yet Flash Builder keeps erroring saying it's not a movieclip!



      public class Main extends Sprite


              [Embed(source="../assets/box.swf", symbol="Box")] public static const A_Box:Class;

              public function Main()


                  var box:MovieClip = new A_Box();



      #1034: Type Coercion failed: cannot convert box_swf$161b93e3bc30cfa0cb18e1d734943c6f-1063626660@53720a1 to flash.display.MovieClip.



      If I try to bring it in as a Sprite, it works just fine (var box:Sprite = new A_Box();), however then it does not animate, as it's being treated as a sprite.

      I've looked at around 20 online examples, the code is very simple and I can't seem to find anything wrong with my code. I've also double checked 300

      times and the Movieclip is set up properly inside the Swf. (Linkage name, multiple frames, export for actionscript frame 1, etc)


      So... Why does only Sprite work and MovieClip doesn't?

      Am I doing something wrong or is this maybe a FlashBuilder/Air13.0 problem?