One option would be to use the effects of the button to do the transitions.
Unfortunately, they don't appear to be customized for the Button class, so I
don't know if you'd step on stuff the Button class does in regards to
mouseOver, mouseOut, etc.

To be honest, depending on the complexity of your visuals and the number of
these buttons you need in your UI, it may be quicker to just create an
mx:Canvas that looks like a button and use effects (if you need a container
with children, e.g. labels and images), or just create a UIComponent
directly and manipulate it (if you've got just images).

Of course, that does depend on the overhead of Canvas which is something
I've been curious about (and perhaps Alex could answer): does mx:Canvas
introduce much overhead to the UI (as compared to UIComponent)? I know
mx:Canvas does a lot of layout chores, but are they relatively cheap if the
children are relatively cheap (e.g. a few fixed sized components with fixed
positions)?

Troy.


On 9/17/07, Alex Harui <[EMAIL PROTECTED]> wrote:
>
>  You can design a skin as a multi-frame animation in Flash and use it in
> Flex
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Troy Gilbert
> *Sent:* Monday, September 17, 2007 10:38 AM
> *To:* [email protected]
> *Subject:* Re: [flexcoders] Buttons in Flex !
>
>
>
> > I am creating some skins for my buttons, but i have one problem. I want
> > to have a nice transition from one skin (Up Skin) to another skin (Down
> > skin). In other words i want to create a button that lights when i do
> > mouseOver but slowly. IS that possible?
>
> Hmm, good question...
>
> In the Flash IDE, you'd just create animations in each state
> (transition is tricky, but you could easily have it play an animation
> at the beginning of a state and loop).
>
> In Flex, you could do it with a programmatic skin, but you'd be
> responsible for juggling all the animation and state information.
> Again, transitions would be difficult, i.e. Up to Down plays this
> animation, but Up to Over plays this animation (or whatever
> transitions make sense).
>
> If you wanted to keep things as "high level" as possible, by which I
> mean doing it declaratively in MXML, you'd probably end up just
> skipping a subclass of mx:Button and instead subclass mx:Canvas and
> use effects/behaviors.
>
> Troy.
>
> 
>

Reply via email to