In Adobe Flash Catalyst the states concept is really important but a little bit hard to understand immediately, let’s try to catch the sense of it together.
With this new Adobe tool for designer, working on Rich Interactive Applications will be a lot easier and the cooperation with developers will be as close as it has never been before. The software interface is not the final one, the version available now is a beta, but still we can use many functionalities. Flash Catalyst is different from other Adobe design tools, maybe who use Flash will be familiar with the general approach.
The states in Flash Catalyst are referred to Pages and to elements inside a page and they represent different views of the application. We navigate between different states but in the same way they can be referred also to a component, for instance a button has state such as Up, Over, Down, and Disabled.
In the interface the right side is dedicated to tools and panels as Libraries, Layers and Properties, up to the stage there are indications about pages, components and states.
I created a very simple application as an example that has two pages Start and End, where you can click on a button “click here” to switch to different states/pages.
In Flash Catalyst interface you can find the states also on the left side of the Timeline. Here you find the States transitions panel, remember that in this tools transitions are taken as separate parts of the entire navigation, this means that you must put properties thinking of a "round trip".
When you double click on components their states are displayed on the same part where the pages/elements are and this can be a little bit tricky, maybe the component state should be represented in a different way, graphically speaking. Anyway as in Flash, we can always go back to the previous element using the menu up on the left side of the stage.
We can say that the states represent the condition/status of pages and components, more generally the concept indicate what an element is doing before and when users interact with it.
It’s also possible to manual control panels on a container, like tile or cascade all panels. To do this we need to use the DashLayoutManager, a multiTon class that maps containers trough container id’s.
To use the DashLayoutManager of a specific container you have to reference to it trough the id:
Manual control panels ( minimize, maximize, restore )
Now let’s see how to control every panel programmatically, to maximize, minimize and restore its. To do this we have to use the DashPanelEvent class. So we don’t have any api to control, but we must use events.
First define the event:
Maximize:
var minimizeEvent:DashPanelEvent = newDashPanelEvent( DashPanelEvent.MINIMIZE, myPanel );
Minimize:
var maximizeEvent:DashPanelEvent = newDashPanelEvent( DashPanelEvent.MAXIMIZE, myPanel );
Restore:
var restoreEvent:DashPanelEvent = newDashPanelEvent( DashPanelEvent.RESTORE, myPanel );
<mx:Label text="Minimize, maximize and restore me!" />
</mx:VBox>
</components:DashPanel>
</components:DashPanelContainer>
</mx:Application>
Listen containers change
The Pantaste dash container ( DashPanelContainer class ), propagate an event to inform you that something happened. Information that you can obtain is about panels and this is the type:
Added to the container
Removed from the container
Maximized
Minimized
Restored
Moved
All we have to do is listening on the “pantasteChanged” event defined by the DashPanelContainerEvent class. This class will provide to us the changedTypeEvent, the panel caused the change and the container were is placed.
This page contains all entries posted to Comtaste Consulting | Enterprise RIA consulting and development in June 2009. They are listed from oldest to newest.