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

Wonderfl で Diff1 を防ぐ簡単な方法

stage3D を使うだけ
Get Adobe Flash player
by bkzen 02 Apr 2012

    Talk

    bkzen at 02 Apr 2012 16:33
    wmode が引き継がれないことを利用して、ある程度は防げるはず。 カヤックさん何とかしてw

    Tags

    Embed
/**
 * Copyright bkzen ( http://wonderfl.net/user/bkzen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/bLq5
 */

package  
{
    import flash.display.Sprite;
    import flash.events.Event;
    
    /**
     * Wonderfl で Diff1 を防ぐ簡単な方法
     * @author jc at bk-zen.com
     */
    public class Test87 extends Sprite 
    {
        
        public function Test87() 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }
        
        private function init(e: Event = null): void 
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            //
            stage.stage3Ds[0].addEventListener(Event.CONTEXT3D_CREATE, _init);
            stage.stage3Ds[0].requestContext3D();
        }
        
        private function _init(e:Event):void 
        {
            if (!stage.stage3Ds[0].context3D)
                return;
            // ここから書き始める。
            graphics.beginFill(0x006699);
            graphics.drawRect(0, 0, 100, 100);
            
        }
        
    }

}