Try mx.controls.SWFLloader (or in MXML, <mx:SWFLoader> ) instead of 
mx.controls.image. My understanding of image (at least in a Flex context) is 
that it's only for static images, not dynamic images. Swfloader can do .swfs, 
.jpegs,.pngs, etc.  Not sure if that is it, but that's what my experience has 
been.  Also, the help docs on mx.controls.image say:

"Flex also includes the SWFLoader control for loading Flex applications. You 
typically use the Image control for loading static graphic files and SWF files, 
and use the SWFLoader control for loading Flex applications. The Image control 
is also designed to be used in custom item renderers and item editors. "

Jason Merrill
Bank of America 
Learning & Organizational Effectiveness
 
 
 
 
 
 

>>-----Original Message-----
>>From: [EMAIL PROTECTED] 
>>[mailto:[EMAIL PROTECTED] On Behalf 
>>Of Janis Radins
>>Sent: Wednesday, January 10, 2007 12:37 PM
>>To: flashcoders@chattyfig.figleaf.com
>>Subject: [Flashcoders] Some AS3 components troubles
>>
>>Hey people!
>>
>>I'm trying to make some pretty simple UI component in Flex 
>>and it seems like I'm missing something.
>>I think I've read everything I could but I cannt find what is 
>>it I'm missing, maybe someone on this list knows wheres the problem.
>>So what I am doing is:
>>1. I create some pretty simple MXML project just for test 
>>with this content <?xml version="1.0" encoding="utf-8"?> 
>><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
>>xmlns:myComp="components.*" layout="absolute">
>>    <myComp:TestComponent></myComp:TestComponent>
>></mx:Application>
>>
>>Pretty simple.
>>xmlns:myComp="components.*" defines that components can be 
>>found in folder named components in root of project, where I 
>>have this file TestComponent.aswith following content package 
>>components {
>>    import mx.core.UIComponent;
>>    import mx.controls.Image;
>>    import flash.display.Shape;
>>    public class TestComponent extends UIComponent {
>>        private var imageInstance:Image = null;
>>        public function TestComponent() {
>>             super();
>>            imageInstance = new Image();
>>            imageInstance.source = "icon.gif";
>>            addChild(imageInstance);
>>            trace("TestComponent initialized!");
>>            var shape:Shape = new Shape();
>>            shape.graphics.beginFill(0xFF0000);
>>            shape.graphics.drawCircle(50,50,25);
>>            addChild(shape);
>>        }
>>    }
>>}
>>
>>"icon.gif" is bitmap stored in root folder of project.
>>Seems like pretty stright forward and theres nothing to 
>>break, but it isnt so. Shape appears, which make me think 
>>that component instance is initialized and placed in display list.
>>But I really have bad luck with creating mx.controls.Image i 
>>think I tried everything with no luck.
>>There must be something I'm missing, but I have no idea what is it :)
>>
>>Oh, and when I tried to extend some component directly it 
>>works, seems like thers no blank components for me!
>>Any help will be apreciated!
>>
>>Jānis
>>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to