Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
what does your widget do?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
is it loading data? from where is it loading data and what kind of data?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
that should be:
DisableSockets=0
and are you loading your policy file? if yes, show your code.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
are you loading your policy file?
something like:
Security.loadPolicyFile("xmlsocket://localhost:yourport");
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
yes, you need to load the policy file. i just don't know what path/name/socket you should use.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more