Flash :: Control It With Script When Different Domains?
Mar 21, 2012I have a website on my server which loads a .swf file and then I want to be able and call functions in that file from javascript.
My server has domain [url]..
I have a website on my server which loads a .swf file and then I want to be able and call functions in that file from javascript.
My server has domain [url]..
I am trying to create a login system where a user would be able to login inside of one flash game on say, [URL], and then that same login data would be preserved for all the games on [URL] and also the games on [URL] and [URL] I am new to shared objects in flash so if anybody knows of a way to do this in either php, as3, html, js (or a mixture of all) then that would be great.
(PS. I would prefer not to use a method that requires a javascript bridge to retrieve cookies as this is impossible for games that are played on game-portal sites where only a swf file is used)
I am building a flash banner ad which I will traffic among some major ad networks. Is it possible for me to track what sites (or domains) my ad has appears on, without relying on their reporting?
View 2 RepliesI have a linux distribution server, SME Server, and I use it to direct several domain names to a website on the server. My Flash program is a data driven directory that uses PHP constructed XML files to create the directory. I have been successfully using this Flash directory for some time using one particular domain, ictytranscripts.dyndns.org. I've since added a second domain name that I want to replace the first with, but for some reason the Flash program cannot read the XML files, or something. Whatever it is, the directories are not showing up.
There is nothing in the ActionScripts that have any reference to the old first domain name. I cannot imagine what is making the difference. Here is a test page showing the Flash program working successfully (I assume):
[URL]
And now the same page from different domains that direct to the same page:
[URL]
Notice that in the first the Flash program comes up, but there is no data displayed and in the second, there is no Flash program displayed at all.The XML files seem to be generated without any problems. [URL]
Let me give the context first. A user opens a local html file which has a reference to a network url of an swf file to embed.
(1) If the embed swf requests a local image file , will Flash allow the request?
(
2) If the embed swf requests an image file on a non local url other than one of the swf file, will Flash check a crossdomain.xml file on the url?
I have a SWF that contacts a php script all on the same domain. In the first case both are hosted behind the same domain and communicate with no problem. Everything is working great.However when I take the same markup that embeds the SWF and paste it on another site (using a full qualified path for the swf in both the locally hosted and remotely hosted code), the SWF no longer communicates with the php script I wrote. I added a cross domain file to my site which looks like this.
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
[code]....
I have
A.swf - located on sitea.com which loads B.swf
B.swf - located on siteb.com which loads some files from sitec.com
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="*" to-ports="80" />
</cross-domain-policy>
I have placed the crossdomain.xml (above) file on each domain root but i still get a Security Error from sandbox when accessing A.swf
securityErrorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: B.swf cannot load data from sitec.com"]
I do know that crossdomains problems are meant to be simple
I am working on a project that uses SharedObject and I have a question. I've made a button that downloads a flash screensaver and at the same time also creates a SharedObject which stores a specific id for each screensaver being downloaded. When later the screensaver is installed and run, it should get the SharedObject and read the id from it. When tested locally it works perfect since both the buttons´ and the screensavers´Sharedobject are stored in the same localPath. But when the button is online and the screensaver is local the SharedObject paths don't match.
Is there a way to solve this and make the local screensaver swf read the SharedObject from the same path as the online download button has stored it's SharedObject in?
This is the relevant code in both my swfs:
var _mySo:SharedObject = SharedObject.getLocal("name", "/");
If this won't work, does anybody have another solution to my remote to local screensaver thingy??
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. It seems strange to me as the links are absolute paths...
View 2 RepliesI just recently created a news ticker using the tutorial on Kirupa; however, I have not been successful at getting my xml data to show up on the news ticker. I have my xml file stored on and my website will be stored on Savannah State University's server. I do not want to have my xml file on the same domain as my website because it will be on my school's server and they don't allow access to their server. I want to be able to update the news ticker freely.
View 5 RepliesSo I have an SWF8 file as a player on one domain (unsecure). It loads and plays an SWF8 from another (secure) domain. So far so good. Trouble is, I need the player to send variables to the files it's playing so that links in that SWF will, well, link. I also need the player to receive some movie control commands in return. There must be a rule or two I'm violating, because while the file plays, anything that depends on a variable is just dead.
A note: Both files started out as SWF6. I understand I can only do what I'm trying to with SWF8, so I went through the code and fixed the case sensitive issues and did the conversion.
I have an application with embed swf thatis called from javascript using handleEvent, This was working fine when they were both on same domain but now when i seperated them it returns an error .
View 1 RepliesI have a.swf, which is the SWF file for my main application, and it's trying to load in b.swf, which contains some additional resources as well as some Actionscript. a.swf lives on sub1.domain.com and b.swf lives on sub2.domain.com (both on the same domain, just different subdomains.) In a.swf, I've loaded the crossdomain.xml from domain.com and also added the following code into both a.swf and b.swf:
Security.allowDomain("*");
Security.allowInsecureDomain("*");
Do I need to load crossdomain.xml in b.swf as well to prevent a security error or is having allowDomain/allowInsecureDomain enough?
Further info:
- Using Flash Player 9
- Using AS3
I have a Singleton class instantiated in Main.swf located at domainA. The file loads Game.swf from domainB via LoaderMax [URL]. When I try to access the Singleton I guess this is not the same as the on instatiated in Main.swf.
View 2 RepliesI am testing a locally run SWF (in debug standalone player) that tries to load data from a remote URL using URLLoader class. I have enabled useNetwork flag in the SWF. As I said, the SWF is running in standalone player, it is not embedded in any page in any browser.As I understand, it still cannot load any external non-visual resource, if the site it tries to load from does not have a crossdomain.xml file, or if that file does not include the domain hosting my SWF. Correct?
View 0 RepliesI 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")
I've written an app that parses Atom and RSS feeds from a few popular sites, and reacts to this data. Everything works fine when I run the .swf locally, but fails when uploaded. Is there a security setting I should be aware of?
View 1 RepliesLet's say you wanted a flash movie to load the same SharedObjects no matter where it is accessed. Is this possible and how would you set up the parent movie to transport the SharedObjects?
View 3 RepliesI've an swf (loader.swf) hosted inthat justs loads a swf (movie.swf) hostedloader.swf has a preloader. When I execute the movie in flash, it works perfect, but when I upload the swf, the preloader doesn't works. I see 0% and after starts movie.swf normally.Here is the code of loader.swf
Security.allowDomain("www.dominioB.com");Security.allowDomain("www.dominioA.com");var contexto:LoaderContext = new LoaderContext();contexto.applicationDomain = ApplicationDomain.currentDomain;var
[code].....
I've been getting this following error -- when I'm loading a subsidiary SWF into a main one.The sub swf contains the overlays. OverlayOne is a subclass of Overlay.
Code:
TypeError: Error #1034: Type Coercion failed: cannot convert OverlayOne@18684f89 to Overlay.
at HSRawVideoPlayer/setCurrentOverLay()
[code].....
I have a parent swf that loads a child swf and attempts to pass some data into the child.
The process works fine if parent and child are located in the same domain (lets say domainA.com).
As soon as I place the child swf into domainB.com and try to load it, it will load in the parent, but it is not loading the values.
Crossdomain policies are in place (the child does load!), but the params are not sent.[code]...
I put my music player to one domain and music files to the other one (i.e.:[URL]. As the player's setup is via xml file I just set there to look for that .mp3s with given url. I thought I need to put some crossdomain.xml to the domain with mp3s but meanwhile my music player doesn't need it and loads all the music from other server and plays.. So, do I need some policy file or so as I thought, or maybe my thoughts are outdated?
View 9 RepliesIs there or is there not possible to access _global variables between domains? on [URL] i have index.html and index.swf. Index.swf then loads main.swf from [URL].In index.swf i have a _global variable that i want main to use. When calling for it all i get is undefined. The only way to access it is if i call for it using _parent or _root.
I have allowed the domains to communicate using
System.security.allowDomain("http://www.Domain1.com");
System.security.allowDomain("http://www.Domain2.com");
I have also put a crossdomain policy file on both servers..cross domain policys since i CAN access the variables and functions using _parent and _root...or is it?
I'm using a working proxy.php, and passing it a url variable.
I think the problem is that the url variable I'm passing is a php file itself with a query on the end of it.
My proxy.php file sits in the same directory as the .swf.[code]...
Is it possible to control a Flash movie from JS when you have no control over the source? I have decompiled the movie to see its inner workings, but I know nothing about Flash, so I'm mostly in the dark. I found this resource, Interaction with JavaScript, but it's not working for me (probably because I don't know what message to send to the movie).
View 1 RepliesI have a flex application and have embedded a flash (SWF) file into it using <mx:SWFLoader>. There is an "Exit" button on the Flash file. I want to be able to handle the button click event on the flex application.
So when that button in the flash file is clicked, I want to perform an action in the parent flex application.
It works fine on a testing domain where the flash and the html file are located in the same folder, however, this flash banner is going to be stores on a subdomain callAs soon as it's put on the live site with the flash located in the images subdomain the link stops working. I don't even get an error message; it just doesn't do anything.We tried changing the code to:
on (release){
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
[code]......
i need to connect to two different domains from a single flex application. the problem is the domain other than the current hosted domain is unable to login. letz say i hosted the application at LOCAL server. im able to login to the local server . From the existing application i need a login to the MAIN server too. The problem comes up here. flash security is not allowing login to MAIN server. in crossdomain we allow-access-from MAIN server. but i want access to the MAIN server from LOCAL server. is ther nything i need to put extra in [URL]?
View 1 RepliesI am trying to get my flash file to load data from multiple sources/domains. It works perfectly in the development environment, but as soon as you launch the swf locally or online, it doesn't load the xml data from external domains.
[Code]...
I have two swfs for a project, I had both of them to dispatch events to each other. Parent loads child and is listening for the compete load event. Once that event is dispatched to the child - the child dispatches a start event back to the parent. I got this working by copying the ModelEvent(my custom event) in each of the flash builder actionscript projects in the exact file structure ( i think i was cheating it there, since )
It broke when I put the swf on separate domains, so I'm thinking I'm missing something to share the custom event class between two swfs.
[Code]...