Re: [flexcoders] How to display a button's icon from a remote source?

2008-04-06 Thread Daniel Gold
Sure switching on the type of an argument to a setter would work, for some
reason I thought the 'source' on an image was a style instead of a property.
I try to expose as many styles as possibly for custom components so they're
easily skinnable in CSS, but I guess there's no way to expose a style that
allows multiple types. Would have to have iconClass and iconPath styles if I
wanted it to be flexible for embedded or runtime assets.

Thanks for the reality check on SWFLoader, I was off in the weeds.

On Sat, Apr 5, 2008 at 3:33 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote:

>Oooops.  I'd best slow down a bit.
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Rick Winscot
> *Sent:* Friday, April 04, 2008 9:55 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* RE: [flexcoders] How to display a button's icon from a remote
> source?
>
>
>
> Tracy… Dr. McCoy of Star Trek fame said it best.
>
>
>
> "Damnit Jim, I'm a –class– not an externally loaded asset." – Through the
> Loader Class
>
>
>
> …universal translation…
>
>
>
> The Icon takes a class as an argument… not an externally loadable asset.
> Dynamically loading an image (for a button) is more difficult – but still
> possible. Ben Stucki has done some marvelous work in that arena. Ping me off
> line if you need the hook up.
>
>
>
>  Rick Winscot
>
>
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Tracy Spratt
> *Sent:* Friday, April 04, 2008 9:11 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* RE: [flexcoders] How to display a button's icon from a remote
> source?
>
>
>
> Just set source="[url]"
>
> Tracy
>
>
>  ----------
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *guillaumeracine
> *Sent:* Friday, April 04, 2008 7:20 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] How to display a button's icon from a remote
> source?
>
>
>
> Hi,
> i know we can set the icon of a button using this syntax:
> 
>
> but my image icon is on a remote server...
> How i can set the icon of a button from a remote source?
>
>  
>


RE: [flexcoders] How to display a button's icon from a remote source?

2008-04-05 Thread Tracy Spratt
Oooops.  I'd best slow down a bit.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rick Winscot
Sent: Friday, April 04, 2008 9:55 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] How to display a button's icon from a remote
source?

 

Tracy... Dr. McCoy of Star Trek fame said it best.

 

"Damnit Jim, I'm a -class- not an externally loaded asset." - Through
the Loader Class

 

...universal translation...

 

The Icon takes a class as an argument... not an externally loadable
asset. Dynamically loading an image (for a button) is more difficult -
but still possible. Ben Stucki has done some marvelous work in that
arena. Ping me off line if you need the hook up.

 

 Rick Winscot

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, April 04, 2008 9:11 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] How to display a button's icon from a remote
source?

 

Just set source="[url]"

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of guillaumeracine
Sent: Friday, April 04, 2008 7:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to display a button's icon from a remote
source?

 

Hi,
i know we can set the icon of a button using this syntax:


but my image icon is on a remote server...
How i can set the icon of a button from a remote source?

 



RE: [flexcoders] How to display a button's icon from a remote source?

2008-04-05 Thread Rick Winscot
If you wanted to create a custom component that allowed for a class, string,
bitmap, etc. SURE! But you would need to 'switch' against the argument past
and check for its type. If it were a string - you would want to (via loader)
load the external asset. You would want to hand the disposition of each type
appropriately. but just putting a property called 'source' on your component
doesn't mean anything. The devil is in the details.

 

The implementation is worth a look if you haven't yet. Check out the
SWFLoader.as file (.frameworks\mx\controls\SWFLoader.as in your Flex sdk
directory). You'll notice that the argument for 'source' is described as
URLOrPathOrClass.

 

Rick Winscot 

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel Gold
Sent: Saturday, April 05, 2008 1:15 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How to display a button's icon from a remote
source?

 

I get asked this by new Flex developers I work with all the time, especially
people from a more traditional web development background who are not used
to embedding assets.

Here's something that bugged me a while back and I never took the time to
look into: So the button icon takes a Class, that's all good and well, but
how does the Image class get by accepting either a Class OR a String
representing the path to an image to load at runtime? The source style
allows both doesn't it? If I was creating a custom component and wanted to
add an imageSource custom style would that be possible?

