Questions about flex security sandbox

Source: Internet
Author: User

 Load an image on the network and find that it cannot be masked by setmask. The trace shows "Security Sandbox conflict ". It is easy to understand the cause. allowdomain is required to call objects or variables in different domains, as shown below:

System. Security. allowdomain ("www.zhugao.cn ");
Loadmovie ("http://www.zhugao.cn/images/links/links_zhugao.jpg", my_mc );

Note: "www.zhugao.cn" and "zhugao.cn" are not the same domain, depending on the target. For example, loadmovie ("http://player.zhugao.cn/##.jpg", my_mc); then, allowdomain should be player.zhugao.cn, not zhugao.cn, or www.zhugao.cn.

To allow multiple domains, use commas to separate them:
System. Security. allowdomain ("www.zhugao.cn", "zhugao.cn", "player.zhugao.cn ");

The wildcard "*" can be used for a player over 8.0 to allow all domains:
System. Security. allowdomain ("*");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.