1 Reply Latest reply on Jul 10, 2007 4:04 AM by RichardHz

    Dynamically loading an icon for a Button

      There has to be a simple way to do this in AS3.

      I want to load an image from a remove server and use it as the icon on a button. Seemed simple enough, except that I couldn't figure out how to coerce a Loader into a Class (required for the Button icon.)

      This looked interesting and seemed to confirm the approach I was taking, but clearly doesn't. work.

      Clearly I'm missing something obvious here. Any ideas? TIA.
        • 1. Re: Dynamically loading an icon for a Button
          Here is an extract from the help, if you replace the upSkin with icon you should get the result you require

          Flex must embed the button images in the application's SWF file at compile time; you cannot download images from the server at run time. To embed the image, use the @Embed MXML compiler directive. The following code example shows how to use a GIF file as the up (default) button image:


          Hope this helps