Not to say this is the only way, but here is one way:

// embed the default button icon 
[Embed(source="images/pause.gif")]
// create a Class for the pause icon - make it bindable.
[Bindable] private var imgPauseClass:Class;
// embed the alternate button icon 
[Embed(source="images/play.gif")]
// create a Class for the play icon - make it bindable.
[Bindable] private var imgPlayClass:Class;

<!-- using flash-style short-hand notation -->
<mx:Button id="btnPlay" label="Play" labelPlacement="left"
icon="{(btnPlay.label=='Play')?imgPlayClass:imgPauseClass}"/>

I omitted the click event in the button and the function handler for
that event for bevity, but of course you would have those. By toggling
the label of the button in your click handler, you are able to toggle
between the Play and Pause icons.

Hope this helps you, Mike G. 

--- In [email protected], "richmcgillicuddy" <[EMAIL PROTECTED]> wrote:
>
> is there a way to do this?
> 
> 
> Rich
>

Reply via email to