What To Do When My Swf Needs Data From Different Domains's?
Couldn't decide on which board to post this in, so I chose this one. If I chose incorrectly, just move it
Anyway, my flash file is hosted on one server, let's call him www.one-server.com and needs to connect to another server, I'll call him www.another-server.com for a Flash Communication Server connection. On top of that, it connects to a third one for the remoting service. With some hassle I'd be able to make one of those connections work, but never both at the same time.
I know there's this scriptAccess thing in the HTML which displays the flashfile that should be able to allow script access to any domain. But that doesn't seem to work.
FlashCom needs to be on the other server, since it's set up to listen on port 80 as well as the default ports, to enable access from behind even more firewalls.
Any clues on how I could get it all to work, by other means than letting users open the flashflile stand-alone?
ActionScript.org Forums > Supporting Technologies > Flash Remoting
Posted on: 10-19-2004, 02:05 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Fix For Data Across Domains (need Java Servlet)
Hi I can resolve accessing data across domains using php from info i found here:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16520&sliceId=1#proxy
however php is not and option, i need to use java. how can i make a java file that does what this php does:
<?php
$dataURL = "
MySQL Data Posting Problem From Multiple Domains.
Hi all
I am running Flash MX, MySQL 3.23.57.
I have a we bit of a problem. When my puzzle runs on my primary domain, which is where the database is, the puzzle places an entry into a MySQL database that lists “game_name”, “url”, “date_time_played”. My problem is information is not being written to the database from any domain other than my primary domain.
The way it works is the Flash movie sends the game_name and the url to a PHP script that establishes a connection to the database and posts the information. I want to know what domains are using which of my games.
I have already modified the Actionscript to reflect absolute rather than relative urls. Below is the Actionscript that works on the primary domain and not on the secondary domain. I have the script on the scene preloader.
game_name = "DeathWalker2003";
// get everything between the "://" and the next "/"
c1 = _url.indexOf("://")+3;
c2 = _url.indexOf("/", c1);
domain = _url.substring(c1,c2);
//throw away any prefixes before the second to last "."
c3 = domain.lastIndexOf(".")-1;
c4 = domain.lastIndexOf(".",c3)+1;
url = domain.substring(c4,domain.length);
// Submit the data to our PHP script using the Post method
loadVariables ("http://primary_domain_name.com/free_games/game_info_process.php", this, "POST");
Thank You in advance for your help.
Domains
Who do you all think is the best to buy a high bandwidth/space domain name with relatively low prices?
I've never bought a .com b4...
I'd appreciate your thoughts on this.
Two Domains
Oke the following:
movie1:
Has a layer with as:
System.security.allowDomain("http://mysite2.com/");
and a layer with as in frame1:
unique = new Date().getTime();
productid = "1001";
myVars = new LoadVars();
myVars.loadok = "1";
myVars.sendAndLoad("welcome.php?" + unique, myVars);
myVars.onLoad = function(success){
if(success){
_root.loader.loadMovie("http://www.mysite2.com/movie2.swf");
} else {
GotoAndStop (4);
}
}
stop();
Movie2 has the following as and is loaded in the mc with instance name "loader":
myCheck = new LoadVars();
myCheck.loadok = "1";
myCheck.sentnukeurl = _root.myVars.nukeurl;
myCheck.sentsitename = _root.myVars.sitename;
myCheck.sentproductid = _root.productid;
myCheck.sendAndLoad("http://www.mijnsite2.nl/check.php?" + unique, myCheck);
myCheck.onLoad = function(ok){
if(ok){
productidc = _root.loader.myCheck.productid;
sitenamec = _root.loader.myCheck.sitename;
nukeurlc = "Test";
admincontrolc = _root.loader.myCheck.admincontrol;
//trace(nukeurlc);
_root.gotoAndStop(2);
}
}
After this te main movie goes to frame 2. This is a keyframe and in this also the mc loader is placed. There is also a mc in this frame and layer with dynamische text with fieldname title1. This should diplay the var from movie2 sitename with the following as:
onClipEvent (enterFrame) {
title1.text = _root.loader.myCheck.sitename;
}
But I get an undefined....
Does anyone know why???
A New Way To Get Across Domains
Is it posible to write some javaScript code to dynamically load text data (specifically an RSS feed) into a HTML doccument, which has a flash movie embeded into it, then us FScommand to pass those variable into flash?
I'm asking because i have been using PHP work arounds for ages, but now the 'other' sites are starting to realise that there are loads of requests comming from my server, so it would be good to move the calling of the URI to be client side.
any thoughts?
Xl
XML Across Domains
I have a project that sends queries to a database and receives XML formatted data:
Markets_xml = new XML();
Markets_xml.onLoad = readMarketsXML;
Markets_xml.load("
Free .com Domains
Always wanted a free .com domain name???
Well here's a chance....im not spamming.....i just want to spread the word.
goto ********freedomain.biz and u can get a .com or .net or .org for one year free!!!!! no hidden costs(i tried them myself).
Tell me whatchya think of that!
Free Domains
does anybody know if you can put up flash sites on free domain sites? if you can, can you do it on all of them or is there any specially good ones? cheers
SharedObjects Between Domains?
I've got a flash file that gets/sets shared objects on the unsecured side of the site (mysite.com). When I move to the secure side (https://mysite.securehostname.com), of course I can't access the sharedObjects I set before.
Is there a way to transfer the data between the two?
Using Multiple Domains
Hey all.
This is, I'm certain, a very stupid question, but I'm still clueless as to what to do nonetheless.
I've got a couple of domain names. I'm looking to use the same server space (through an online company, not my own server) to host more than one of the domains. So say I've got www.blah.com and www.awesome.com and I want to host both using that same space, how do I designate what is the index file for one, and what is the index file for the other?
Like I said, stupid question, but if someone would take the time to help me out, I would really appreciate it.
Thanks!
-Colin
LocalConnection Across Domains
Hello,
I am building an AIR app that is supposed to receive events from a SWF loaded on any domain. The tool is meant to be an external debugger so it must work between the user's local machine and any website local or not. When both files are on my local machine it works fine, but I am unable to get it to work between my local machine and other websites.
My receiving file's code looks like this:
Code:
var lc:LocalConnection = new LocalConnection();
var lc_title:String = "com.hapticdata.utils.HDDebug";
lc.connect(lc_title);
Security.allowDomain("*");
lc.allowDomain('*');
lc.client = this;
function getFeed(str:*):void {
outputArea.htmlText += str;
}
function clearFeed():void {
outputArea.htmlText="";
}
The connection part of my debugger class looks like this:
Code:
//this is called to initiate tracing to the external window
public static function enterLocalConnectionMode():void {
if(turnedOn) mode = LOCALCONNECTION_MODE;
Security.allowDomain("*");
lc.allowDomain("*");lc.addEventListener(StatusEvent.STATUS,localConnectionStatusEventHandler);
}
//this is the method that sends to the local connection, the important code is under "case LOCALCONNECTION_MODE:"
private static function submitLine(message:*):void {
switch(mode) {
case TEXTFIELD_MODE:
textField.htmlText += message + "
";
//textField.appendText(message+"
");
textField.scrollV = textField.maxScrollV;
break;
case LOCALCONNECTION_MODE:
try {
if(!connected){ lc.send(lc_title,"clearFeed"); trace("clearFeed"); }
connected=true;
lc.send(lc_title,"getFeed",message);
}
catch(error:Error) {
mode = TRACE_MODE;
trace("COULD NOT FIND LOCALCONNECTION");
trace("------------------------------");
trace(message);
}
break;
case TRACE_MODE:
trace(message);
}
}
If anyone knows how to get past my domain error's I would be very grateful. Thanks!
-Kyle
SendAndLoad Across Domains?
So I've had this problem for a while now actually and finally got around to addressing it. I've done a search on here, but none of the previous solutions worked for me.
Essentially, I have been unable to access PHP scripts on a different domain than where my SWF files reside. I'm using sendAndLoad like so:
Code:
var incoming:LoadVars = new LoadVars();
var outgoing:LoadVars = new LoadVars();
outgoing.email = email;
outgoing.sendAndLoad(server + "scripts/login.php, incoming);
incoming.onLoad = function() {
//do stuff
}
I have a few servers set up with the same exact system running on each. I just want the user to be able to select which server to run the scripts from (without having to change the URL directly in the browser).
Thanks a bunch!
LocalConnection Across Domains
Hello,
I am building (what will eventually be...) an AIR app that is supposed to receive events from a SWF loaded on any domain. The tool is meant to be an external debugger so it must work between the user's local machine and any website local or not. When both files are on my local machine it works fine, but I am unable to get it to work between my local machine and other websites.
My receiving file's code looks like this:
Code:
var lc:LocalConnection = new LocalConnection();
var lc_title:String = "com.hapticdata.utils.HDDebug";
lc.connect(lc_title);
Security.allowDomain("*");
lc.allowDomain('*');
lc.client = this;
function getFeed(str:*):void {
outputArea.htmlText += str;
}
function clearFeed():void {
outputArea.htmlText="";
}
The connection part of the debugger looks like this:
Code:
//this is called to initiate tracing to the external window
public static function enterLocalConnectionMode():void {
if(turnedOn) mode = LOCALCONNECTION_MODE;
Security.allowDomain("*");
lc.allowDomain("*");
lc.addEventListener(StatusEvent.STATUS,localConnectionStatusEventHandler);
}
//this is the method that sends to the local connection, the important code is under "case LOCALCONNECTION_MODE:"
private static function submitLine(message:*):void {
switch(mode) {
case TEXTFIELD_MODE:
textField.htmlText += message + "
";
textField.scrollV = textField.maxScrollV;
break;
case LOCALCONNECTION_MODE:
try {
if(!connected){
lc.send(lc_title,"clearFeed");
trace("clearFeed");
}
connected=true;
lc.send(lc_title,"getFeed",message);
}
catch(error:Error) {
mode = TRACE_MODE;
trace("COULD NOT FIND LOCALCONNECTION");
trace("------------------------------");
trace(message);
}
break;
case TRACE_MODE:
trace(message);
}
}
If anyone knows how to get past my domain error's I would be very grateful. Thanks!
-Kyle
Application Domains (i Think)
Hi,
I'm pretty new to application development, I've worked on one project in the past but i did isolated pieces of code and they went thorugh another developer before they went live... so I had no experience of making them work in a browser.
So now we come ot my problem... I have a very simple start to an app at the moment. A main SWF that imports some assets and the creates and instance of one of the assets on stage. It works in Flash when you debug and it works if you open the swf locally and directly online. However once you try to open it via the html page it is embedded in it no longer works... here is my code...
ActionScript Code:
package view{
import flash.events.*;
import flash.display.*;
import flash.display.Loader;
import flash.system.LoaderContext;
import flash.system.ApplicationDomain;
import flash.net.*;
import graphics.common.*;
import flash.system.Capabilities;
[SWF(width="50", height="480")]
public class AnalogueMain extends MovieClip {
private var assetLoader:Loader=new Loader;
private var swfContext:LoaderContext=new LoaderContext(false,ApplicationDomain.currentDomain);
private var swfPath:URLRequest=new URLRequest("Assets.swf");
private var analogueChibi:AnalogueChibi;
function AnalogueMain() {
//Load assets
assetLoader.contentLoaderInfo.addEventListener(Event.INIT,assetsLoadComplete);
assetLoader.load(swfPath,swfContext);
}
private function assetsLoadComplete(e:Event):void{
analogueChibi = new AnalogueChibi();
addChild(analogueChibi);
}
}
}
this is in a folder structure as such...
com/view
My index page is in the server root and so refers to the swf as such...
Code:
<script type="text/javascript">
// <![CDATA[
var fo = new FlashObject("http://weareanalogue.com/com/Analogue.swf", "Analogue", "100%", "100%", "9", "#c9c9c9");
fo.addParam("quality", "high");
fo.addParam("scale", "noscale");
fo.addParam("menu", "false");
fo.addParam("salign", "lt");
fo.write("flashcontent");
// ]]>
</script>
It actually loads the SWF, I know this as I put some dummy text on the stage in Flash and this is visible, howver the asset that i load in via actionscript is not.
Can someone ecplain to me why this is... I suspect it is to do with my inexperience using application domains and loaders.
Please help this is driving me nuts.
Flash And Cgi Across Domains
Hi All,
I'm having a slight problem with a form and cgi script.
When testing the working form in my Flash MX preview window i can communicate and operate my cgi script as normal. My problem arrises when i actually put the swf on the web.
The swf in question runs on one website but has to communicate with a cgi script on another (because the first site does not have cgi functionality). Both sites are operated by me but for some reason when on the web it just doesn't seem to work. I wondered if this is something to do with the swf running in a V7 player and not being allowed to communicate because of the cross domain security issues in Flash Player 7 ? My Flash MX preview is V6 so does this sound correct or does anyone have any other ideas ?
Thanks
Doug
Dual Domains
I really can notget this to work.
On a server I have a php-script, on anoher I have a embeded-flashmovie, and I can not get them to comunnicate - on the same server - no problem - but they have to be be on different servers, and I have a form in the swf that will be submitted by the php-script on the other.
That do I have to do to make it work?
I have a crossdomain.xml file with this:
ActionScript Code:
<?xml version="1.0"?>
<!-- [url]http://www.fororten.com/vgr/nyhetsbrev/crossdomain.xml[/url] -->
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
XML Access Across Domains
Hi I'm trying to access and XML feed that sits on another domain. It connects just fine on my system, but not when published. I believe this is a security feature but I need a work around. Does anyone have a good way to do this? i've tried:
System.security.allowDomain("
Mulitple Domains
If we purchase Flash Media Server 2 Professional, can that be used on multiple domains ?
SharedObjects And Domains With/out Www
Hi, i just finished a flash poll, and i use sharedObjects to prevent someone from voting many times, but if he visits www.mydomain.com and then mydomain.com, then he can vote twice.
Is there something i can do about that?
Tnx
GetURL From Different Sub Domains
Hi all,
my client's site exists on both http:// and http://www. and I have a flash navigation system on the site. All links are absolute values and work fine from the www subdomain but do not seem to work from the http:// domain.
Has anyone every experienced this problem? It seems strange to me as the links are absolute paths...
AS3 - LocalConnection Across Domains
Hello,
I am building (what will eventually be...) an AIR app that is supposed to receive events from a SWF loaded on any domain. The tool is meant to be an external debugger so it must work between the user's local machine and any website local or not. When both files are on my local machine it works fine, but I am unable to get it to work between my local machine and other websites.
My receiving file's code looks like this:
Code:
var lc:LocalConnection = new LocalConnection();
var lc_title:String = "com.hapticdata.utils.HDDebug";
lc.connect(lc_title);
Security.allowDomain("*");
lc.allowDomain('*');
lc.client = this;
function getFeed(str:*):void {
outputArea.htmlText += str;
}
function clearFeed():void {
outputArea.htmlText="";
}
The connection part of the debugger looks like this:
Code:
//this is called to initiate tracing to the external window
public static function enterLocalConnectionMode():void {
if(turnedOn) mode = LOCALCONNECTION_MODE;
Security.allowDomain("*");
lc.allowDomain("*");
lc.addEventListener(StatusEvent.STATUS,localConnectionStatusEventHandler);
}
//this is the method that sends to the local connection, the important code is under "case LOCALCONNECTION_MODE:"
private static function submitLine(message:*):void {
switch(mode) {
case TEXTFIELD_MODE:
textField.htmlText += message + "
";
textField.scrollV = textField.maxScrollV;
break;
case LOCALCONNECTION_MODE:
try {
if(!connected){
lc.send(lc_title,"clearFeed");
trace("clearFeed");
}
connected=true;
lc.send(lc_title,"getFeed",message);
}
catch(error:Error) {
mode = TRACE_MODE;
trace("COULD NOT FIND LOCALCONNECTION");
trace("------------------------------");
trace(message);
}
break;
case TRACE_MODE:
trace(message);
}
}
If anyone knows how to get past my domain error's I would be very grateful. Thanks!
-Kyle
Using SendAndLoad Across Domains
gday all,
i am currently attempting to connect to a script developed in jsp which requires me to send the variables through post. As a result I am using loadVariables in order to do this. The script then returns an xml element which indicates success or failuer...my problem is that i cannot for the life of me work out how to consume this xml and then access it...
can anybody shine some light on this problem??
many thanks in advance
morro
LoadVariables, Sub Domains & Ports
We have a question about how Flash determines what servers it can talk to. We've reviewed the loadVariables and security technote on the Macromedia site. We are using the same physical server, but are working with subdomains and specific ports, and haven't found anything like this yet on any of the boards.
Here's the story (the URLs have been generalized for this discussion):
We have a Flash application that communicates back to the server (the same one that it loads from) using loadVariables, but on a different port. We are moving the application from our development server to our production server. On the development server, it works fine. The domain name is set up like www.ourserver.com <http://www.ourserver.com> , and although the initial configuration was tricky, it seems to work fine talking to the server at http://ourserver.com:2001 It works whether we call up the initial web page as www.ourserver.com <http://www.ourserver.com.com> or ourserver.com.com <http://ourserver.com>
But the production server version behaves strangely. The domain name is www.ourserver.projects.museum.org <http://www.ourserver.projects.museum.org> . The flash application works only if we hardcode the address http://ourserver.projects.museum.org:2001 (the development server version loads the url from an .ini file that provides the URL to loadVariables from). We don't know why it only works that way, but it does. However, it only works if the page that the flash is embedded in is referenced as ourserver.projects.museum.org. If we referenence it at www.ourserver.projects.museum.org <http://www.ourserver.projects.museum.org> , it fails to connect to the server at :2001. We assume that this is some security problem as we know that the server never receives the GET or POST call. Also, we can get it to work from the standalone player, which we know isn't subject to the same security issues.
Do you have any ideas about how can we fix this? Is there some known problem with long domain names and loadVariables? I believe that the production server is configured mostly the same way as the development server, but is there some setting that throws off Flash?
Thanks!
-Joel
Loading Swfs Across Domains?
does anyone know if it is possible to load an swf from domain a into an swf on domain b, I am using Flash MX, I think that for security reasons macromedia have not allowed this with the flash 6 player, but I need to know for sure, and if it can be done, how?
Loading Variables Across Domains
ok.
im making a banner that needs to callibrate its time up against a specific server.
this is the trick i must use : http://www.macromedia.com/support/fl...omain.htm#shim
BUT!
1. the banner is on the advertisement server (which i cant access or have any kind of controll over)
2. the shim swf is on my companys server which i have all access to.
3. the shim gif loads the correct time from a xml file (i have also tryed with other formats such as php, txt and so on) the xml file is of course on my companys server with the shim swf
i export it as flash 5 (i must use it because of lo end users). the flash 5 swf works fine in flash player 6, but in flashplayer 5 it doesnt work.
this is strange, the macromedia tip doesnt say anything about that this is only possible in player 6.
do anyone have any idea what has gone wrong???
TOYTOTA
Help With Flash Forms Across Domains
I have a client who wants me to develop a flash ad banner the has forms in it for the user to fill out, and upon submission, will open up a new browser window and show the results on the clients site. The ad banner will be posted on another domain, possibly dynamically.
I've been using Flash since version 3, but never have developed something like this before. Currently I'm using MX 2004. I've read where the cross domain security issues have been tightened for Flash 7. Should the .SWF be in Flash 5 or 6?
My question is, can this be done?
If so, can someone point me in the right direction?
Thanks.
Passing Parameter Between Two Domains
Hey all,
I have a flash movie that should send one of it parameters to other domain, but unfortunatly it is not working.
If I am activating the same movie localy it is working.
Can you help?
By the way, I am using the param "allowScriptAccess" in my html container.
Thanks
Yaniv
Allowing LoadMovie() Across Domains?
I can't figure this out. I'm publishing for Flash 6 and am trying to load SWFs from one domain into SWFs loaded on another domain. Does this require the use of crossdomain.xml? (I thought that was only for loading DATA)
Here's my test: http://infinitefish.com/temp/test-loader.swf
This file has one line of code:
loadMovieNum("http://www.eyeland.com/temp/test-movie.swf",0);
You can load the SWF directly to see what it should look like:
http://www.eyeland.com/temp/test-movie.swf
Notice there are two domains in use. I want to allow any SWF on eyeland.com to be loaded by any other SWF on any other domain, for example. How can I do this? Using System.security.allowDomain()? Some other method?
Please help!
Sending Vars Across Domains
Is possible to send variable from SWF which is placed e.r. on www.mysite.com/mySWF.swf to page www.myothersite.com/myphpfile.php ?
Thanks
HELP - Flash Across Domains Not Working?
I work for a company that hosts 12-13 different websites, all of which can pull shared content from a CMS environment. For Flash interactives that we designate as shared, the files we create are stored as follows:
Flash page - 1of13domains.com/accesspoint/content/shared/folder/interactives/index.html
XML for Flash page - 1of13domains.com/accesspoint/content/shared/folder/interactives/flash.xml
SWF(s) for Flash page - swfhostingdomain.com/shared/swf/flash.swf, flash1.swf, etc.
When I create a "shared" Flash page that has to be used across 12-13 domains that pulls in XML that is hosted as a "shared" XML file, I have real issues. Sometimes it works, sometimes it doesn't.
For example, I just did an interactive which consisted of a main SWF and 3-4 sub-SWFs that were loaded on demand into the main SWF from swfhostingdomain.com. The page containing the main SWF was located on 1of13domains.com -- via the shared CMS back-end. The 4th sub-SWF, when loaded into the main SWF, would call an XML file hosted relative to the index.html file. They were in the same "shared" CMS folder.
For some reason, I had to hard-code, at first, one of the 13 possible TLD domains in the XML load function. After a day or two, that didn't work. I had to place the XML on the same swfhostingdomain.com environment as the actual main and sub SWFs. That was a hard-coded URL to the XML on the swfhostingdomain.com domain.
It's my understanding that, if Flash is embedded in www.domain.com/flash.html, then all paths are relative to that page, correct? That's how I've been operating up until now with my interactives, externally loaded XML, and externally loaded SWFs.
In the case I mentioend above, here's a sample of the XML code I used -- please note that I'm using the undocumented XPath functionality in Flash 7 and higher to load my XML -- it's worked before:
Code:
// import flash xpath implementation
import mx.xpath.XPathAPI;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = function(loaded) {
if(loaded) {
imageURL = XPathAPI.selectNodeList(this.firstChild, "/gallery/photo/image_url");
// uncomment for debugging of XML data
//for (i = 0; i < imageURL.length; i++) {
//trace(imageURL[i].firstChild.nodeValue);
//}
} else {
trace("XML feed failed to load!");
}
}
xmlData.load("/accesspoint/content/shared/directory/subdirectory/includes/test_gallery.xml);
I should also mention that, in some of the examples where this has worked, I've done the following:
Code:
xmlData.load(xml_file);
Thus allowing me to specify an XML path via a Flashvar in the HTML index page. In case someone asked for a new location for the XML file and I didn't have access to the FLA to make the hard-coded edit. This HAS worked and HAS NOT worked, so it's hit or miss as I mentioned. I've also used the XFactorstudio XPath implementation this way and found that I had to hard code a URL via a Flashvar OR via hard-coded Actionscript in the FLA. Sometimes it works, sometimes it doesn't.
My big questions are:
Am I wrong in assuming a SWF loaded from another domain "thinks" it's relative to the page where it's embedded?
Is this possibly a browser (Firefox)/platform (Mac) issue?
Assuming I can't be 100% certain that my IT group sets up Flash security policy XML files on the servers I use, is there anything I can do to make SWFs on one server load XML from another server in the FLAs themselves?
Any suggestions are greatly appreciated.
IronChefMorimoto
Sending Vars Across Domains
Is possible to send variable from SWF which is placed e.r. on www.mysite.com/mySWF.swf to page www.myothersite.com/myphpfile.php ?
Thanks
Externalinterface And Cross Domains
Hi,
my flash file sits on another server as the html page.
html page is on www.blahblah.com/flash.html
flash file is in flash.blahblah.com
here is my html src:
...
<PARAM NAME="Src" VALUE="http://flash.blahblah.com/flash.swf">
<PARAM NAME="allowScriptAccess" VALUE="always">
...
the problem is that this setup breaks the inbound javascript-to-flash communication via the external interface
outbound (flash-to-javascript) works.
if I move the flash file into the folder where the html page resides then it works again.
Any ideas?
Thanks, Mark
Checking Against Domains With AS & PHP/text
Hi,
I have an FLA for a calculator tool with a txt file on the main server that customises the appearance and other variables. It is a commerical product and it is hosted on the main domain.
What I now need to do is somehow check that only the valid domains that are subscribers are allowed to showcase the customised calculator. Each client has their own subdirectory with the text file in them on the same domain as the swf.
The client is given a HTML file that will load their customised calculator into their website, but what we need to do is have some additional information that basically validates that only that domain is hosting the SWF.
Basically I have thought to create a variable &valid_domain in the txt file and append the domain.com value to it. Then, on the client's domain we have a PHP file with a variable $thisDomain = $_SERVER[HTTP HOST]; in it.
But, from there, getting it to post that info to the txt file is where I am a bit confused.
If I just made the txt file a php file and then somehow posted from the client's server to that php file, would that work?
Then I could have an if/else in AS that compares the valid_domain & thisDomain variables.
Am I on the right track here? I am good with Actionscript with everything except the server stuff... it gets a little confusing.
TIA for any help/guidance!
Two Domains Pointing To 1 SWF - ERROR
I have two domains pointing to the same swf. So I have domain "A" and "B" where my swf (site) is hosted at "A". Domain "B" loads site "A".
The swf loads some vars from a DB, when seeing site directly at domain "A" I have no problems, but when seeing with domain "B", my site just freezes....giving an error at the Browser and I have to close. This is for FF and IE.
At first I thought this was cross domain policies, so I have put at my swf the following code:
Code:
System.security.allowDomain("B")
However this did not solve the problem.
Any help please?!
KeyboardEvent Listener Across Domains
Is there a way to listen for global KeyboardEvents across domains, when stage access is denied (due to a lack of allowDomain access)?
In other words, SWF _a_ on domain A loads in SWF _b_ on domain B, but swf _a_ does not allow domain access. How then can swf _b_ listen and correctly catch keyboard events. I know it sounds trivial enough to allowDomain access, but not possible once you deal with a chain of 3+ domains, as the root SWF cannot gift access further, and you create a tunneling problem of custom dispatching stage events..
CreateTextField - Cross Domains
Picture this. You have two flash movies one uses the standard
file1.swf (located at www.mydomain.com):
createTextField("myTextField",1,10,10,10,10);
trace(myTextField);
/*this prints out the correct handle path information while loaded on it's own domain or by movies on the same domain*/
myTextField.text="HI WORLD";
but if i have a movie on a different domain that does the following
file2.swf (located at www.myOtherDomain.com)
createEmptyMovieClip("testLoad",1;
testLoad.loadMovie("http://www.mydomain.com/file1.swf");
the file1.swf creates the textfield but can't use it's own local handles to handle anything or even set the it's text in the created text field. I'm well aware of data sharing over different domains and have taken the correct steps to allow it and everything else works except for this issue with createTextField. All i want is for file1.swf to be able to get a handle to said created textfield. the file2.swf that loads it could care less.
Any ideas out there?
Form Submissions Across Domains
Hi All,
Have come across this problem and wondered if anyone can help.
Here goes:
I own a .co.uk address but have recently added a .com with the same name. I have all my files hosted from the .co.uk server with an alias setup to redirect the .com.
My online form only works 100% when a user is viewing my site at the .co.uk address if they use the .com it seems to work online but never sends the info they submit.
I have read about some security updates with Flash player 7 but i don't really understand what i have to do . . .
here's a link to what i read http://www.macromedia.com/devnet/mx/..._security.html
I get confused when it gets to page 3 talking about "Fixing Problems in Your Existing Movies" and would like some advice in simple terms if possible.
Any help would be really appreciated.
Regards
Doug
Passing Vars Across Domains
All I'm trying to do is pass variables to an asp page that's on another domain.
Code:
total_overall = 10;
_root.percentage.text = Math.round((total_correct/total_overall)*100);
_root.percentageSend = Math.round((total_correct/total_overall)*100);
if (total_correct == null) {
_root.total.text = 0;
} else {
_root.total.text = total_correct;
}
// here's where you specify the passing percentage
if (visited) {
// information has already been sent
} else {
if (_root.percentageSend==100) {
trace("your results have been submitted");
quiz_id = 1014;
quiz_1014 = "passed";
// getURL("process.asp", "_blank", "POST");
System.security.allowDomain("http://2appl-telecomweb.intranet.teldta.com");
loadVariablesNum("http://2appl-telecomweb.intranet.teldta.com/quizConnector/process.asp", 0, "POST");
visited = true;
} else {
trace("your results have not been submitted");
// don't submit your results
visited = true;
}
}
As you can see I've tried implementing the System.security.allowDomain script but I still see the Flash player pop-up warning stating that this is a potentially insecure operation. Is there anyway around this?
Crossed Domains: From WEATHER.com
Hello everyone:
I hope someone else passed through this point before: I have found many posts in google about this but no one has an aswer untill now (unless I have not reached it...) Well... to make it short:
I import the XML data provided by Weather.com (I suscribed before and etc etc.. everythying you nedd) The point is, I can display that XML data perfetly well when I run my application on the PC, but as soon as I upload this to the server it does NOT work any longer..... why ? I could find out that since Flash 7.0 appeared... it is forbbiden to import data from other websites.... but what do I do in this case ? because in this case they approve that data import.... !!! they even have the technical points to be aware of....
My server is PHP, if you know how to help me, please let me know, I will appreciate it, and so will do the rest of Flash-PHP community people.... ;)
Thanks in advance...
Loading .swf Files Across Domains
i made web banners with the intent that the shell being the initial swf, could pull an external swf file from a remote site.
view here:
http://www.anthonythomas.com/duplicolorespn/
the main .swf file has to be under 30k, which it is. now the other .swf files load when you rollover the buttons. this method fulfills the 30k requirement on the advertisers side - also allows the creative to have higher res images/swf files hosted on our site/side.
in testing it locally, it all works great...
but when i moved the .swf file to
http://www.justinhale.com/test/
to test it -
the files hang up when you mouse over the buttons - is there a chance you could check out my source?
here:
http://www.justinhale.com/duplicolorbanner.fla
i'd really appreciate any help this forum could offer.
i checked out the security settings. security.allowDomain,
not sure if i'm using it correctly?
thank you,
jh.
additionally i've tried:
using a crossdomain.xml file with both listed domains, and wildcard settings:
seems not to be the issue: i placed a crossdomain.xml file at every level - the animation is still hanging up on the mouse rollouts - anyone else have any suggestions?
here is my crossdomain.xml file:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "
LocalConnection Not Working Across Domains
I have two movies who are able communicate with each other via LocalConnection. When I place both movies on the same domain, they can communicate as well. When I place them on different domains (A.com and B.com), they can't speak to each other anymore.
Here's what I've done so far.
1. If you look at the attached code, I think I am probably setting incoming_lc.allowDomain correcty.
2. I am placing an underscore before the ID in the connect. In the attached code it's "_someName"
I've been fighting with this for a few days; I really can't figure out what's going wrong.
Any ideas? My setup:
ActionScript 2
Flash player 9,0,47,0
Attach Code
/*
The sender's LocalConnection code
*/
var outgoing_lc:LocalConnection;
outgoing_lc = new LocalConnection();
outgoing_lc.send("_someName", "doSomething", someVar);
/*
The listener's LocalConnection code
*/
var incoming_lc:LocalConnection = new LocalConnection();
incoming_lc.allowDomain = function(sendingDomain:String) {
return true;
}
incoming_lc.doSomething = function(foo):Void {
//do something
}
incoming_lc.connect("_someName");
Edited: 11/15/2007 at 01:19:51 PM by Grinshtein
Controlling External Swf From Different Domains.
Hey there, I'm sure this is a newbie question, but I'm trying to figure out this one for almost 2 days now.
I'm using loadClip to load an external movieclip from a different domain.
This site contains an empty mc container which is called dynamically using loadAvatar() function:
http://75.112.11.105:1112/testsites/avatar.swf
loads this:
http://www.mysite.com/avatatars/head.swf
The head.swf contains a movieclip avatar_mc which has different keyframes. Now the problem is I can't control the head.swf using facePosition() function in avatar.swf
I tried to trace:
eval("avatar_" + userID + ".myAvatarloader_mc.myAvatarhead_mc")
and it trace properly. But when I included the movieclip ("avatar_mc") from the loaded movie ("head.swf"):
eval("avatar_" + userID + ".myAvatarloader_mc.myAvatarhead_mc.avatar_mc")
all i got is undefined.
Am I missing something? Hope you got it and thanks in advance.
Attach Code
function loadAvatar(userId:Number, userHead:String){
avatarDir = "../avatar/"
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this._parent);
mcLoader.loadClip(avatarDir + "head/" + userHead + ".swf", eval("avatar_" + userId + ".myAvatarloader_mc.myAvatarhead_mc"))
}
function facePosition(userID, frameNbr){
eval("avatar_" + userID + ".myAvatarloader_mc.myAvatarhead_mc.avatar_mc").gotoAndStop(frameNbr)
}
Images From External Domains.
The project that I am currently working on requires me to apply filters and use alpha masking on images from an external domain. When I test these files locally in Flash they work, but they will not work in a web browser when hosted on a server even with System.security.allowDomain() in the SWF and a crossdomain.xml file on the hosting server.
Is it impossible to apply cacheAsBitmap() effects to images from external servers, or am I just doing something wrong?
Bug: _global Vars Between Domains
Hey
I submitted a bug report on _global variables, and i just wanted to hear your opinions.
Scenario 1
1. MovieA loads MovieB from SAME domain
2 Both MovieA and MovieB contain a _global variable
Comclusion/Result:
Both MovieA and Movie B adapts the _global variables
Scenario 2
1. MovieA loads MovieB from DIFFERENT domain
2. Both MovieA and MovieB uses System.security.allowDomain("*")
3. Both MovieA and MovieB contains a _global variable
Comclusion/Result:
Both MovieA and MovieB CAN NOT access/read eachothers _global variable.
The help file says:
quote:The Flash Player version 7 and later security sandbox enforces restrictions when accessing global variables from SWF files loaded from separate security domains For more information, see Understanding Security.
I clearly read that as , you should be able to control the usage between domains , (just like any other scripting operating with domain policy )
It fails nomatter what, even with System.security.allowDomain("*") AND crossdomain.xml policy file.
.
Edited: 06/28/2008 at 01:24:00 PM by squadjot
ExternalInterface.call Across Domains?
I'm using ExternalInterface.call in a swf file to call a javascript in the html container. The swf file is located in a different domain than the html container. Everything works fine if all files are within the same root directory, but as soon as I reference the swf file located in the other domain, the call stops working! What am I missing?
swf file has this in frame 1:
import flash.external.ExternalInterface;
function clickListener(eventObj:Object):Void {
ExternalInterface.call("sendToResponseForm");
}
swf file has this on mc instance tracked as button:
on(press){
clickListener();
}
html file/container has this in <head> tag:
<script type="text/javascript">
function sendToResponseForm(){
window.location = "my.other.html.file";
}
</script>
html file has this embedded:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
Sending Vars Across Domains
Is possible to send variable from SWF which is placed e.r. on www.mysite.com/mySWF.swf to page www.myothersite.com/myphpfile.php ?
Thanks
Two Domains Pointing To 1 SWF - ERROR
I have two domains pointing to the same swf. So I have domain "A" and "B" where my swf (site) is hosted at "A". Domain "B" loads site "A".
The swf loads some vars from a DB, when seeing site directly at domain "A" I have no problems, but when seeing with domain "B", my site just freezes....giving an error at the Browser and I have to close. This is for FF and IE.
At first I thought this was cross domain policies, so I have put at my swf the following code:
Code:
System.security.allowDomain("B")
However this did not solve the problem.
Any help please?!
|