Check if one ApplicationDomain equals to the other

Ticore posted an article on his blog about how to compare ApplicationDomain in AS3.

The following method fails and won’t give you correct result:

import flash.system.ApplicationDomain;

var appDom1:ApplicationDomain = ApplicationDomain.currentDomain;
var appDom2:ApplicationDomain = ApplicationDomain.currentDomain;
var appDom3:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);

trace("appDom1 == appDom2 :", appDom1 == appDom2); // false
trace("appDom2 == appDom3 :", appDom2 == appDom3); // false

Please check the original post for the correct way to do it.

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s