ActionScript 3.0 :: Cancel A Download Of A File?
Oct 13, 2009
I have a video streaming/downloading in flash. When you click play it starts the download and plays the video. If I click stop your browser still carries on downloading the file, how do I cancel or pause the download?
View 2 Replies
Similar Posts:
May 5, 2010
I have created a SWF file with three main sections. Each section has at least one video that is viewed using the FLVPlayback component. In order to reduce bandwidth, and unnecessary processes in general, I want the videos only to load if the user is currently viewing that section.
The first part is simple enough only call the source method for the FLVPlayback until the video is needed. Great, works fine. However, problems arise in cancelling the download.
I have searched the Adobe documentation, and it seems almost impossible to stop a progressive download using FLVPlayback. (To be honest, I am using FLVPlayback simply so I don't have to build my own player. Its a whole other level of complexity that I simply do not want to get into unless ABSOLUTELY needed.)
The Adobe methods that actually stop streams (closeVideoPlayer(), etc.) render the FLVPlayback instance useless once called. I was looking for a way to stop a download AND be able to use the FLVPlayback instance again.
[URL]
To test it, I created a simple file (the AS is below) with only an FLVPlayback component and a button on the stage. The button is connected to a function that clears the video and then resets the FLVPlayback instance to play the file again.
Everything works (play, pause, volume, etc.) EXCEPT that after button has been clicked and the reset function has been called, clicking the component's stop button "breaks" the player. The seekbar displays its streaming mode and clicking on any other button inside the player does nothing. (I could not recreate the problem in the Flash IDE (imagine that!), but it persistently appears when testing in a browser.)
[Code]...
View 5 Replies
May 1, 2006
I can't figure out how to make a button cancel downloads started using FileReference.Below is the code that is used to start the download. If you could let me know the right code to put in the on(release)
import flash.net.FileReference;
var listener:Object = new Object();
listener.onCancel = function(file:FileReference):Void {
[code].....
View 4 Replies
Jan 29, 2010
I am writing a script to upload and download images. I have a cancel btn that is giving me an error, undefined method.
ActionScript Code:
// First thing is to set the flashing upload message clip to invisible
uploadMsg.visible = false;
// Set the URL for the PHP uploader script
var URLrequestUp:URLRequest = new URLRequest;
var URLrequestdown:URLRequest = new URLRequest;
// Assign the image types Filter
[Code] .....
View 1 Replies
Jun 13, 2008
I have a few buttons rigged up for downloading word.doc, mp3 etc
Problem is its opening the file rather than giving a download this file option.
View 6 Replies
Jul 1, 2010
So I basically have used the fileReference class to allow the user to download a determined file if he wants to.
I use the file.download(URL) function and it works well.
However, the file is downloaded and saved to the hard drive using only the flash player. The browser is not aware of the download, and thus, if I want to show the progress of the download I'd have to make some progress bar myself. I know how to do it, but it would become really tedious and take too much UI space.
Isn't there a damn way in Flash to "send" a determined file to the browser so that it prompts the user to download it? It's an image file, so navigateToURL doesn't cut it since it will just display the image, both if I use a new tab or the current one.
View 1 Replies
Dec 6, 2010
I would like to know if there is any way to find out the destination path of the saved file using the download() method of the filereference class.Cos if that is possible then i could do navigateToURL(_path,_blank) to open that downloaded file in browser Or if there is any other way to do this i would like to know. [If any other thread exists please link to it which answers this]
View 1 Replies
Sep 27, 2009
i am new to actionscript i need to download .mp3 and vedio file form my remote server how to do this give me any example source code for this.when i download .pdf its downloading properly. but not audio.
View 1 Replies
Jun 29, 2008
I'm trying to download a zip file through Flash via a php file using this code:
FLASH:
getURL("download.php?filename=TheFileName.zip");
PHP:
<?php
// download.php
[code]....
Trouble is when I run Flash, the dialog box for the download just picks up the php file and not the zip file.
View 8 Replies
Mar 19, 2012
I'm a teacher, and so animations are a God-send. However, the internet in my school can often be a little temperamental and so I like to download flash files, often embedding them into a PPT presentation.However, as of late, I've come across a few that I just can't seem to download. Please note that I am not after the credit for these files, or any way to edit them, I just want to be able to download them to show at my will, regardless of the internet working.The file that I'm currently struggling is a great animation on rocks and the rock cycle:
[URL]
I can download the SWF, but it will do nothing but sit at "Loading: 1%"...Is it even possible to download this file?The same has been true of files over at eChalk - our school has a subscription, but again, if the internet plays up, no animations.
View 9 Replies
Mar 22, 2009
Basically I created a flash site and uploaded it onto the server provider the client chose using cute ftp. That's all fine but now they want to add a link enabling the viewer to download a PDF straight to their desktop. As I can't upload a PDF file to the Flash library, was wondering if anyone had any tips on creating this function?
View 2 Replies
Mar 19, 2010
I am working on a project where the user can click a button to download a pdf file. My issue is that it works fine, until you try to download it in IE. IE shows something happen, but then nothing happens... looks as though you download the file but then when you go to look for it, its not there. I have tried 2 different methods, both work until, like i said I bring it into IE. [code]...
View 1 Replies
Oct 24, 2008
I want my flash site to convert currency.Therefore I want it to get the currency rates from internet.At first, I wanted to do it by using web services but the one free I found : [URL] doesn't work properly So I decided to use another way by getting my rates from the
following RSS file :
[URL]
All is ok, I got the rates I am interested in by parsing the RSS .But all is ok when I am testing locally, when I put my file on my hosting server, the rates cannot be retrieved anymore, it looks as if there is a connection problem.
View 2 Replies
Apr 9, 2009
Is there a way to download a file with AS3 code from a server (other than creating a text hyperlink to be clicked), or is there a way to add a file to your library and then show it in you timeline. I am specifically referring to a .pdf file.
View 3 Replies
May 29, 2009
I want to know how to link a pdf file from flash and make it availble for download?
View 4 Replies
Feb 3, 2011
how do I initiate the download function in ActionScript3.0.? (Where a dialogue box will be opened to let my users download a file from my server)
View 8 Replies
Nov 17, 2010
In my AIR app, I have a list of file that needs to be downloaded from remote server. I want to make this download happen sunchronously. [code]...
View 1 Replies
Feb 3, 2011
I would like to do this, without the "readfile()" part:
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename="".basename($file).""");
readfile("$file");
Basically I am trying to forward a download to another URL but at the same time I need to be able to set headers like "filename".
The readfile($file) function will not do it for me, because the the $file is not stored on the same server as the PHP script (not even the same datacenter) Is this even possible ? If not via PHP, maybe FLASH could do this ?
View 2 Replies
Sep 9, 2011
how to download a pdf file with HTTPService?
I do that
private function downloadPDF():void
{
var httpService:HTTPService = new HTTPService();
httpService.url = "http://coenraets.org/flexandroid90/FlexAndroid90Minutes.pdf";
[Code]....
View 2 Replies
Jun 15, 2009
Is it possible download a file in an AIR application, store it on the user's system, and prohibit access to the files by applications other than the one with which it was downloaded?
View 3 Replies
Nov 30, 2009
how do I download file with flash, i have song wich plays and i know it's path, so what would be function for downloading that song
View 9 Replies
Sep 22, 2006
I used getURL like this to download a .doc file, in Firefox it's oke but in IE it's doesn't work.
Code:
on(release){
getURL("[URL]", "_blank");
}
View 2 Replies
Feb 5, 2008
how I would go about downloading my cv in a pdf or word format from an swf. Basically I want my cv to open as a pdf when someone clicks a button and then enable them to print it out or save it to their computer.
View 1 Replies
Jan 6, 2010
how I can protect SWF file, from being download and decompile??
do i need to purchase some software ?
View 2 Replies
Nov 8, 2009
I've built an online magazine, that has several links to videos. One page has four of them. They all work great except under one specific circumstance. If the user quickly opens a video, and closes it, moving on the to next, and doing the same, the 3rd or 4th video may appear unresponsive. I've narrowed this down to being a bandwith issue. If I look at my activiyt in Safari, the FLV files continue to download even if the user closes my player.
Is there anyway to kill this download if the user closes a player?[code]...
View 1 Replies
Mar 7, 2010
how I can make a page to dowload a file? I am making a site to allow users to dowload web templates and was wondering if I can make a the usual dowload bow apear so the user can dowload a file that I will put on the server. Is this possible with AS3? If not how can I do it?
View 2 Replies
May 18, 2010
I have a .wmv (or .avi, .mp4... ect... ) file that I want someone to be able to download to their computer by clicking a button. NOT open the file in a new window or tab... but actaully bring up a "save or open" window.
View 12 Replies
Nov 16, 2008
i am trying to make a button that when clicked will prompt the user to downalod a file to a target directory of the users choice. I have tried using URLRequest but it just opens the mp3 on another window with qiucktime which, i suspect, will happen with most users. is there a simple way to do this? i have no problem creating the button its just the function code for the button im lost on.url...
View 2 Replies
May 15, 2009
I'm making a presentation in flash. I want users to be able to click on a button and download a jpeg file.
View 1 Replies
Jan 6, 2010
how I can protect SWF file , from being download and decompile?
do i need to purchase some software ?
View 2 Replies