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

forked from: ApplicationDomain.currentDomain isn't ApplicationDomain.currentDomain !

Get Adobe Flash player
by 9re 15 Jul 2010
    Embed
/**
 * Copyright 9re ( http://wonderfl.net/user/9re )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/nfXY
 */

// forked from imajuk's ApplicationDomain.currentDomain isn't ApplicationDomain.currentDomain !
package {
    import flash.display.Sprite;
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.system.ApplicationDomain;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            /**
             * ApplicationDomain.currentDomain って
             * まともに動いてます ?
             */
            var output:XML = 
                <html>
                    <p><font size='12'><u>ApplicationDomain.currentDomain doesn't work ??</u></font></p><br/>
                    <p>
                        <b>(loaderInfo.applicationDomain == ApplicationDomain.currentDomain)</b><br/>
                            should&nbsp;be&nbsp;<b>true</b>&nbsp;but&nbsp;actually&nbsp; 
                        <b>{(loaderInfo.applicationDomain == ApplicationDomain.currentDomain)}</b>
                    </p>
                    <br/>
                    <p>
                        <b>(ApplicationDomain.currentDomain == ApplicationDomain.currentDomain)</b><br/>
                            should&nbsp;be&nbsp;<b>true</b>&nbsp;but&nbsp;actually&nbsp; 
                        <b>{(ApplicationDomain.currentDomain === ApplicationDomain.currentDomain)}</b>
                    </p>
                    <br/>
                    <p>
                        <b>(ApplicationDomain.currentDomain === ApplicationDomain.currentDomain)</b><br/>
                            should&nbsp;be&nbsp;<b>true</b>&nbsp;but&nbsp;actually&nbsp;
                        <b>{(ApplicationDomain.currentDomain == ApplicationDomain.currentDomain)}</b>
                    </p>
                    <br/>
                    <p>
                        <b>the parent domain of main application's domain</b><br/>
                           should&nbsp;be&nbsp;<b>System Domain</b>&nbsp;but&nbsp;actually&nbsp; 
                        <b>{ApplicationDomain.currentDomain.parentDomain}</b>
                    </p>
                    <br/>
                    <br/>
                    <p>
                        I guess ApplicationDomain.currentDomain returns a new copy every time.<br/>(ApplicationDomain.currentDomainは毎回値のコピーを毎回返すのでは?)
                    </p>
                    <br/>
                    <ul>
                        <li>[] === [] : {[] === []}</li>
                        <li>{"{} === {} : " + ({} === {})}</li>
                        <li>loaderInfo.parameters === loaderInfo.parameters : {loaderInfo.parameters === loaderInfo.parameters}</li>
                    </ul>
                </html>;
            XML.ignoreWhitespace = false;
            XML.prettyPrinting = false;
            XML.prettyIndent = 0;
            
            var tf:TextField = addChild(new TextField()) as TextField;
            tf.autoSize = TextFieldAutoSize.LEFT;
            tf.multiline =  true;
            tf.defaultTextFormat = new TextFormat("_typewriter", 10);
            tf.htmlText = output;
        }
    }
}