- Home
- Articles
- Product Reviews
- Creating widgets fast and easily with SPAS 3.0
Creating widgets fast and easily with SPAS 3.0
By Pascal ECHEMANN
|
Published December 12, 2008
|
Product Reviews , Flex , Intermediate , Flash , Tutorials
|
Unrated

Addenda (12/20/2008)
Pascal ECHEMANN
I'm an ActionScript developer in the French Riviera.I've created the Swing Package for ActionScript 3.0 (SPAS 3.0) which helps Flash developers to easily create RIAs with the Flash Platform and both Flash and Flex:
http://www.flashapi.org/ View all articles by Pascal ECHEMANN
package {
import org.flashapi.swing.*;
import org.flashapi.swing.event.*;
import org.flashapi.swing.plaf.spas.*;
public class CelsiusConverter extends Popup {
public function CelsiusConverter() {
super("Convert Celsius to Fahrenheit", 250);
initialize();
}
private var _result:Label;
private var _input:TextInput;
private function initialize():void {
setLaf(SpasWindowUI);
autoHeight = true;
padding = horizontalGap = verticalGap = 10;
_input = new TextInput("0");
_input.maxChars = 5;
_input.restrict = "0-9";
_result = new Label("fahrenheit");
var _btn = new Button("Convert", _input.width);
_btn.setLaf(SpasButtonUI);
var celsiusLabel:Label = new Label("celsius");
addGraphicElements(_input, celsiusLabel, _btn, _result);
eventCollector.addEvent(_btn, UIMouseEvent.CLICK, convertTemp);
}
private function convertTemp(event:UIMouseEvent):void {
var temp:Number = Number(_input.label);
_result.label = String(temp * 1.8 + 32) + " fahrenheit";
}
}
}

