Skip to content

Instantly share code, notes, and snippets.

@jbuda
Created March 19, 2013 13:41
Show Gist options
  • Save jbuda/5196175 to your computer and use it in GitHub Desktop.
Save jbuda/5196175 to your computer and use it in GitHub Desktop.
ProgressBarModel.as
package com.progressbar.views.model {
import com.progressbar.events.ProgressBarEvent;
import com.progressbar.views.ProgressBar;
import flash.events.IEventDispatcher;
[Bindable]
public class ProgressBarModel {
private var _bytesTotal:int = 0;
private var _bytesLoaded:int = 0;
public var dispatcher:IEventDispatcher;
public function get bytesLoaded():int {
return _bytesLoaded;
}
public function set bytesLoaded(value:int):void {
_bytesLoaded = value;
}
public function get bytesTotal():int {
return _bytesTotal;
}
public function set bytesTotal(value:int):void {
_bytesTotal = value;
}
public function increment():void {
var event:ProgressBarEvent = new ProgressBarEvent(ProgressBarEvent.INCREASE);
dispatcher.dispatchEvent(event);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment