Feathers Extension Toaster 1.0.1


The Toaster control provides simple feedback about an operation in a small popup.

Download project, swc, and samples on GitHub

Documentation





To compile this sample download the Feathers SDK (Manager)

Main.mxml

<f:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:f="library://ns.feathersui.com/mxml"
    theme="feathers.extensions.themes.MetalWorksDesktopTheme"
    xmlns:components="feathers.extensions.toaster.*">

        <f:layout>
            <f:VerticalLayout/>
        </f:layout>

        <f:Button label="toaster" triggered="button_triggeredHandler(event)"/>

    <fx:Script>
        <![CDATA[
            import feathers.extensions.toaster.Toaster;
            import feathers.extensions.toaster.CustomToaster;

            private var toaster:Toaster = new Toaster(this);

            private function button_triggeredHandler( event:Event ):void
            {
                toaster.toasterRenderer = components.CustomToaster;
                //toaster.delay = 2;
                var customToaster:CustomToaster = toaster.open( "some text" ) as CustomToaster;
                //customToaster.isCentered = true;
                toaster.moveTo( customToaster, 50, 50 );

                /*var image:Image = new Image( texture );
                image.scale9Grid = new Rectangle( 20, 20, fileTexture.width - 20 * 2, fileTexture.height - 20 * 2 );
                customToaster.backgroundSkin = image;*/

            }
        ]]>
    </fx:Script>
</f:Application>

components/CustomToaster.mxml

<components:DefaultToaster xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:f="library://ns.feathersui.com/mxml"
    xmlns:components="feathers.extensions.toaster.*">

    <fx:Script>
        <![CDATA[
            private var _text:String = "";
            public function get text():String
            {
                return this._text;
            }
            public function set text(value:String):void
            {
                this._text = value;
                toaster.text = value;
            }
        ]]>
    </fx:Script>

    <f:Label id="toaster"/>
</components:DefaultToaster>

0 comment

Name :


Email (not published) :


Comment :

Allowed markup: [html]