1  /**
     2   * com.sekati.demo.ImageBox
     3   * @version 1.0.0
     4   * @author jason m horwitz | sekati.com
     5   * Copyright (C) 2007  jason m horwitz, Sekat LLC. All Rights Reserved.
     6   * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
     7   */
     8  
     9  import com.sekati.core.App;
    10  import com.sekati.utils.Delegate;
    11  import com.sekati.display.CoreClip;
    12  
    13  /**
    14   * ImageBox demo implementation of {@link com.sekati.ui.Image}
    15   */
    16  class com.project.ui.ImageBox extends CoreClip {
    17  
    18  	public var _img:MovieClip;
    19  	public var _btn0:MovieClip;
    20  	public var _btn1:MovieClip;
    21  	public var _btn2:MovieClip;
    22  
    23  	// constructor
    24  	private function ImageBox() {
    25  	}
    26  
    27  	public function configUI():Void {
    28  		_img = _this.img;
    29  		_btn0 = _this.btn0;
    30  		_btn1 = _this.btn1;
    31  		_btn2 = _this.btn2;
    32  		// setup
    33  		App.bc.subscribe( _this );
    34  		// button setup and events
    35  		_btn0.tf.text = "image 1";
    36  		_btn1.tf.text = "image 2";
    37  		_btn2.tf.text = "image 3";
    38  		_btn0.onRelease = Delegate.create( _this, btn0_onRelease );
    39  		_btn1.onRelease = Delegate.create( _this, btn1_onRelease );
    40  		_btn2.onRelease = Delegate.create( _this, btn2_onRelease );
    41  	}
    42  
    43  	private function onAppConfigured():Void {
    44  		App.log.trace( this, "* initializing ImageBox" );
    45  		btn0_onRelease( );
    46  	}
    47  
    48  	private function btn0_onRelease():Void {
    49  		_img.load( App.db.data.img_1.data, 300, 225, 0x333333, 0x666666, 75, true );
    50  	}
    51  
    52  	private function btn1_onRelease():Void {
    53  		_img.load( App.db.data.img_2.data, 300, 225, 0xFF00FF, 0xFFCCFF, 75, true );
    54  	}
    55  
    56  	private function btn2_onRelease():Void {
    57  		_img.load( App.db.data.img_3.data, 300, 225, 0xFFFF00, 0xFF9900, 75, true );
    58  	}
    59  }