开发者

Type Coercion Error with Loaded and Instantiated SWF

开发者 https://www.devze.com 2023-03-23 19:39 出处:网络
I am loading a swf, \"ImageEdit\" into another swf, \"Shell\". I instantiate ImageEdit with var ClassReference:Class=imageEditApplicationDomain.getDefinition(\"ImageEdit\") as Class;

I am loading a swf, "ImageEdit" into another swf, "Shell". I instantiate ImageEdit with

var ClassReference:Class=imageEditApplicationDomain.getDefinition("ImageEdit") as Class;  
var instance:MovieClip=new ClassReference();

However, I get an error:

TypeError: Er开发者_开发问答ror #1034: Type Coercion failed: cannot convert flash.display::MovieClip@3b678b31 to fl.controls.Slider

ImageEdit does not throw an error when run by itself and not loaded into Shell. I've added:

import fl.controls.Slider

to Shell and other things which didn't help. Both SWFs contain the Slider component in their libraries. I am working Flash Professional CS5.5.

How can I get rid of the coercion error?


Replace MovieClip with Sprite or * or leave the type out.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号