Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Getting Security Error# 2048 while working in Flash 11.2

New Here ,
May 17, 2012 May 17, 2012

Hi all,

Greetings to all. Well So i prepared a widget written in Action Script 3. Here are my system configurations:

OS: Windows 7

Flash: 11.2

Now when i make a SWF file and open it in my local host i can see the widget running with no problems.

But when i wrapp the SWF file/ Flash Widget in HTML and then try to run it in my local host it is giving me security error 2048. Below is the error i am getting:

Error 2048
Error Security: 0:[SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"] - {"config":{"fragmentOutgoingMessages":true,"maxReceivedFrameSize":1048576,"fragmentationThreshold":16384,"maxMessageSize":8388608,"closeTimeout":5000,"assembleFragments":true},"debug":true,"extensions":[],"readyState":0,"bufferedAmount":0,"resource":"/1.0.0/events/annotation.OQB15MCCCLO49620VHC4R8C8D/","port":25899,"useNullMask":false,"host":"127.0.0.1","protocol":null,"secure":false,"uri":"ws://127.0.0.1:25999/1.0.0/events/annotation.OQB15MCCCLO49620VHC4R8C8D/","connected":false}

After some googling and visiting some forums/websites on the internet i also included the following cross domain parameters in the root location of my source code:

<?xml version=\"1.0\"?> <!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\"> <cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="localhost" to-ports="*" secure="false" />
<allow-access-from domain="*" secure="false" to-ports="{0,number,#}"/>" <allow-http-request-headers-from domain="*" headers="*"/>" </cross-domain-policy>

Apart from the above settings i also made a mms.cfg file to include the DisableSocket=0 but still not working.

I am using websocket connections in my widget and using open source lib AS3Websocket library.

Can you guys anyone here can shed some light on this.It will be a huge help.

Thank you and have nice time people.

TOPICS
ActionScript
23.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2012 May 17, 2012

what does your widget do?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2012 May 17, 2012

Hi kglad,

  Thanks for your reply. Actually the widget is used to do simple math additions for one digit. Like a UI is shown and questions are asked for eg: how much is 2+3? and when the user puts the answer as 5, the scores are updated and the next question is shown to the user.

Simple math addition for kids basically.

Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2012 May 17, 2012

is it loading data?  from where is it loading data and what kind of data?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2012 May 17, 2012

hi kglad

          Yes its loading data from Desktop application. We are connected to the Desktop application  thru localhost.when we use only SWF directly in the application we are able to connect the websockets. One we wrapp it in HTML and then try to connect, the websockets fails showing the security error 2048.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2012 May 17, 2012

that should be:

DisableSockets=0

and are you loading your policy file?  if yes, show your code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2012 May 17, 2012

HI kglad,

yes we tried DisableSockets=0 also still its not working.

I inculded the policy file also... You can check the code in my first post where i mentioned all the tags that i have added in the policy file

Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2012 May 17, 2012

are you loading your policy file?

something like:

Security.loadPolicyFile("xmlsocket://localhost:yourport");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2012 May 17, 2012

No not exactly...

I am not using the code you pasted in the above post.

Let me try that out and get back to you..

Thanks for taking time and helping to solve this damn issue...;-)

Thanks a lot...

Mayank

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2012 May 17, 2012

yes, you need to load the policy file.  i just don't know what path/name/socket you should use.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2012 May 21, 2012

Hi Kglad,

We checked putting the Security.loadPolicyFile as you mentioned in the above post. Still its not working. Any other ideas.

M still investigating.

thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 24, 2012 May 24, 2012

Hi mayanks20,

policy content from policy socket server must be:

"<cross-domain-policy><site-control permitted-cross-domain-policies=\"master-only\"/><allow-access-from domain=\"*\" to-ports=\"*\"/></cross-domain-policy>\0"

no xml header, end with zero.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 24, 2012 May 24, 2012
LATEST

Hi wugidugi,

  Do you know how to check whether the securtiy file (Tags) is loaded or not? I mean is there any way to check if its loaded at runtime. Somehow its giving a miss to that file in my CPP code (server side).

Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines