Skip to content

Instantly share code, notes, and snippets.

@PDeveloper
Created December 5, 2013 20:57
Show Gist options
  • Save PDeveloper/7813754 to your computer and use it in GitHub Desktop.
Save PDeveloper/7813754 to your computer and use it in GitHub Desktop.
Setup with assets that come with the Demo sample. On Neko and Cpp, button rollover button states don't work!
package ;
import flash.display.Sprite;
import flash.events.Event;
import flash.Lib;
import ru.stablex.ui.UIBuilder;
import ru.stablex.ui.widgets.Button;
import ru.stablex.ui.widgets.Floating;
/**
* ...
* @author P Svilans
*/
class Main extends Sprite
{
var inited:Bool;
function init()
{
if (inited) return;
inited = true;
//initialize StablexUI
UIBuilder.init( 'ui/android/defaults.xml' );
//register skins
UIBuilder.regSkins( 'ui/android/skins.xml' );
//UIBuilder.buildFn( 'ui/example.xml' )().show();
var floating = UIBuilder.create( Floating, {
children : [
UIBuilder.create( Button, {
text : "this is a button!"
})
]
});
floating.show();
}
/* SETUP */
public function new()
{
super();
addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(e)
{
removeEventListener(Event.ADDED_TO_STAGE, added);
init();
}
public static function main()
{
// static entry point
Lib.current.stage.align = flash.display.StageAlign.TOP_LEFT;
Lib.current.stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
Lib.current.addChild(new Main());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment