Action Script 3 Redirect to url Variable - actionscript-3

I have made a flv file that plays a movie. Swf is loaded automatically before the site loads. When the movie ends i want to redirect back to a website url. Problem is that the website that I redirect back is not static.
But I know the url of the site from the url bar. Example:
The url is loaded here: http://myad.com
Current url adress: http://myad.com/reloader.html?ADURL=http://www.website.com/test.asp&
So I want at the last frame of the swf, to be redirected back to www.website.com
Any ideas what action script 3 code I need to use;
Thank you
edit: corrected adurl

Related

Facebook debugger not updating image correctly

I'm using the debugger and scraping and scraping and scraping but the image won't update. It's grabbing the correct image URL in og:image when I debug it, and I've checked the URL and it goes to the correct image, but for some reason every single time the link preview is showing the old image.
Everything I've read just tells me to go to the debugger and rescrape it and it should just be voila! new image. Am I missing something?

Async document download in browser

We have a web app with html pages 1>2>3
Page 2 has a link to download a pdf - I've used an anchor tag in the form to do this. The response is of type application/pdf. If I wait on page 2 my pdf eventually shows as downloaded, however I want to be able to move to page 3 with the pdf download happening asynchronously...
I can get the server to do it but as soon as I request page 3 the browser (Chrome) shows the GET request (for the pdf) as status: (canceled) :-(
I've tried both HTTP Request and AJAX Request (type: document and xhr) any suggestions?
So far I can only get it to work when the request is in a new tab - but that's not what I want as the pdf is downloaded and not opened in the new tab.
If your app is SPA, you can create an iframe and set src attribute with the download url.
If it is not SPA, and you used anchor <a> tag then use target="_blank" attribute to download it from a new window in which case, new tab will open and starting the download and the tab will be closed by letting the download happened in the background so that you can change anything on the main page.
If you want to download rather than show the pdf, I'd look into getting the server setting the http response header
Content-Disposition: attachment; filename="yourname.pdf"
so the browser should suggest "save as" and open a dialog to choose the save location - the download will usually continue running when navigating away from the page where the download was initiated.
I'm sorry I have no idea if you can achieve this purely on the browser side.
Solution to my problem was to get access to the HttpServletResponse (server side), set the header content type ("application/pdf") and disposition ("attachment;filename='...'") and flush the outputStream.
This must happen ahead of writing the PDF byte array to the outputStream.
The above allowed the browser to show my PDF download as 'started' and I could then navigate away from that page while the download continued.

as3 check if youtube link exists

I want to give users of an app the possibilty to post a video from youtube by entering an url in a textfield. To ensure that the link exists, I want to check the url.
I only found examples to check if an external file exists but not how to check a simple www link. How can I check this?
Youtube doesn't really have a 404 page, so you'll always end up loading a page...
I don't know how you'll be loading the page...whether javascript will come into play once the page is loaded and take the argument of the video id...
But if all that goes through.... You'd want to look for this sniped of data in this div to determine whether or not the video exists.

Redirection with chrome extension

I'm really new to the chrome app dev part. I want to know how can I make a chrome application that will read my current URL and redirect me to another.
For instance if I am on www.stackoverflow.com and user clicks on the extension icon then it will redirect him to wwww.stackoverflow**NEW**.com
Thank you..
Follow these steps and you will be good.
Create a background script and define an entry for background script in manifest.json
In background script, define a handler on chrome.browserAction.onClicked.
Inside that handler, extract the url of current tab and check if it is the expected url, then just change the url of that tab.

Hide mp3 url while playing audio file

I have a webpage that offers dynamic downloading of mp3 files through mobile phones. I would like to add a feature where someone can listen to the song through their desktops before downloading the file.
The challenge is, I don't want the mp3 file link to be displayed in the page code, I would prefer a different url e.g
<a href='http://mysvr.com/getfile/121233444/'>Preview song</a>
which is passed on to a player that expects an mp3 file source and get it to play the file.
I don't want the person previewing the file not know the real url of the file that is playing to prevent unauthorised downloads.
What do I need to do?
First deny all the access to the directory which has mp3 files through the internet. Then write a handler file to play the mp3's. The handler file will get the name of the mp3 from query string and play the file on player. Taking the url , parsing and playing will be done in codebehind so users wont be able to see the url of the mp3
hope it helps.
This would depend on your setup. The only real way to not make it visible would be to use server side code (php, asp etc). Any client side code is by definition visible to the end user. You could try to obfuscate the link e.g. using some minimized JavaScript hidden away somewhere, but it will always be visible to anyone who searches hard enough.