I've had similar problems when creating AS3 components.  Look into 
updateDisplayList.  I believe you also have to make sure that your 
custom component has a width and height specified.

  You can always dig through the canvas code to figure out why that 
works, and use that info to figure out why yours doesn't.

droponrcll wrote:
> 
> 
> I have created a custom AS component "DragObject" based on Canvas.
> The idea is that ultimately users will be able to put whatever they
> want inside this ontainer and it will handle most of the code of drag
> and drop for them.
> 
> However, when I put another (100 x 100) Canvas inside this component
> just to test it out, the width and height of my component are 0, so
> it doesn't show up on stage. I used the super() method in my
> constructor, so I expected my component to behave like a Canvas in
> that it should automatically be sized around its children.
> 
> Here is the AS for my class:
> 
> package elearning
> {
> import mx.containers.Canvas;
> 
> public class DragObject extends Canvas
> {
> public function DragObject()
> {
> super();
> }
> private var _desc:String = "Untitled Draggable
> Object";
> public function get desc():String{
> return _desc;
> }
> public function set desc(descTxt:String):void{
> _desc=descTxt;
> }
> override public function toString():String{
> return("DragObject " + _desc);
> }
> }
> }
> 
> Thanks!
> 

-- 
Jeffry Houser, Technical Entrepreneur, Software Developer, Author, 
Recording Engineer
AIM: Reboog711  | Phone: 1-203-379-0773
--
My Company: <http://www.dot-com-it.com>
My Podcast: <http://www.theflexshow.com>
My Blog: <http://www.jeffryhouser.com>

Reply via email to