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

フレームベースでトゥイーンさせる

image: http://www.thenounproject.com/
Get Adobe Flash player
by shohei909 23 Jan 2011
/**
 * Copyright shohei909 ( http://wonderfl.net/user/shohei909 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/59N8
 */

//image: http://www.thenounproject.com/
package {
    import flash.events.Event;
    import flash.display.Sprite;
    import frocessing.shape.FShapeSVG;
    import com.bit101.components.*;
    import org.libspark.ukiuki.Ukiuki;
    import org.libspark.ukiuki.ease.*;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            this.addEventListener( Event.ADDED_TO_STAGE, init );
        }
        
        private function init( e:Event ):void{
            new FPSMeter( this, 10, 5 )
            var slide:HUISlider = new HUISlider( this, 0, 20, "", onChange );
            slide.value = 30;
            slide.width = 140;
            slide.minimum = 5;
            slide.maximum = 60;
            
            var shape:Sprite = new FShapeSVG( SVG_DATA ).toSprite()
            shape.x = (465 - shape.width) / 2;
            addChild( shape );
            
            Ukiuki.synchro = stage;
            Ukiuki.yoyo( shape, { y:465-shape.height }, { time:60, ease:Quint.IN_OUT, repeat:-1, intervals:[10,30] } )
        }
        
        private function onChange( e:Event ):void{
            stage.frameRate = e.target.value;
        }
    }
}

const SVG_DATA:XML = 
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="61.091px" height="100px" viewBox="0 0 61.091 100" enable-background="new 0 0 61.091 100" xml:space="preserve">
    <path d="M48.144,73.858h-3.791v14.574c0.026,2.581,3.794,2.581,3.791,0V73.858L48.144,73.858z"/>
    <path d="M43.812,73.858h-3.791v14.574c0.016,2.562,3.783,2.562,3.791,0V73.858L43.812,73.858z"/>
    <path d="M34.606,73.858h-3.791v14.574c0.024,2.581,3.793,2.581,3.791,0V73.858L34.606,73.858z"/>
    <path d="M30.273,73.858h-3.789v14.574c0.015,2.562,3.783,2.562,3.789,0V73.858L30.273,73.858z"/>
    <path d="M21.068,73.858h-3.791v14.574c0.023,2.581,3.793,2.581,3.791,0V73.858L21.068,73.858z"/>
    <path d="M16.736,73.858h-3.79v14.574c0.014,2.562,3.784,2.562,3.79,0V73.858L16.736,73.858z"/>
    <path d="M52.97,39.006H8.17c-4.74,0.018-8.169,3.723-8.17,8.172v44.747c-0.009,4.543,3.688,8.091,8.17,8.075h44.847c4.462,0.016,8.101-3.327,8.073-8.075V47.178C61.108,42.675,57.529,39.023,52.97,39.006z M52.672,91.532H8.417V47.571h44.254V91.532z"/>
    <path d="M41.597,4.4c-0.038-5.833,8.423-5.9,8.467,0l-0.147,17.771l4.579-5.561c3.136-3.47,8.662,1.335,5.266,5.216L48.733,34.968c-1.768,1.759-4.033,1.748-5.759,0L31.998,21.776c-3.428-3.88,2.149-8.74,5.216-5.218l4.53,5.613L41.597,4.4L41.597,4.4z"/>
    <path d="M10.878,31.917c-0.036,5.846,8.425,5.913,8.467,0l-0.097-17.771l4.529,5.611c3.138,3.434,8.664-1.373,5.267-5.266L18.017,1.347c-1.766-1.744-4.033-1.733-5.759,0L1.279,14.541c-3.425,3.893,2.152,8.753,5.219,5.266l4.529-5.661L10.878,31.917L10.878,31.917z"/>
    <path d="M50.558,72.776c0.011,0.872-0.706,1.491-1.479,1.479c0,0-9.907,0.013-9.944,0c-0.753,0.013-1.481-0.615-1.476-1.479V61.995c-0.006-1.234,0.983-2.08,2.067-2.067c-0.014-0.013,8.761,0,8.761,0c1.186-0.013,2.081,0.928,2.07,2.067V72.776L50.558,72.776z"/>
    <path d="M44.156,59.043c1.552,0,2.817-1.267,2.806-2.808c0.012-1.584-1.254-2.851-2.806-2.854c-1.57,0.004-2.838,1.271-2.854,2.854C41.318,57.776,42.586,59.043,44.156,59.043L44.156,59.043z"/>
    <path d="M44.156,56.235"/>
    <path d="M37.018,72.776c0.014,0.872-0.705,1.491-1.476,1.479c0,0-9.907,0.013-9.944,0c-0.754,0.013-1.481-0.615-1.477-1.479V61.995c-0.005-1.234,0.984-2.08,2.067-2.067c-0.012-0.013,8.762,0,8.762,0c1.184-0.013,2.081,0.928,2.067,2.067V72.776L37.018,72.776z"/>
    <path d="M30.619,59.043c1.551,0,2.818-1.267,2.806-2.808c0.013-1.584-1.255-2.851-2.806-2.854c-1.571,0.004-2.838,1.271-2.856,2.854C27.781,57.776,29.048,59.043,30.619,59.043L30.619,59.043z"/>
    <path d="M30.619,56.235"/>
    <path d="M23.48,72.776c0.013,0.872-0.705,1.491-1.476,1.479c0,0-9.907,0.013-9.943,0c-0.755,0.013-1.483-0.615-1.478-1.479V61.995c-0.006-1.234,0.984-2.08,2.068-2.067c-0.013-0.013,8.762,0,8.762,0c1.183-0.013,2.08,0.928,2.067,2.067V72.776L23.48,72.776z"/>
    <path d="M17.081,59.043c1.553,0,2.818-1.267,2.807-2.808c0.011-1.584-1.254-2.851-2.807-2.854c-1.572,0.004-2.837,1.271-2.854,2.854C14.243,57.776,15.509,59.043,17.081,59.043L17.081,59.043z"/>
    <path d="M17.081,56.235"/>
</svg>