<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'AS3: Download a File to the Desktop'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Tue, 21 May 2013 23:58:36 GMT</pubDate>
<item>
<title>RubenBristian said on 4/8/11</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ Thanks! :) ]]></description>
<pubDate>Fri, 08 Apr 2011 23:28:39 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
<item>
<title>chrisaiv said on 10/31/09</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ Great work flanoob04!

Just to be clear, in your example, you are not really downloading a PDF using Flash.  You are calling a PDF file and relying on the browser to complete the remaining action.  In Firefox, the PDF may download but in Safair, the PDF will probably display. ]]></description>
<pubDate>Sat, 31 Oct 2009 17:49:18 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
<item>
<title>flanoob04 said on 10/21/09</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ thanks chrisaiv. i was able to figure out a simpler way to accomplish the task.  i'm posting it here for the benefit of whomever is struggling with a similar problem:

download_btn.addEventListener(MouseEvent.CLICK, downloadFile);
 
function downloadFile (evtObj:Event):void {  
  var Location:URLRequest = new URLRequest ("http://www.yourdomain.com/your_file_name.pdf");  
   navigateToURL (Location, "_tab");    
} ]]></description>
<pubDate>Wed, 21 Oct 2009 16:39:33 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
<item>
<title>flanoob04 said on 10/21/09</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ thanks for your help chrisaiv. i tried doing what you suggested, but still didn't get it to work. in a nut shell, i'd like to allow users to download a .pdf resume from my site by clicking on a button symbol.  i removed access specifiers, as you advised, and changed the file name to match my local file name, but to no avail. Shouldn't I be adding a button event listener somewhere?  i appreciate any help you could provide. thank you. ]]></description>
<pubDate>Wed, 21 Oct 2009 16:33:40 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
<item>
<title>chrisaiv said on 10/21/09</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ You most certainly need an Event Listener + Handler and well... this Snippet is only a fraction of what you need.  

Hopefully this will get you started:
button_mc.addEventListener( MouseEvent.CLICK, onMouseClickHandler, false, 0, true );
function onMouseClickHandler( e:MouseEvent ):void
{
buttonClick();
}

I suggest you visit another Snippet code of mine that hopefully will explain how to set Event Listeners + Handlers.  http://snipplr.com/view/5022/as3-ondragover-ondragout-onreleaseoutside/ ]]></description>
<pubDate>Wed, 21 Oct 2009 01:37:40 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
<item>
<title>flanoob04 said on 10/20/09</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ thanks for your help chrisaiv. i tried doing what you suggested, but still didn't get it to work. in a nut shell, i'd like to allow users to download a .pdf resume from my site by clicking on a button symbol.  i removed access specifiers, as you advised, and changed the file name to match my local file name, but to no avail. Shouldn't I be adding a button event listener somewhere?  i appreciate any help you could provide. thank you. ]]></description>
<pubDate>Tue, 20 Oct 2009 17:32:07 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
<item>
<title>chrisaiv said on 10/20/09</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ hey flanoob04.  In Flash CS4, if you're using the ActionScript window, you need to remove the access specifiers (aka "private", "protected", "public", etc). ]]></description>
<pubDate>Tue, 20 Oct 2009 02:38:17 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
<item>
<title>flanoob04 said on 10/19/09</title>
<link>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</link>
<description><![CDATA[ Thank you for posting the code above. I tried using it on my first as3 site (yes, total noob here) and got two errors:  "1013: The private attribute may be used only on class property definitions" and 1150: The protected attribute can only be used on class property definitions. ]]></description>
<pubDate>Mon, 19 Oct 2009 19:58:18 GMT</pubDate>
<guid>http://snipplr.com/view/12939/as3-download-a-file-to-the-desktop/</guid>
</item>
</channel>
</rss>