A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Security Error issue

  1. #1
    Member
    Join Date
    Apr 2004
    Posts
    85

    Security Error issue

    Hello,
    I made a button into my SWF file. When the use clicked on it, the user will be leadto a web address ( e.g www.google.com). I get this error when I clicked to my button.
    SecurityError: Error #2028: Local-with-filesystem SWF file file:///D|/test.swf cannot access Internet URL http://www.google.com.

    As I got we should use allowdomain(dom1,dom2,...) method accept other SWF files which are resides into dom1,dom2,..
    Whats happen if we want to move user to other web page without any security error or involving user to sandbox setting.
    Best,

  2. #2
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,836
    swf's on your hd can't access the web. The exception to this is from within flash if you are testing movie. If you want to access something on a different server use this: Security.loadPolicyFile(url:String)
    .

  3. #3
    Member
    Join Date
    Apr 2004
    Posts
    85
    Thank you but I have that peoblem yet.

    I created a file and named it crossdomain.xml
    In this file I wrote
    <?xml version="1.0"?>
    <cross-domain-policy>
    <allow-access-from domain="www.google.com" />
    <allow-access-from domain="*.google.com" />
    </cross-domain-policy>

    and in my root AS file wrote:
    Security.loadPolicyFile("localhost://crossdomain.xml");

    again the problem is remained.
    Did I do something wrong?

    best,

  4. #4
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,836
    Flash will not access the harddrive or if you have an swf on the hard drive it won't load servers. So first you need to place this on a server. You could install something like xampp if you want to test it on your computer. Then if the url is www.link.com/example/whatever/ All you would need to put is:
    Security.loadPolicyFile("www.link.com"); unless you are trying to load the policy file from a certain location.
    REMEMBER
    if you are trying to do this with the swf on your hard drive then it will not work
    Edit: Allow domain is so other swfs can access this swf.
    .

  5. #5
    Member
    Join Date
    Apr 2004
    Posts
    85

    Smile

    thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center