On Fri, Apr 4, 2008 at 8:55 PM, Rick Winscot <[EMAIL PROTECTED]> wrote:

Tracy. Dr. McCoy of Star Trek fame said it best.

 

"Damnit Jim, I'm a -class- not an externally loaded asset." - Through the
Loader Class

 

.universal translation.

 

The Icon takes a class as an argument. not an externally loadable asset.
Dynamically loading an image (for a button) is more difficult - but still
possible. Ben Stucki has done some marvelous work in that arena. Ping me off
line if you need the hook up.

 

 Rick Winscot

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, April 04, 2008 9:11 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] How to display a button's icon from a remote
source?

 

Just set source="[url]"

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of guillaumeracine
Sent: Friday, April 04, 2008 7:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to display a button's icon from a remote source?

 

Hi,
i know we can set the icon of a button using this syntax:


but my image icon is on a remote server...
How i can set the icon of a button from a remote source?

 

 

<><>

Re: [flexcoders] How to display a button's icon from a remote source?

2008-04-05 Thread Daniel Gold
I get asked this by new Flex developers I work with all the time, especially
people from a more traditional web development background who are not used
to embedding assets.

Here's something that bugged me a while back and I never took the time to
look into: So the button icon takes a Class, that's all good and well, but
how does the Image class get by accepting either a Class OR a String
representing the path to an image to load at runtime? The source style
allows both doesn't it? If I was creating a custom component and wanted to
add an imageSource custom style would that be possible?

On Fri, Apr 4, 2008 at 8:55 PM, Rick Winscot <[EMAIL PROTECTED]> wrote:

>Tracy… Dr. McCoy of Star Trek fame said it best.
>
>
>
> "Damnit Jim, I'm a –class– not an externally loaded asset." – Through the
> Loader Class
>
>
>
> …universal translation…
>
>
>
> The Icon takes a class as an argument… not an externally loadable asset.
> Dynamically loading an image (for a button) is more difficult – but still
> possible. Ben Stucki has done some marvelous work in that arena. Ping me off
> line if you need the hook up.
>
>
>
>  Rick Winscot
>
>
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Tracy Spratt
> *Sent:* Friday, April 04, 2008 9:11 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* RE: [flexcoders] How to display a button's icon from a remote
> source?
>
>
>
> Just set source="[url]"
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *guillaumeracine
> *Sent:* Friday, April 04, 2008 7:20 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] How to display a button's icon from a remote
> source?
>
>
>
> Hi,
> i know we can set the icon of a button using this syntax:
> 
>
> but my image icon is on a remote server...
> How i can set the icon of a button from a remote source?
>
>   
>


RE: [flexcoders] How to display a button's icon from a remote source?

2008-04-04 Thread Rick Winscot
Tracy. Dr. McCoy of Star Trek fame said it best.

 

"Damnit Jim, I'm a -class- not an externally loaded asset." - Through the
Loader Class

 

.universal translation.

 

The Icon takes a class as an argument. not an externally loadable asset.
Dynamically loading an image (for a button) is more difficult - but still
possible. Ben Stucki has done some marvelous work in that arena. Ping me off
line if you need the hook up.

 

 Rick Winscot

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, April 04, 2008 9:11 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] How to display a button's icon from a remote
source?

 

Just set source="[url]"

Tracy

 

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of guillaumeracine
Sent: Friday, April 04, 2008 7:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to display a button's icon from a remote source?

 

Hi,
i know we can set the icon of a button using this syntax:


but my image icon is on a remote server...
How i can set the icon of a button from a remote source?

 

<><>

RE: [flexcoders] How to display a button's icon from a remote source?

2008-04-04 Thread Tracy Spratt
Just set source="[url]"

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of guillaumeracine
Sent: Friday, April 04, 2008 7:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to display a button's icon from a remote
source?

 

Hi,
i know we can set the icon of a button using this syntax:


but my image icon is on a remote server...
How i can set the icon of a button from a remote source?

 



[flexcoders] How to display a button's icon from a remote source?

2008-04-04 Thread guillaumeracine
Hi,
i know we can set the icon of a button using this syntax:


but my image icon is on a remote server...
How i can set the icon of a button from a remote source?