In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

lineStyle

Get Adobe Flash player
by k3lab 04 Apr 2011
    Embed
/**
 * Copyright k3lab ( http://wonderfl.net/user/k3lab )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/cnrm
 */

package 
{
    import com.bit101.components.HUISlider;
    import flash.display.Sprite;
    import flash.events.Event;
    
    /**
     * ...
     * @author k3lab
     */
    public class Main extends Sprite 
    {
        [SWF(framerate="60",width="465", height="465", backgroundColor="0x000000")]
        public function Main():void 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }
        private var rect:Sprite
        private var wSlider:HUISlider
        private var hSlider:HUISlider
        private var tSlider:HUISlider
        private function init(e:Event = null):void 
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            wSlider = new HUISlider(this, 10, 10, "width");
            wSlider.maximum = 200;
            wSlider.minimum = 0;
            wSlider.value = 50;
            hSlider = new HUISlider(this, 10, 30, "height");
            hSlider.maximum = 200;
            hSlider.minimum = 0;
            hSlider.value = 5;
            tSlider = new HUISlider(this, 10, 50, "value");
            tSlider.maximum = 10
            tSlider.minimum = 0;
            tSlider.value = 1;
            rect = addChild(new Sprite()) as Sprite;
            rect.x = stage.stageWidth / 2;
            rect.y = stage.stageHeight / 2;
            addEventListener(Event.ENTER_FRAME,loop);
        }
        private function loop(e:Event):void {
            rect.graphics.clear();
            rect.graphics.lineStyle(0xcc);
            rect.graphics.drawRect(0,0, wSlider.value, hSlider.value);
            rect.graphics.endFill();
            
            rect.rotation += tSlider.value;
        }
        
    }
    
}