programming4us
 
Graphics
 

Adobe Flash Catalyst CS5 : Trigger View State Changes with Buttons

5/24/2013 7:42:00 PM

In order to allow your user to move from one state to the next, you need to add an interaction to an element in the application. Almost any component can be used for this interaction, but the most commonly used one will be a button.

1. Create the interaction

Creating the interaction on a button is very straight-forward, as buttons are designed for interaction. In the following steps, you will add the ability for the user to click the Place Order button in the Home State to be taken to the Subscription State.

  1. In the main application's HomeState, double click the component on the page and then click the Place Order button (see Figure 1).

    Figure 1. Selecting the Place Order button
  2. If necessary, expand the Interactions panel by double-clicking its tab (see Figure 2).

    Figure 2. The Interactions panel
  3. Click Add Interaction.

  4. Ensure that the first drop-down list is set to On Click, and the second to Play Transition to State.

  5. From the Choose State menu, select SubscriptionState (see Figure 3).

  6. Click OK. The interaction has now been added to the button (see Figure 4). When run through Flash Player, the application will allow users to click the button and trigger the state change.

Figure 4. Creating an interaction to transition to another state

Figure 5. The completed interaction

2. Test the interaction

After you create an interaction to trigger a state change, you can test it by running the project. Follow these steps:

  1. Choose File => Save. It is not required that you save the project before running it, but it is highly recommended.

  2. Click File => Run Project (see Figure 6). Catalyst will build the project — which may take a minute or so, depending on the speed of your computer — and then open it in Flash Player.

  3. Click the Purchase Now button. The project will change to show the Subscription state. The transition to the state will be instantaneous.

Later in this chapter, I will discuss adding animation to the state change. Also, keep in mind that there is nothing in this application to validate that the form on the home page be filled out before moving to the subscription state.

In a real application, you would want to add the necessary code to implement validation. You would need to add this code in Flash Builder; however, that is not something currently supported by Catalyst.

Figure 6. Running the project from the File menu
 
Others
 
- Adobe Flash Catalyst CS5 : Components with Built-in View States
- Adobe Flash Catalyst CS5 : Create New States within a Component
- Adobe After Effects CS5 : Animating Text - Adding motion blur, Exporting to Adobe Flash Professional CS5
- Adobe After Effects CS5 : Animating Text - Animating a nontext layer along a motion path
- Adobe After Effects CS5 : Animating Text - Cleaning up the path animation
- Adobe Fireworks CS5 : Working with Vector Graphics - Drawing the shape
- Adobe Fireworks CS5 : Working with Vector Graphics - Editing paths
- Adobe Flash Professional CS5 : Working Within the Flash Environment - Docking and Undocking Panels, Grouping and Ungrouping Panels
- Adobe Flash Professional CS5 : Working Within the Flash Environment - Working with Panels
- Adobe Flash Professional CS5 : Working Within the Flash Environment - Using the Tools Panel
 
 
REVIEW
 
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- Sigma 24mm f/1.4 DG HSM Art

- Canon EF11-24mm f/4L USM

- Creative Sound Blaster Roar 2

- Alienware 17 - Dell's Alienware laptops

- Smartwatch : Wellograph

- Xiaomi Redmi 2
 
VIDEO TUTORIAL
 
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
 
Top 10
 
- How To Install Android Market & Google Apps On Kindle Fire
- How To Make Ubuntu Look Like Windows 7
- How To Add A New Account in MS Outlook 2013
- Get Android & Mac OS X Style Gadgets For Windows 7 & Windows 8 With XWidget
- How To Activate Microsoft Office 2013
- How To Install Actual Facebook App On Kindle Fire
- How To Create, View And Edit Microsoft Office Files On Kindle Fire
- Download Attractive Business PowerPoint Templates For Free At SlideHunter
- How To Use And Enable Hibernate & Sleep Mode In Windows 8
- How To Get Microsoft Office 2013 Trial Product Key From Microsoft