Compartilhar via


Create simple animation

You can animate any visual element in Microsoft Expression Blend as follows.

To create a simple animation

  1. In Expression Blend, open or create a new project. For more information, see Create a new document or project.

  2. Press F6 to switch to the Animation workspace. (F6 will switch between the Design Workspace and the Animation Workspace. In the Animation Workspace, the Interaction panel is under the artboard.) Create any objects that you plan to animate.

    Tip

    Object refers to an item on the artboard in Expression Blend. For example, when you select the Rectangle tool Cc294948.81ffc148-cf5c-4faf-bd3f-f38d3073a12c(en-us,Expression.10).png from the Toolbox and draw a rectangle on the artboard, you create a rectangle object. For more information about objects and controls, see Working with objects and properties and Controls.

  3. Under Objects and Timeline, click the New Cc294948.86937695-03dd-44ea-aa30-28d4029b3ad0(en-us,Expression.10).png button.

    The Create Storyboard Resource dialog box appears.

  4. In the Resource name (Key) field, type a name for the timeline, and then click OK. Expression Blend enters timeline recording mode with the playhead Cc294948.5626c9eb-40bb-450a-9ca1-3678e5abe429(en-us,Expression.10).png at the 0-second mark. When in recording mode, any property that you set will automatically record a keyframe on the timeline.

    Tip

    By default, any new storyboard created in the root of your document will cause an event trigger to be added under Triggers for the Window.Loaded event. This trigger causes your storyboard to begin as soon as your application starts. If you want to create some simple interactivity, you can select the event trigger, and then modify it (in the lower half of the Triggers pane) to specify the following:

    When object .PreviewMouseDown is raised

    Where object is the name of an object in your application. (The object must be selected for it to appear in the lower half of the Triggers pane when you modify the trigger.) This causes your animation timeline to begin when you click the object.

  5. Under Objectsand Timeline, select the object that you want to animate.

  6. If you want the selected object to start at its current position and appearance, click the Record Keyframe button Cc294948.de094a9c-58f2-4466-912a-9bdc18362548(en-us,Expression.10).png to record the object at the 0-second mark. A keyframe Cc294948.80da70bb-e635-42e8-b26d-f90453096e21(en-us,Expression.10).png appears on the timeline in the row that corresponds to the selected object.

  7. Under Objects and Timeline, drag the playhead to the point in time where the animation should finish.

  8. If you want your object to look the same at the end of the animation as it does at the start of the animation, click the Record Keyframe button.

  9. Move the playhead to a location in the timeline where you want a property change to occur.

  10. Change a property of the selected object, such as the position, color, or size of the object. A keyframe automatically appears on the timeline to record the property change.

    Tip

    You can view the individual property keyframes by expanding the node for your object. This is useful if you want to move a keyframe for an individual property instead of for the whole object.

  11. To see the animation that you just created, click the Play button at the top of Objects and Timeline.

    Tip

    To exit timeline recording mode, click the Close Storyboard button Cc294948.4c066464-3a41-452d-b2e9-e95f6c5659ff(en-us,Expression.10).png to return to the initial state of all objects in the current scope.

See also

Concepts

Test a storyboard

Controlling when your storyboard runs

Try it: Playing with handoff and nonhandoff animations