0
votes

I create my symbol with a class name

enter image description here

I publish as an SWC, and in flash buildr it looks like this

enter image description hereenter image description here

I import MyRect and try and use it

var redRect:MyRect = new MyRect;
     addChild(redRect);

I get an error

Implicit coercion of a value of type MyRect to an unrelated type DisplayObject....line 93 Flex Problem

1
You can not add MovieClip (or Sprite) classes directly to most Flex components - try adding MyRect to a UIComponent instead.user1901867
it is an actionscript projectLeBlaireau
why do you have "Flex" in your error message then?user1901867
see latest screen was at the end in the 'type' box. But this is setup on FB 4.7 as an Actionscript project running on air.LeBlaireau
When you open up your swc in the "Referenced Libraries" part of the Project Explorer, do you see a MyRect.abc Class listed there?Amy Blankenship

1 Answers

0
votes

I think the problem is in how your declaring it. It might have to do with the object type. Try this:

var objects:Array;
objects = [0];
objects[0] = new MyRect();
addChild(objects[0]);

and see what happens.