I have a flash application which is emded into an iframe, that is hosted on my domain (hc.ru). However, the swf file is situated at cs1234.vk.me and loads from there. The iframe is emded in the page which has the vk.com domain. In my flash application I want to load an image from domain cs4321.vk.me. When I test my flash app locally with local file it works just fine. Here is the code which loads the image:
_imgContainer = new Sprite();
var loader:Loader = new Loader();
_imgContainer.addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
loader.load(new URLRequest(url));
loader.mask = mc_holder;
private function onError(event:SecurityErrorEvent):void
{
trace("security error");
trace(event.text);
}
private function onLoaderComplete(event:Event):void
{
trace("the image was loaded");
this.addChild(_imgContainer);
}
When I upload the swf file to server and open it in browser it doesn't show me the image at all. However, there is no any kind of error thrown and trace output says "the image was loaded". All the cs****.vk.me servers, which contain both the swf file and the images, have the following crossdomain.xml file:
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-http-request-headers-from domain="vk.com" headers="*"/>
<allow-http-request-headers-from domain="*.vk.com" headers="*"/>
<allow-http-request-headers-from domain="userapi.com" headers="*"/>
<allow-http-request-headers-from domain="*.userapi.com" headers="*"/>
<allow-http-request-headers-from domain="vk.me" headers="*"/>
<allow-http-request-headers-from domain="*.vk.me" headers="*"/>
<allow-http-request-headers-from domain="vkontakte.ru" headers="*"/>
<allow-http-request-headers-from domain="*.vkontakte.ru" headers="*"/>
<allow-http-request-headers-from domain="mvkontakte.com" headers="*"/>
<allow-http-request-headers-from domain="*.mvkontakte.com" headers="*"/>
<allow-access-from domain="vk.com" to-ports="80"/>
<allow-access-from domain="*.vk.com" to-ports="80"/>
<allow-access-from domain="vk.me" to-ports="80"/>
<allow-access-from domain="*.vk.me" to-ports="80"/>
<allow-access-from domain="userapi.com" to-ports="80"/>
<allow-access-from domain="*.userapi.com" to-ports="80"/>
<allow-access-from domain="vkontakte.ru" to-ports="80"/>
<allow-access-from domain="*.vkontakte.ru" to-ports="80"/>
<allow-access-from domain="mvkontakte.com" to-ports="80"/>
<allow-access-from domain="*.mvkontakte.com" to-ports="80"/>
</cross-domain-policy>
I do not really get the problem, since there is no any error of some kind.
Thanks in advance.
Related
I am using JBoss 7.1, and I'm trying to create a Database Connection Pool through Application Server. I'm using a mysql DB, but I tried also with a Postgre database and the error is just the same. Everything seems to be OK, but when I try to access to the application, it appears an error on console that advises me that the connection with the database was failed. My code is the following:
My Jboss standalone.xml.
<datasource jndi-name="java:jboss/jdbc/exampleDS" pool-name="jdbc/exampleDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://127.0.0.1:3306/example?useSSL=false</connection-url>
<driver>mysql-connector-java-5.1.43-bin.jar</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>root</user-name>
<password>password</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</datasource>
<driver name="mysql-connector-java-5.1.43-bin.jar" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</xa-datasource-class>
</driver>
My web.xml
<resource-ref>
<description>example</description>
<res-ref-name>jdbc/exampleDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
My javacode
private ServiceLocator() {
try {
this.initCtx = new InitialContext();
this.envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource)
envCtx.lookup("jdbc/exampleDS");
} catch (NamingException e) {
ApplicationException apRE = new ApplicationException(ErrorCode.E_JDNI001, e);
LogService.getLog().fatal(apRE.getMessage(), apRE);
throw apRE;
}
}
Finally, when I start my jboss server, none error appears, but the console said that the tables of my DB don't exist.
I appreciate help <3
I had fixed the error.
First thing to do is creating a jboss-web.xml where web.xml, in my case, webapp/WEB-INF. It must be similar to the following:
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/exampleDS</res-ref-name>
<jndi-name>java:jboss/jdbc/exampleDS</jndi-name>
</resource-ref>
</jboss-web>
Once that is created, we must create a module.xml inside of modules->com->mysql->main, containing the following:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.43-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
You have to insert also, the .jar that you used also inside of the main dir.
Regarding the javacode, you need to change the initCtx.lookup("java:comp/env"); for this: initCtx.lookup("java:");
That's all :)
27.10.2014: I still really need help for this question.
My friend and I are trying to host a game through SmartFoxServer. He is hosting the server on his computer, and has successfully portforwarded the necessary port (9339) to his local IP. We have done everything in this guide. According to SmartFoxServer's feedback through the admin panel and the server terminal window, the hosting should be successful.
However, when trying to connect to his public IP, I get this error:
[WARN] Security Error: Error #2048: Security sandbox violation: file:
cannot load data from #IP#.
crossdomain.xml
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" t-ports="*" secure="false" />
</cross-domain-policy>
config.xml
<ServerSetup>
<ServerIP>10.0.0.8</ServerIP>
<ServerPort>9339</ServerPort>
<AutoSendPolicyFile>true</AutoSendPolicyFile>
<MaxUserIdleTime>300</MaxUserIdleTime>
<!-- Server Variables limits (-1 = unlimited) -->
<MaxRoomVars>-1</MaxRoomVars>
<MaxUserVars>-1</MaxUserVars>
<AntiFlood active="false">
<MinMsgTime tolerance="5">1000</MinMsgTime>
<MaxRepeatedMessages>3</MaxRepeatedMessages>
<WarningsBeforeKick>2</WarningsBeforeKick>
<WarningMessage><![CDATA[No flooding allowed!)]]></WarningMessage>
<KickMessage><![CDATA[You've been warned! No flooding! Now you're kicked]]></KickMessage>
<BanMessage><![CDATA[Stop Flooding!! You're being banned]]></BanMessage>
<BanAfter timeSpan="1">3</BanAfter>
</AntiFlood>
<BadWordsFilter active="false">
<FilterMode>filter</FilterMode> <!-- REMOVE or FILTER -->
<StripCharacters><![CDATA[,.;:_!$%&/#*-+]]></StripCharacters>
<Warnings>true</Warnings>
<FilterRoomNames>true</FilterRoomNames>
<FilterUserNames>true</FilterUserNames>
<WarningsBeforeKick>3</WarningsBeforeKick>
<WarningMessage><![CDATA[No swearing!)]]></WarningMessage>
<KickMessage><![CDATA[You've been warned! No Swearing! Now you're kicked]]></KickMessage>
<BanMessage><![CDATA[Stop Swearing! You're being banned!]]></BanMessage>
<BanAfter timeSpan="1">3</BanAfter>
<BadWordsList>
<badWord>motherfucker</badWord>
<badWord>dickhead</badWord>
<badWord>asshole</badWord>
<badWord>shithead</badWord>
<badWord>shit</badWord>
<badWord>fucking</badWord>
<badWord>fuck</badWord>
<badWord>dickhead</badWord>
<badWord>bastard</badWord>
<badWord>nigger</badWord>
<badWord>idiot</badWord>
<badWord>bitch</badWord>
</BadWordsList>
</BadWordsFilter>
<BanCleaning>auto</BanCleaning>
<BanDuration>1800</BanDuration> <!-- 30 min -->
<BannedLoginMessage>You have been banned!</BannedLoginMessage>
<OutQueueThreads>1</OutQueueThreads>
<ExtHandlerThreads>1</ExtHandlerThreads>
<MaxWriterQueue>50</MaxWriterQueue>
<MaxIncomingQueue>8000</MaxIncomingQueue>
<DeadChannelsPolicy>strict</DeadChannelsPolicy>
<MaxMsgLen>4096</MaxMsgLen>
<LogMaxSize>5000000</LogMaxSize>
<LogMaxFiles>5</LogMaxFiles>
<!--
Available options are:
FINEST
FINER
FINE
CONFIG
INFO
WARNING
SEVERE
-->
<FileLoggingLevel>WARNING</FileLoggingLevel>
<ConsoleLoggingLevel>INFO</ConsoleLoggingLevel>
<AdminLogin>sfs_admin</AdminLogin>
<AdminPassword>sfs_pass</AdminPassword>
<AdminAllowedAddresses>
<AllowedAddress>*.*.*.*</AllowedAddress>
</AdminAllowedAddresses>
<IpFilter>0</IpFilter>
<!-- Enable / Disable remote zone info -->
<EnableZoneInfo>false</EnableZoneInfo>
</ServerSetup>
<!--
Zones Configuration.
-->
<Zones>
<Zone name="multiChat">
<Rooms>
<Room name="Main Lobby" maxUsers="50" isPrivate="false" isTemp="false" autoJoin="true" />
</Rooms>
</Zone>
</Zones>
Actionscript 3 / Flash File
import flash.events.SecurityErrorEvent;
import flash.system.Security;
import it.gotoandplay.smartfoxserver.*
import flash.events.MouseEvent;
connect_btn.addEventListener(MouseEvent.CLICK, initiateConnection);
function initiateConnection(evt:MouseEvent):void
{
// ip_text.test = public IP address of server host machine
// int(port_text.text) = 9339
// zone_text.text = "multiChat"
// name_text.text = "testUser"
status_text.text = "Connecting to " + ip_text.text + "...";
var policyLoad:String = "xmlsocket://" + ip_text.text + ":" + port_text.text;
Security.loadPolicyFile(policyLoad)
var smartFox:SmartFoxClient = new SmartFoxClient(true)
smartFox.addEventListener(SecurityErrorEvent.SECURITY_ERROR, sandboxHandler)
smartFox.addEventListener(SFSEvent.onConnection, onConnectionHandler)
smartFox.connect(ip_text.text, int(port_text.text))
smartFox.addEventListener(SFSEvent.onLogin, onLoginHandler)
smartFox.addEventListener(SFSEvent.onRoomListUpdate, onRoomListUpdateHandler)
smartFox.login(zone_text.text, name_text.text, "")
}
function onConnectionHandler(evt:SFSEvent):void
{
if (evt.params.success)
status_text.appendText("Connection successful \n");
else
status_text.appendText("Connection failed \n");
}
function onLoginHandler(evt:SFSEvent):void
{
if (evt.params.success)
status_text.appendText("Successfully logged in as " + evt.params.name + "\n");
else
status_text.appendText(status_text.text + "Zone login error; the following error occurred: " + evt.params.error + "\n");
}
function onRoomListUpdateHandler(evt:SFSEvent):void
{
// Dump the names of the available rooms in the "simpleChat" zone
for (var r:String in evt.params.roomList)
status_text.appendText(status_text.text + evt.params.roomList[r].getName() + "\n");
//smartFox.joinRoom(10)
}
function sandboxHandler(evt:SecurityErrorEvent):void
{
status_text.appendText("Sandbox Error / Flash Security Error Event");
}
Output:
*Attempting to launch and connect to Player using URL DIRECTORY OF FILE
[SWF] DIRECTORY OF FILE - 92561 bytes after decompression
[Sending]:
[WARN] Security Error: Error #2048: Security sandbox violation: file:DIRECTORY OF FILE cannot load data from PUBLIC HOST IP:9339.
[UnloadSWF] DIRECTORY OF FILE
Debug session terminated.
Debug session terminated.*
Change the following line:
<allow-access-from domain="*" t-ports="*"/>
to:
<allow-access-from domain="*" t-ports="*" secure="false" />
If still have some issue, you can check more details reading the official cross-domain policy documentation
Some useful URL's
SmartFoxServer configuration
SmartFox Forum
I regarded stackoverflow as one of the most reliable services in order to get help quickly, but this time I got the answer from somewhere else. I'll rewrite it here.
Maybe someone that has the same problem will consider this useful in the future.
The problem was after all quite simple. The standalone Adobe Flash Player automatically refuses such a connection. However it works when running it in a browser..
You had a typo in your policy file.
On line 4
<allow-access-from domain="*" t-ports="*" secure="false" />
Should have been
<allow-access-from domain="*" to-ports="*" secure="false" />
Note you had t-ports instead of to-ports.
Source: Cross-domain policy file specifications. https://www.adobe.com/content/dam/acom/en/devnet/articles/CrossDomain_PolicyFile_Specification.pdf#G3.344406
I have been trying to configure mysql as a datasource in wildfly. I am not sure what i am missing out, i get an error on startup .
I have the mysql-connector-java-5.0.8-bin.jar and the module.xml in the folder:
"/wildfly-8.1.0.Final/modules/system/layers/base/com/mysql/main"
below are the files
module.xml
<module xmlns="urn:jboss:module:1.1"
name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.0.8.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
standalone.xml
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/proj" pool-name="proj" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password>admin123</password>
</security>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
I have tested the jdbc connectivity with a standalone program in eclipse and it worked
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class ConnectSql {
public static void main(String []args){
String userName = "root";
String pass = "admin123";
String url = "jdbc:mysql://localhost/";
String driver ="com.mysql.jdbc.Driver";
String db = "proj";
try{
//registering the driver.
Class.forName(driver);
Connection con = DriverManager.getConnection(url+db,userName,pass);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select f_name from t_users");
while(rs.next()){
System.out.println("name :"+rs.getString(1));
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch(ClassNotFoundException cnf){
cnf.printStackTrace();
}
}
}
Referred to the below link and modified the module.xml
Wildfly 8.0.0 mysql problems with datasource
Here is a the error log i get on start up
02:45:17,169 ERROR [org.jboss.as.controller.management-operation]
(Controller Boot Thread) JBAS014613: Operation ("add") failed -
address: ([
("subsystem" => "datasources"),
("data-source" => "proj") ]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:jboss/datasources/proj is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:jboss/datasources/proj is missing [jboss.jdbc-driver.mysql]" ]} 02:45:17,175 ERROR
[org.jboss.as.controller.management-operation] (Controller Boot
Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "proj") ]) - failure description: {
"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:jboss/datasources/proj is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:jboss/datasources/proj is missing [jboss.jdbc-driver.mysql]"
],
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => [
"jboss.data-source.reference-factory.proj",
"jboss.naming.context.java.jboss.datasources.proj"
],
"Services that may be the cause:" => ["jboss.jdbc-driver.mysql"]
} }
To resolve the mysql datasource configuration issue on Wildfly i used the admin console to add the datasource and test it.
If you login to the web console and find the datasource you tried configuring disable
that a remove it . The standalone.xml and the module.xml get reset to the orginal.
Steps for accessing web console
Configure a new datasource :
name :mysql
JNDI :java:jboss/datasources/proj
Click next and enter the url (i used the below) and click enable and then click test
url : jdbc:mysql://localhost/proj
The test should show success
The changes to the standalone.xml and the module.xml are automatically made .
If you restart the server now it should start without any errors and you should be able to access the database from your web project
I have working configuration of mysql driver on wildfly.
<datasources>
// ...
<drivers>
// ...
<driver name="mysql" module="com.mysql.jdbc">
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<driver-class>com.mysql.jdbc.Driver</driver-class>
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
The little difference seems to be presence of "driver-class" tag.
I hope it will help.
(Deploying mysql driver as a deployment also works and it's recommended way. https://docs.jboss.org/author/display/WFLY8/DataSource+configuration )
[edit]
I have mysql module under wildfly/modules/com/mysql/jdbc/main/ . I've noticed just now you module path doesn't correspond to module name. And I haven't find any doc's just yet, but I don't think you should mess with modules/system directory.
module.xml
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql.jdbc">
<resources>
<resource-root path="mysql-connector-java-5.1.31-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Two things: I just got mine working, and have the driver and xml located in $JBOSS_HOME/modules/com/mysql/jdbc/main - I'm fairly new with this as well so I'm not sure if that matters. Another thing: I don't know if it is just a typo, but if it was just copied and pasted it looks like your JAR name is incorrect
<resource-root path="mysql-connector-java-5.0.8.jar"/>
when it should be
<resource-root path="mysql-connector-java-5.0.8-bin.jar"/>
I forgot the .jar in mine, and that ended up fixing it. Hope that helps!
This may happen when you download the mysql connector zip and uploading the zip as a deployment. But the correct way is to unzip your download and point to the contained jar.
There are three ways using which you can simply create datasource into wildfly
Using admin console
Manually adding into standalone.xml
Creating datasource file that is xml file.
Go to WildFly directory/standalone/deployments
Simplest way to create datasource xml with following content
<datasources xmlns="http://www.jboss.org/ironjacamar/schema">
<datasource jndi-name="APP_DS" pool-name="APP_DS" enabled="true" use-ccm="false">
<connection-url>jdbc:mysql://localhost:3306/DB_NAME</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql</driver>
<!-- sql to call when connection is created -->
<new-connection-sql>SELECT 1</new-connection-sql>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
</pool>
<security>
<user-name>username</user-name>
<password>password</password>
</security>
<!-- sql to call on an existing pooled connection when it is obtained from pool -->
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
</validation>
<timeout>
<blocking-timeout-millis>300000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
<statement>
<track-statements>true</track-statements>
</statement>
</datasource>
</datasources>
I'm using AS3WebSocket module to connect web sockets. It works well when I launch flash locally (flash file is marked as trusted in global settings).
But when I open server page with flash, it doesn't work. I've no error messages, just "disconnect" in log.
WinServer2012, IIS, ASP.NET MVC4
Here are logs:
ws init begin: ws://www.sample.biz/WsHandler.ashx?userId=5
Disconnected null[object WebSocket]
And code:
function SYS_wsInit_begin():void
{
writeLog("ws init begin: " + ws_init_url);
trace(ws_init_url);
try
{
websocket = new WebSocket(ws_init_url,"*");
websocket.addEventListener(WebSocketEvent.CLOSED, handleWebSocketClosed);
websocket.addEventListener(WebSocketEvent.OPEN, handleWebSocketOpen);
websocket.addEventListener(WebSocketEvent.MESSAGE, handleWebSocketMessage);
websocket.addEventListener(WebSocketErrorEvent.CONNECTION_FAIL, handleConnectionFail);
websocket.connect();
}
catch (err:Error)
{
writeLog("ws init failed: " + err.message + err.name);
}
}
function handleWebSocketClosed(event:WebSocketEvent):void
{
writeLog("Disconnected " + event.message + event.target);
trace("Disconnected");
}
function handleWebSocketOpen(event:WebSocketEvent):void
{
writeLog("Connected");
trace("Connected");
}
function handleConnectionFail(event:WebSocketErrorEvent):void
{
writeLog("Connection Failure: " + event.text);
trace("Connection Failure: " + event.text);
}
crossdomain.xml:
<?xml version="1.0" encoding="utf-8" ?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
I've also installed Socket Policy File Server with file:
<?xml version="1.0"?>
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd">
<site-control permitted-cross-domain-policies="*" />
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>
What can I do?
Oh, I've resolved the problem.
After reading, http://forums.adobe.com/message/5297747 I've tried to check 843 port with fiddler, but I got only a redirection to index page.
I checked my IIS configuration. There was a binding on 843 port. After the binding was deleted and socket policy file server restarted the Web-socket connection was established!
I'm working on a online painting application.
The application swf as well as the backend server is located here:
http://217.150.244.137/Client.swf
there is a crossdomain.xml located in the root as well:
http://217.150.244.137/crossdomain.xml
I load the canvas images from the server like this:
var _loader:Loader = new Loader();
//make sure it's really not comming from the cache
var urlRequest:URLRequest = new URLRequest(url+'?nocache=' + new Date().getTime());
var requestHeader1:URLRequestHeader = new URLRequestHeader("pragma", "no-cache");
var requestHeader2:URLRequestHeader = new URLRequestHeader("Expires", "Thu, 01 Jan 1970 00:00:00 GMT, -1");
var requestHeader3:URLRequestHeader = new URLRequestHeader("Cache-Control", "no-cache, no-store, must-revalidate");
urlRequest.requestHeaders.push(requestHeader1);
urlRequest.requestHeaders.push(requestHeader2);
urlRequest.requestHeaders.push(requestHeader3);
var context:LoaderContext = new LoaderContext(true);
_loader.load(urlRequest, context);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onDataLoaded);
Still, the swf doesn't work when embeeded from another page
i get a
Error #2044: SecurityErrorEvent unverarbeitet. text=Error #2170: Verletzung der Sicherheits-Sandbox: http://www.pictonauts.theaterspektakel.ch/Client.swf kann keine HTTP-Header an http://217.150.244.137/images/wall/4/img_-2_-1_4.jpg?nocache=1331058396137 senden.
What am I missing or doing wrong?
First, try this crossdomain.xml:
<?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="all"/>
<allow-access-from domain="*" to-ports="*" secure="false" />
<allow-http-request-headers-from domain="*" headers="*" secure="false" />
</cross-domain-policy>