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!
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
...Copy link to clipboard
Copied
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.