locked
Buttons in blend RRS feed

  • Question

  •  

    Hi Guys

    I've asked in other threads but no one seems to either know or answer so I thought I would start my own thread

    I'm new to blend and come from the world of flash.

    I don't code so i'm trying to do everything with blend and one major thing i'm having problems with are buttons.

    I have designed my own graphics and animated the press state on the storyboard. I added a trigger to play the animation when mouse down but does anyone know the best way to animate the button out when the user presses again?

    I'm designing for touch screen so the person needs to select the button once to select the button (turns green) and then press it again to deselect (returns to its original state)

    Are there any tutorials around that I can't find for stuff like this (I found one for triggering the animation but nothing for doing further animation once the button is pressed)

    Hope someone can help

    Many thanks guys :)

    Tuesday, June 24, 2008 8:19 AM

All replies

  • Since the June preview of Expression Blend provides a Visual State Manager that is designer to solve exactly this problem, you should consider upgrading to this (free) Blend version. It gives you an interface to create the states for your button based on Normal State vector graphics.

    This doesn't necessarily mean that you can easily change and animate to a different graphic if you already have one. The VSM is meant to be used like making an animation: changing the properties in de properties tab for a specific change in looks in another state.

    It might be interesting to see what happens when you remove the vector graphics for the first button state and replace them by the graphics for the second button state. I guess that it won't give you the results you want. So either you can uses the properties tab the recreate te second state or you can dive into the XAML code and replace de graphics in the specific Visual State for the XAML of your own objects.

    Every animation has a Completed Event that allows you to start a different animation if you like...

    BTW: Pressing a button to DEselect it doesn't seem like a intuitive thing to do. You might build your buttons as RadioButtons so only one button in the group is selected at a time and the other buttons get deselected an returned to their previous state automagically ;)

    Tuesday, June 24, 2008 3:46 PM
  • AntoniDol said:

    Every animation has a Completed Event that allows you to start a different animation if you like...

    BTW: Pressing a button to DEselect it doesn't seem like a intuitive thing to do. You might build your buttons as RadioButtons so only one button in the group is selected at a time and the other buttons get deselected an returned to their previous state automagically ;)


    Well im finding it really hard to get my head around the events and animation with blend. I from a very basic level of Flash where you go along the timeline and you can put some code in at any point that will jump to frames etc.

    I need to be able to start the animation and a new animation will play if i press that button again but im finding it very hard to do. Only way ive found so far is to have two buttons, when one is pressed the other one becomes visable and the new code is attached to that.

    Also with the screen im building, I will have a series of buttons and all can be selected and deselected at the same time. It's going to be a multiple choice question and the user can select and deselect a series of answers.
    Wednesday, June 25, 2008 2:05 PM
  • The best way to do this would be to record a number of the animation states.  You can then play various animations to various state points, and have a flag to record the current state of the button.

    Remember to check for if the animation is already playing and don't re-fire the animation in this instance.

    Hope this helps.
    Matthew Christopher
    Thursday, October 8, 2009 8:19 PM