wondertflでコンポーネントを使うサンプル
ボタンやチェックボックスなどの
コンポーネントを使う際のサンプル。
com.bit101.components.*の本家にあったので、真似してみたよ。
ネタ元:http://www.bit-101.com/minimalcomps/
詳細ドキュメント:
http://www.minimalcomps.com/documentation/com/bit101/components/package-detail.html
/**
* Copyright satoru.net ( http://wonderfl.net/user/satoru.net )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/zZqY
*/
package {
import com.bit101.components.*;
import flash.display.*;
import flash.events.*;
public class main extends Sprite{
private var _angle:Number = 0;
private var _progressBar:ProgressBar;
public function main(){
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var panel:* = new Panel(this, stage.stageWidth / 4, stage.stageHeight / 8);
panel.setSize(stage.stageWidth / 2, stage.stageHeight * 3 / 4);
var textArea:* = new TextArea(panel.content, 95, 160);
textArea.setSize(95, 90);
new CheckBox(panel.content, 20, 20, "Check this!");
new Label(panel.content, 20, 40, "I am a label");
new PushButton(panel.content, 20, 60, "Click me!",function():void{ textArea.text += "hoge" });
new HSlider(panel.content, 20, 90);
var slider:* = new VSlider(panel.content, 130, 20);
slider.backClick = true;
new InputText(panel.content, 20, 110, "Type something");
_progressBar = new ProgressBar(panel.content, 20, 140);
new RadioButton(panel.content, 20, 160, "Option 1", true);
new RadioButton(panel.content, 20, 180, "Option 2");
new RadioButton(panel.content, 20, 200, "Option 3");
new ColorChooser(panel.content, 20, 230, 16711935);
new VUISlider(panel.content, 150, 10, "VUISlider");
new HUISlider(panel.content, 20, 260, "HUISlider");
addEventListener(Event.ENTER_FRAME, onEnterFrame);
return;
}
private function onEnterFrame(Boolean:Event) : void{
_progressBar.value = _progressBar.value + 0.005;
if (_progressBar.value >= _progressBar.maximum)
{
_progressBar.value = 0;
}
return;
}
}
}