Tag Archives: state

Hiding specific items in a data provider based on the current application state in Flex Gumbo

The following example shows how you can toggle specific strings based on the Flex Gumbo application’s current state by using the includeIn and excludeFrom attributes on the String object.

For more information see “Exploring the new states syntax in Flex Gumbo” and the “Enhanced States Syntax – Functional and Design Specification” page at opensource.adobe.com.

Full code after the jump.

Continue reading

Determining a VideoDisplay control’s current playback state using the state property and stateChange event

The following example shows how you can listen for stateChange events on a Flex VideoDisplay control to display the video’s current state in a ProgressBar control, List control, or just perform specific actions if a certain state is entered. It also shows how you can use a ProgressBar control to display the amount of video that has already been played, and how much is still remaining by listening for the playheadUpdate event and passing the VideoEvent class’s playheadTime property, and VideoDisplay class’s totalTime property to the ProgressBar class’s setProgress() method.

Full code after the jump.

Continue reading

Toggling a Flex container’s visibility using states

In a previous post, “Toggling a Flex container’s visibility”, we looked at toggling a VBox container’s visibility by setting both the visible property and includeInLayout property. While the approach felt a little crude, we can build the same thing using the much more powerful view states. What are view states and how do we use them? Well, if you’re new to states, this should clear everything up: “Adobe – Flex Quick Start Basics: Creating States”.

Now, with that out of the way, lets look at some code and a basic example.

Full code after the jump.

Continue reading