• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

New Here ,
Apr 02, 2014 Apr 02, 2014

Copy link to clipboard

Copied

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?

Thanks!

Views

435

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Apr 03, 2014 Apr 03, 2014

I opened my Project again today to find out that it suddenly works perfectly... Something must have been cached because I struggled with it for 6 hours yesterday, and now without changing anything it work right off the bat.

I find there's so many caching issues like this in FB. Sometimes any changes I make are not reflected in the project at all (including deleting main classes) until I completely restart FB. Really wish Adobe would get their act together and release a patch to fix some of the an

...

Votes

Translate

Translate
New Here ,
Apr 03, 2014 Apr 03, 2014

Copy link to clipboard

Copied

LATEST

I opened my Project again today to find out that it suddenly works perfectly... Something must have been cached because I struggled with it for 6 hours yesterday, and now without changing anything it work right off the bat.

I find there's so many caching issues like this in FB. Sometimes any changes I make are not reflected in the project at all (including deleting main classes) until I completely restart FB. Really wish Adobe would get their act together and release a patch to fix some of the any bugs.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines