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: forked from: forked from: ApplicationDomain.currentDomain isn't ApplicationDomain.currentDomain !

Get Adobe Flash player
by yonatan 15 Jul 2010

    Talk

    imajuk at 16 Jul 2010 07:54
    great!!
    Embed
/**
 * Copyright yonatan ( http://wonderfl.net/user/yonatan )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/oE0B
 */

// 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/>
                    <p>
                        <b>(loaderInfo.applicationDomain.getDefinition("Object") ==
                           ApplicationDomain.currentDomain.getDefinition("Object"))</b><br/>
                            should&nbsp;be&nbsp;<b>true</b>&nbsp;but&nbsp;actually&nbsp; 
                        <b>{(loaderInfo.applicationDomain.getDefinition("Object") == ApplicationDomain.currentDomain.getDefinition("Object"))}</b>
                    </p>
                    <br/>
                    <p>
                        <b>(ApplicationDomain.currentDomain.getDefinition("Object") ===
                           ApplicationDomain.currentDomain.getDefinition("Object"))</b><br/>
                            should&nbsp;be&nbsp;<b>true</b>&nbsp;but&nbsp;actually&nbsp;
                        <b>{(ApplicationDomain.currentDomain.getDefinition("Object") === ApplicationDomain.currentDomain.getDefinition("Object"))}</b>
                    </p>
                    <br/>
                    <p>
                        <b>(ApplicationDomain.currentDomain.getDefinition("Object") ===
                           (new ApplicationDomain).getDefinition("Object"))</b><br/>
                            should&nbsp;be&nbsp;<b>false</b>&nbsp;but&nbsp;actually&nbsp;
                        <b>{(ApplicationDomain.currentDomain.getDefinition("Object") === (new ApplicationDomain).getDefinition("Object"))}</b>
                    </p>
					<br/>
					<p>
					ApplicationDomain.currentDomain.getDefinition("Object") : {(ApplicationDomain.currentDomain.getDefinition("Object"))}
					<br/>
					(new ApplicationDomain(ApplicationDomain.currentDomain)).getDefinition("Object") : {((new ApplicationDomain(ApplicationDomain.currentDomain)).getDefinition("Object"))}
					</p>
                    <br/>
					<p>
                    see http://www.mail-archive.com/flexcoders@yahoogroups.com/msg126193.html
					<br/>
					and http://www.mail-archive.com/flexcoders@yahoogroups.com/msg126278.html
					</p>
                </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;
        }
    }
}