Your GroupHandle has no measure method so it will be given a size of 0,0
unless you specify a width/height on the GroupHandle
 
Please read over the docs on custom component development.  There is a
basic recipe you should be following.

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Merrill, Jason
Sent: Friday, August 01, 2008 11:17 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: problem adding images to UIComponents using
AS3



>>You can draw those graphics in a UIComponent so I would 
>>have grouphandle subclass UIComponent and not Sprite. 

Thanks Alex, I tried that, but still no joy, AND the graphics don't
render now either for some strange reason.  All I did is change my
previously posted code to:  public class GroupHandle extends UIComponent
(and I also imported UIComponent of course).  Here is the class, still
not showing the image.  Thanks for any further help  you can provide:

package com.venice.view.network.groupingTool 
{ 
        import mx.controls.Image; 
        import mx.core.UIComponent; 
        
        public class GroupHandle extends UIComponent 
        {               
                public const FILL_COLOR:uint = 0xffffff; 
                public const FILL_ALPHA:Number = .5; 
                public const STROKE_COLOR:uint = 0x000000; 
                public const STROKE_THICKNESS:Number = 1; 
                public const STROKE_ALPHA:Number = 1.0; 
                public const SIZE:Number = 10; 
                
                [Embed(source = "/media/icons/control_repeat_blue.png")]

                private var _moveGroupImage:Class; 
                
                public function GroupHandle():void 
                { 
                        graphics.clear(); 
                        graphics.lineStyle(STROKE_THICKNESS,
STROKE_COLOR, STROKE_ALPHA); 
                        graphics.beginFill(FILL_COLOR, FILL_ALPHA); 
                        graphics.drawRect(-(SIZE/2), -(SIZE/2), SIZE/2,
SIZE/2); 
                        graphics.endFill(); 
                        
                        var icon:Image = new Image(); 
                        icon.source = _moveGroupImage; 
                        icon.setActualSize(100, 100) 
                        addChild(icon); 
                }       
        } 
} 



Jason Merrill
Bank of America 
Enterprise Technology & Global Risk L&LD
Instructional Technology & Media 

Join the Bank of America Flash Platform Developer Community
<blocked::http://sharepoint.bankofamerica.com/sites/tlc/flash/default.as
px>  

Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GT&O Innovative Learning Blog
<blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/default.
aspx>  & subscribe
<blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/_layouts
/SubNew.aspx?List=\{41BD3FC9-BB07-4763-B3AB-A6C7C99C5B8D\}&Source=http:/
/sharepoint.bankofamerica.com/sites/ddc/rd/blog/Lists/Posts/Archive.aspx
> . 


 

Reply via email to