ActionScript 1/2 :: Swf Determine What URL It's Hosted Under?
Jan 31, 2010
Is there any way via Actionscript that I can have a swf determine what URL it's hosted under? For instance, if I put my swf on this site, I want it to behave one way and on another behave completely differently. Make sense?
I have a SWF hosted on a https enabled domain and amfphp installation on the same domain. Now when i let user embed the swf on his on http page, i intend to send some data to amfphp without user seeing it. However i see that firefox with firebug plugin catches the post data easily. How is this happening ? Adobe documents say that if a swf is hosted in https and destination is also under https, its suppose to be secure?
This code is posted in several places saying it works with paypal. For some reason, for me, it does not work - I get to paypal's homepage instead. However, the same code (sort of) works if I just use a straight html page. I don't get it.S3
Code: addcart.addEventListener(MouseEvent.CLICK, addItem); function addItem (event:MouseEvent):void
I created a swf embedded on a web document and hosted on our local server. I have no problem previewing and playing it on flash player 10 but whenever I attempted to play the same swf in flash player 9 I'm getting a popup security warning. I went ahead and registered it on the Adobe website but still with no success.
I'm looking for an AS3 function to get the filesize of a file that is being hosted on a remote webserver. Tried to find some functions but didn't succeed.
I am looking for an online photo editor like url...) or picnik.com/info/api (Flash) but I need one that I can host on my own server.. been searching for a while but no results..I also love the idea behind url... but its so expensive.
Here is the external swf loader that is commonly used and which I used
ActionScript Code: var xpos:Number = 4; var ypos:Number = 4; var swf:MovieClip; var loader:Loader = new Loader(); var presvid:URLRequest = new URLRequest("presentation/presentation.swf"); loader.load(presvid); loader.x = xpos; loader.y = ypos; addChild(loader);
The presentation.swf file plays well when I test the movie, but when I upload it to the internet to say swfcabin.com or deviantart, etc or any site which supports swf, the presentation.swf file doesnt play.
I have an external preloader that loads the game that's hosted on And let's also say that game is amazingly ridiculously popular that it exceeded the monthly bandwidth limit of my free hosting plan on that server and my account gets suspended. Then what will happen when the Loader object calls load (new URLRequesI'm planning to upload a game to a distribution website and they strongly encourage that the games be contained in one single swf. But trying to do a internal preloader is shortening my lifespan.So I plan to maybe have the game swf hosted on multiple servers and if the primary server fails due to heavy traffic or the account got suspended then the player can choose to load from a different server. I'm pretty sure that's possible..
I've embedded a virtual tour on one of my client sites.
The site is hosted by Slicehost, and as you can see the load times for the Flash movies are very slow, so my idea was to serve the swf files from Amazon S3 Europe.
To test it, I have all swfs uploaded to the same directory / bucket on Amazon, while the index.html and p2q_embed_object.js files reside on my local machine. The js file is changed to refer to the Amazon-hosted swfs. The first swf loads fine, but the others don't. What am I doing wrong? Is there a better way to do this that would allow me to serve my Flash assets from elsewhere?
i have a php page hosted on 1 domain and a flash login page on another and im trying to get the SWF on one domain to retrieve data from the php page on the other domain.If i run the SWF file on the same domain as the login script it works fine, The swf retrieves the info from PHP The current AS code is here.[code]
I am able to publish flash as long as I launch from local computer. Can't get flash to play when I publish on external server hosted by ISP. Is there another method to publish that does NOT require the Ac_RunActiveContent.js?
I used AS3 to successfully load a web-hosted video file when I tested my app. within Flash CS5. However, I published as a Windows projector EXE file and the web-hosted video won't load from within Flash Player 10 running the EXE.
I am looking for the abilities that Youtube's Chromeless player has to offer but for non-Youtube hosted videos such as Metacafe, Vimeo, Viddler, etc. Abilities I will need are :
[Code]....
Can I use Chromeless player for videos hosted on other sites besides Youtube? If not, is there a solution out there? If not, what languages/APIs would I need use and know to create such an application?
We are writing a new social app that connects to FB using FB connect (actually, it's in Flash so we're using the FB AS3 SDK, which uses the FB Javascript API under the hood AFAIK).
When the flash app is served from our site - it works fine.But when we try to embed it in a 3rd party site (using an Iframe that points to our site) the following happens: when we try to perform a login to FB using the AS3 function Facebook.login(onLogin, opts), a small browser-based login to FB pop-up comes up, but it has the following error first
Or is it possible that FB don't support FB connect apps that are embedded in 3rd party sites?
I want to create a custom video player to modify the skin of the play controls etc but still host the videos on youtube.The youtube api allows for minor colour adjustments but not full customisation. I know it would be possible if I download the FLVs but i want the video to remain hosted on youtube.
I made a quick flash document for my friend who posted it his MySpace. The document has 3 buttons, each with a URL attached to them. When I play the SWF file locally, the links work fine, however once it's published to MySpace, the links refuse to work. The hand icon comes up so it understands them at least as buttons, but it seems to do nothing when clicked in the web-browser. Also, I can open the SWF in my browser and it also works fine.
I'm using Flash CS5 and working in ActionScript 3.0.The three buttons are on one layer called "Buttons". I right click the button and click "Actions". From there, I click the "Code Snippets" and under the folder "Actions" there is an item called "Click to Go To Webpage". Here is the code it gives you by default:
button_2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_6); function fl_ClickToGoToWebPage_6(event:MouseEvent):void { navigateToURL(new URLRequest("http://www.adobe.com"), "_blank"); }
I heard there was a problem with MySpace not allowing action scripts, and after checking the source code, the value is set to not allow action scripts. I don't think it's a browser issue, since it's working fine when I execute the SWF by itself, and when I load it into Firefox. It's just seems MySpace is having a problem with it.
i need a webpage (host on my website) that can play the following mp4 file either via silverlight 4 or flash[URL]..i tried various solution like flowplayer and silverlight but none of them work with the URL above. I can play the file fine using Windows media player or VLC.
For silverlight, i always get AG_E_NETWORK_ERROR exception within MediaFailed event. For flash, via flowplayer, IE page is just blank
Can someone tell me what am i missing? i am very frustrated as I have finished encoding, upload, cataloging my videos and now I am stuck at the last step.
One server - is streaming server with Flash Media Interactive Server 3.5that host the application with asc files in FMS application directory.Second server - is the IIS web server that host thehtml,aspx,swf etc.. files.So basically i heve swf file on one server that have to connect to live streaming via rtmp on different server with different ip address.I did not find any clear explanation on this crossdomain rmtp issue.ys only HTTP can use crossdomain.xml policy filebut not rmtp.So what policy security procedure need to be done in order to enableswf file hosted on one server to connect and show rmtp live cam broadcasting from another server?
I want to update a row in mysql when a user uses an application with flash. And when they exit that application, I want to change the row to reflect that the user has left. Is there a way to do this easily? Currently, I'm thinking of writing a connection manager with sockets.
i am trying to make a photo gallery so when people click on a thumbnail it expands to full screen, my problem is i have lots of pictures and i want to determine which one has been clicked. i thought i would use the e.target in a simple if statement like this:
[Code].....
in this picture one and two are both on the stage with instance names of picture and picture2.
We generate a LOT of swfs where I work. We've got a group of people managing putting the swfs into our asset management system. These people do NOT have flash or anything adobe. However, they need to be able to determine the AS setting on the swfs. Is there a tool (preferably cheap or even free) that can be used to determine the Actionscript level of a swf?
I need to know how to tell when I've reached the end of video. I seem to recall there's a command new to flash 10 that will let you know without having to track the total bytes used or time elapsed or anything complicated like that.
Is there an easy way to determine whether a swf is being tested in the IDE? Have a number of params that change whether I'm working in development or production .. it's getting tiresome changing them .. i'ld be nice if I could do it programatically ..
I'm trying to use NetStream events from an FMS 3.5.4 server but am having trouble. I'd like to simply know when a video is playing, buffering, or idle. I know about Play.Start and Play.Stop, but these can mean the video is playing, or the video is buffering. Buffer.Full and Buffer.Flush can occur when a video is paused, playing, stopped, seeking, etc. I'm scouring over every event I get, but I really see no good way to determine what the exact state of a NetStream is at a given time.
We have a set of FMS's deployed on Amazon's EC2. One of the things we want to be able to do is automatically detect when we should start up another FMS instance. To do that, I've been looking for metrics I could measure on the local FMS box to help me identify "transition" points, e.g., when we should add capacity or remove excess capacity.
I ran some load testing to find out where the capacity limits of a particular box, but ran into a couple of problems[code]...