Prompt user to save or open a document from Adobe Flash, for Adobe Air application

Posted on 2011-02-27
Last Modified: 2013-11-11
I'm using Flash to create an Adobe Air application.  I need to create a link that when clicked will prompt the user to save or open a .doc, .ppt, or .xls file.  Just like html would if a link was directed to that file.  I'm aware that air won't launch an external file or program but is it possible to prompt the user to 'save' the file?
Question by:markus7878
  • 3
  • 2
LVL 20

Expert Comment

ID: 34991246

Author Comment

ID: 34992969
It seem the 'fileReference' object will only allow you to point to images, .xml, or .txt files.  If referencing .docx or .ppt nothing happens
LVL 20

Accepted Solution

ChristoferDutz earned 500 total points
ID: 34993219
There should be no restriction for this.
Have a look at the followin line:
file.browse(new Array(new FileFilter("Images (*.jpg, *.jpeg)", "*.jpg;*.jpeg")));

Open in new window

Simply change this to
file.browse(new Array(new FileFilter("Images (*.docx, *.ppt)", "*.docx;*.ppt")));

Open in new window

Or use it without any filter to allow any file type.
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.


Author Comment

ID: 35033512
The above solution uses the 'URLrequest'
public function ImageSave() {imgFile = new URLRequest("coffee.jpg"); //change it to your image path

Open in new window

'URLrequest' will only work with image, or .pdf file when exporting flash as an air application.
When using the the 'URLrequest' and referencing a .ppt file it simply opens a blank window, in adobe air, rather than launching the application or prompting the user to save the .ppt file to their hd.
LVL 20

Expert Comment

ID: 35034195
Well the problem is not Flash from not loading the PPT, its simply that flash cannot display a PDF or PPT. The download works great with URLRequest.
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 36321177
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Inserting a pop up image to a scanned PDF 5 445
SWF won't scale? 4 523
how do I install adobe flash player on my ipad Air? 4 42
PDF: Display my cards game? 8 110
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now