Created
November 22, 2011 21:27
-
-
Save netoleal/1387029 to your computer and use it in GitHub Desktop.
Exemplo de uso de Flow
This file contains hidden or 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
import asf.events.FlowEvent; | |
import asf.flow.LoadShowFlow; | |
import asf.interfaces.ISequence; | |
flow = new LoadShowFlow( app.navigation, true ); | |
flow.addEventListener( FlowEvent.SHOW_LOADING, onFlowShowLoading ); | |
flow.addEventListener( FlowEvent.HIDE_LOADING, onFlowHideLoading ); | |
flow.addEventListener( DependenciesProgressEvent.LOAD_PROGRESS, onSectionLoadProgress ); | |
private function onFlowHideLoading(event:FlowEvent):void | |
{ | |
loading.close( ).queue( flow.resumeCurrentLoading ); | |
} | |
private function onFlowShowLoading(event:FlowEvent):void | |
{ | |
showLoading( ).queue( flow.resumeCurrentLoading ); | |
} | |
private function onSectionLoadProgress(event:DependenciesProgressEvent):void | |
{ | |
loading.setProgress( event.bytesLoaded / event.bytesTotal ); | |
} | |
private function showLoading( ):ISequence | |
{ | |
loading.setProgress( 0 ); | |
return loading.open( ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment