Skip to content

Instantly share code, notes, and snippets.

@netoleal
Created November 22, 2011 21:27
Show Gist options
  • Save netoleal/1387029 to your computer and use it in GitHub Desktop.
Save netoleal/1387029 to your computer and use it in GitHub Desktop.
Exemplo de uso de Flow
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