Home > Hello-Starling

Hello-Starling

Hello-Starling is a project mainly written in ACTIONSCRIPT and JAVASCRIPT, it's free.

Demos of Starling Framework.

h2. Hello Starling

Demos of "Starling Framework":http://www.starling-framework.org/.

h3. Why it

  • You can see all demos in one application based on "XFace":https://github.com/eidiot/xface.
  • You can view all source code in one project code base and edit it for trying easily.
  • You can add your demos or code pieces for studying easily too.

h3. NOTE

  • Add "-swf-version=13" to your Compiler Arguments.
  • Run "bin/HelloStarling.html" instead of "bin/HelloStarling.swf".

h3. Demos

  • Official demos ** "http://www.starling-framework.org/demo/index.html":http://www.starling-framework.org/demo/index.html
  • Demos from James Li ** "http://jamesli.cn/blog/?p=1140":http://jamesli.cn/blog/?p=1140

h3. Add your own code

h4. Create your own demo

package starling_demos
{
    public class YourDemo extends StarlingDemoBase
    {
        [Test]
        public function test():void
        {
            // Your demo code here.
        }
    }
}

StarlingDemoBase injected an Starling instance and root container for you, you can free your demo class from extending it by injecting them yourself if needed.

package starling_demos
{
    import starling.core.Starling;
    import starling.display.DisplayObject;
    import starling.display.DisplayObjectContainer;
public class StarlingDemoBase
{
    [Inject]
    public var root:DisplayObjectContainer;
    [Inject]
    public var starling:Starling;

    protected function display(child:DisplayObject, x:Number = 0, y:Number = 0):void
    {
        child.x = x;
        child.y = y;
        root.addChild(child);
    }
}

}

h4. Add your demo to demo suite class

package starling_demos
{
    import starling_demos.jamesli.JamesliDemos;
    import starling_demos.official.OfficialDemos;
[Suite]
public class AllStarlingDemos
{
    public static function suite():Array
    {
        return [

            YourDemo, 

            JamesliDemos,
            OfficialDemos,
        ];
    }
}

}

Previous:Dock