Created
January 10, 2011 22:52
-
-
Save odoe/773635 to your computer and use it in GitHub Desktop.
A skinnable container component for Flex 4, used with ESRI Map.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lacsd.sf.view.components | |
{ | |
import com.esri.ags.Map; | |
import flash.events.Event; | |
import mx.states.State; | |
import spark.components.SkinnableContainer; | |
[SkinState("collapsed")] | |
[SkinState("expanded")] | |
[Event(name="mapChange",type="flash.events.Event")] | |
public class CollapseContainer extends SkinnableContainer | |
{ | |
public static const MAP_CHANGE_EVENT:String = "mapChange"; | |
private var _map:Map; | |
[Bindable(event="mapChange")] | |
public function get map():Map | |
{ | |
return _map; | |
} | |
public function set map(value:Map):void | |
{ | |
if (_map != value) | |
{ | |
_map = value; | |
dispatchEvent(new Event(MAP_CHANGE_EVENT)); | |
} | |
} | |
override public function initialize():void | |
{ | |
super.initialize(); | |
states.push(new State({name:"collapsed"})); | |
states.push(new State({name:"expanded"})); | |
} | |
override protected function stateChanged(oldState:String, newState:String, recursive:Boolean):void | |
{ | |
super.stateChanged(oldState, newState, recursive); | |
invalidateSkinState(); | |
} | |
override protected function getCurrentSkinState():String | |
{ | |
return currentState; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment