Sebastian:

Why don't you create your own component like the following then you can 
bind your component source to your variable then you can control size 
and effects etc.  I prefer SWFLoader to loader and i don't know why but 
everyone says to use that instead

var box:Thumb = new Thumb();
box.pSource = "myURLtoMyImage";

And this way you have complete flexablilty.

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="60" 
height="45" styleName="thumbUp" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            import mx.controls.Label;
           
            [Bindable]
            public var tLabel:String;
           
            [Bindable]
            public var pSource:String;
           
           
            private function init():void
            {
                this.addEventListener(MouseEvent.ROLL_OVER, overEvent);
                this.addEventListener(MouseEvent.ROLL_OUT, outEvent);
            }
           
            private function overEvent(e:MouseEvent):void
            {
                this.filters = [new GlowFilter(0xFFFFFF,1,6,6,1,1)]
            }
           
            private function outEvent(e:MouseEvent):void
            {
                this.filters = []
            }
        ]]>
    </mx:Script>
    <mx:SWFLoader x="0" y="0" maintainAspectRatio="false" 
scaleContent="false" autoLoad="true" id="swfLoader" width="100%" 
height="100%" source="{pSource}" completeEffect="{fadeIn}"/>
    <mx:Label textAlign="right" right="0" bottom="0" color="#ffffff" 
fontSize="16" fontWeight="bold" fontFamily="Arial" text="{tLabel}"/>
    <mx:Fade id="fadeIn" alphaFrom="0" alphaTo="1" />
</mx:Canvas>


Sebastian Zarzycki wrote:
>
> I'm using Loader class to dynamically load images from server, as it's 
> advised in "Loading content dynamically" of Programming ActionScript 
> 3.0 - Flex doc.
> But there's one thing I don't understand. In example there, we have :
> |
> |var pictLdr:Loader = new Loader();
> pictLdr.load(new URLRequest(some_url));
> this.addChild(pictLdr);
>
> - and in every example, the Loader class is automatically added to a 
> certain container. How is that different from mx:Image? I don't have 
> image location at compilation time, it is created in runtime. Can I 
> point mx:Image source to computed url or not? If I have to use Loader 
> class then, is there any way to *copy* loader content into mx:Image I 
> have in my design?  I can use mx:Image as a container and put Loader 
> into it, but then I will loose my Image properties, like automatic 
> scaling. What I am missing?
>
> It is important for me, to see the image container in Flex Builder, so 
> when I show the screen mockup to my client, he will be able to see 
> that at this and this place there will be image loaded at runtime. 
> Should I use SWFLoader maybe?
>
>
>
> -- 
> | Sebastian Zarzycki / rat[tkin]
> | [EMAIL PROTECTED]
> | i'm a little lost in this postmodern space
> | gg:#2692696 / icq:#264185739 irc :#tool #ot-oa / skype:rattkin
>  




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to