ActionScript 3.0 :: Making FileReference.save() Even Nicer

Dec 3, 2010

I am using FileReference,save() to save a file to the local HDD. It works. But it could be nicer. When I issue the command, I get a dialog box displayed and the title is "Select location for download by localhost". I can't see any documented way to change that title. The file I want to save has been created locally - there is nothing to download.

Also, the dialog lists "All Files" and there does not be any way to filter to a particular file type - although I can specify a default file name (including the extension). I suspect that these are features of the current implementation - not a lot of people read the title of the dialog box anyway. But if they can be changed, I'd like to know.

View 1 Replies


Similar Posts:


Flex :: Bypass The Save Dialog Box Of FileReference.save?

Jul 6, 2011

Can we Bypass the save dialog box of FileRefernce.save()? If not, then Is there any workaround to save a file from web application in Flex without asking user where to save file?

View 1 Replies

ActionScript 3.0 :: Save Images With My MyProject.as With FileReference.save?

Dec 20, 2010

i have movie clip with Images and button Save and class MyProject.as how save images with my MyProject.as, with help FileReference.save? what to write in code? how code should look like? tell me good people I want to write everything in a separate class

View 3 Replies

ActionScript 3.0 :: Get Rid Of Save Dialog Box In Filereference.save()?

Sep 22, 2010

Is there a way to get rid of the save dialog box in filereference.save()?I want to specify the filename and location rather then letting the user do it.

View 6 Replies

Flash :: Save A Download Without Filereference

Dec 2, 2011

Is there anyway to download a file with the URLLoader and then save it to the disk without using filereference or anything that uses a dialog? This is what I have but isn't working:

[Code]...

View 2 Replies

ActionScript 3.0 :: FileReference Save As Filetype

Sep 18, 2010

Is there any way to set the filetype you want to save to with the FileReference class? I'm creating PNGs for users to save to their hard drive, but I don't really want them to have to specify an extension. If they don't, the images are just saved as generic files, which is a bit crappy.

View 4 Replies

ActionScript 3.0 :: Filereference.save And File Extensions?

Feb 13, 2009

I'm using Filereference.save() to save a jpg file. It'sbasically working fine, but is there anyway to force a fileextension on the saved file? I'm using "untitled.jpg" as thedefault filename, but if the user changes it to say "myfile", itgets saved as "myfile", rather than "myfile.jpg".

View 11 Replies

ActionScript 3.0 :: FileReference.save() Causing Crash?

May 16, 2011

I'm currently using the FileReference class to allow users of my program to save and load files from their PC. I'm currently trying to get the save function to work (I'll do load later) and it all seems to be working perfectly but while testing it (locally) it crashes Flash Player every time it saves.
 
The code is pretty simple just now (this is contained in an event handler which triggers when the save button is pressed):

var levelData:String = GetLevelData();var outputFileName:String = "NewLevel.txt";
saveFile = new FileReference();
saveFile.addEventListener(Event.COMPLETE, SaveCompleteHandler);
saveFile.addEventListener(IOErrorEvent.IO_ERROR, SaveIOErrorHandler);
saveFile.save(levelData, outputFileName);

And it all works fine - the NewLevel.txt file appears where I want it to and contains the correct data. But as soon as this has completed Flash Player quits and I get the 'Flash Player Quit Unexpectadly' message. There are no errors in the output from my code. The SaveCompleteHandler function has been called and the SaveIOErrorHandler function has not.

Could this be a bug in Flash player? I'm using a Mac and have encountered a few bugs with the Mac version so I wouldn't be surprised if this was another one.

View 1 Replies

Flex :: Workaround On FileReference.save Dialog Box

Dec 14, 2010

Im still new in Flex and currently working on capturing a flash game into a flv video file. Im using FileReference.save() to write the captured file in the user's system. It is working as of now but not the way I want it to be.Is there a way to bypass or automate the save dialog box when invoking the save() api of fileReference?

View 1 Replies

Flex :: Unhanndled IO Error On FileReference.save()

Mar 4, 2011

I am using a filereference Object to export an excel file from my flex application. I am using fileReference.save() from Flash player 10. I am getting an error if the file i am trying to save is already open. This error is not getting handled even if i put a try catch block. I have tried adding a listener with IOErrorEvent.IO_ERROR. Still the error is happening. This is the Error message i am getting - "Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error."

View 1 Replies

Actionscript 3 :: Getting An Error In FileReference.save Method?

Jan 10, 2012

I am currently working in Flex 3.0 I am getting an error(screen shot is given below). I am using Flash Player Version 10.0Currently I am calling the HTTPService and in the resultHandler of that HTTPService i am getting an error in method filereference.save() .because this method is called only when the MouseEvent or Keyboard event is occured.Is there any solution to overcome this situation or in other words calling the filereference.save method in ResultHandler.

View 3 Replies

ActionScript 3.0 :: Filereference To Save File Locally?

Jun 30, 2011

This code:

ActionScript Code:
import flash.events.Event;
var file:FileReference = new FileReference();
 saveBtn.addEventListener(MouseEvent.CLICK, onClick);[code]....

will save a text file to a location I choose, containing the text I wrote in the text field. But it prompts me for the location. Is there a way to save the text just locally next to the swf without the prompt?

View 3 Replies

ActionScript 3.0 :: XML - Save Xml File With CDATA Tag Using FileReference?

Feb 23, 2012

I'm trying to create a XML file in actionscript which will be saved out using FileReference and will then be loaded in later by another SWF.The problem I have is that I can't figure out how to have the actual CDATA tag in the saved XML file so that I can output html tags in the text.e.g.

var xml:XML = <data>
<text> <![CDATA[ This is some <b>bold</b> text ]]> </text>
</data>

View 2 Replies

ActionScript 3.0 :: FileReference Save Without Prompt (offline)

Oct 12, 2010

I'm creating a offline application that needs to save out XML file to the user's computer. I normally use Zinc to handle all saving, but I've just remembered that FP10 has FileReference, is there are way to invoke the save with out the dialog box displaying?

View 4 Replies

ActionScript 3.0 :: Load And Save Text Using FileReference Class?

Feb 20, 2010

Let me start by saying I have no intention of using php and I can't wait until flash cs5 comes out with its new read/write capabilities want to load and save XML files (stored on my local hard-drive) in AS3.I am using the FileReference class.Firstly I have noticed that when using FileReference.save if you replace an existing file instead of writing over the file data is appended to the end of the file. Can I make it so the file is overwritten (as it should be) or make it impossible for the user to save in such a situation.Secondly I want to load in text from an external file using FileReference.load I know that somehow you use FileReference.browse first to get it to work but I want to know exactly how to do it.I have looked for a tutorial about loading text in this manner and have not found one.

View 5 Replies

ActionScript 3.0 :: FileReference.save Does Not Work Well With Chinese Word

Sep 1, 2010

I have one application that needs saving some text to local file folder, the text may include chinese words, and i found Flex's FileReference.save can do the job. But the problem is when i opened the saved file with Wordpad, the chinese words does not show correctly, but Notepad can show the text correctly.
 
From Adobe's help document about FileReference.save, "If the value is a String, it is saved as a UTF-8 text file."So i think it is probably an encoding problem, but why Wordpad and Notepad behaviors differently, did they use different encoding? what encoding did they use ?

View 1 Replies

AS3 :: FileReference.save() Works When Testing Locally But Not In The Browser?

Feb 15, 2012

I have created a painting app and when the user want's to save his drawing he simply hits the save button and a dialog pops up - or should do.

When testing locally on dev machine it's no problem but whenever the app is loaded in a browser it won't work. Even if I load the local SWF file in a browser it won't work.

The following code is what I use to save the file and as said it works fine locally but whenever it goes into a browser it dosen't.The save dialog simply never pops up.

var bitmapData:BitmapData = new BitmapData(canvas.width, canvas.height);
bitmapData.draw(canvas);
var jpg:JPEGEncoder = new JPEGEncoder(100);

[Code]....

View 1 Replies

ActionScript 3.0 :: Flash FileReference.save() - File Extensions?

Jun 18, 2010

I'm using FileReference.save() method for Flash10 to save a file. It looks like this:

Code:
fr.save(BytesArray, "default.xml");
When I use default name - everything is ok. But when I change file's name in "Save Dialog

[code].....

View 2 Replies

Flash Saves File On Windows - Not Linux - FileReference.save()

Aug 13, 2011

The code below compiles fine on the Flex 4 SDK on Fedora 15. Mouse-click opens the dialog box, I click okay, and a file is saved, but the file is empty. I run the same SWF file (that was compiled on the Linux machine) on a Windows machine, and the created file contains the expected data. I was thinking there was a permissions problem, but if that were so, why should Linux even let me save the file? It is going to slow things down immensely if I cannot code something and test it on the same machine...

[Code]....

View 3 Replies

Flex :: Flash Player 10 Filereference.save And File Extensions?

Jun 8, 2010

I'm using Filereference.save() to save a XML file. It's working fine with default filename.But is there a way to force a file extension on the saved file? I'm using "untitled.xml" as the default filename, but if the user changes it to say "myfile", it gets saved as "myfile", rather than "myfile.xml".

View 1 Replies

Actionscript 3 :: Save Local File In Flash Projector Using FileReference?

Nov 18, 2010

I'm making a Flash projector which will be distributed on CD. I want to allow people to copy files off of the CD. Is this possible? Should I be using FileReference?

View 1 Replies

AS3 :: Flash Alternative To Locking File Type On FileReference.save

Jun 30, 2011

limiting or correcting the behaviour of FileReference.save isn't possible.Can anyone suggest an alternative (server is Apache/PHP) that matches all of my criteria from this post and avoids the pitfalls I discussed with Jacob?I'm saving an image from my AS3 app using FileReference.save(). This is the code, which works fine:[code]This opens up the save file dialog as expected. I'm using this rather than sending the byteData to PHP because I want the user to have a familiar dialog box that lets them set their own file name.

The problem comes when users have their operating system configured to display file extensions, like I do. This means that in the save dialog the file name contains the extension as seen in the image below, and so it is very easy for the user to delete that extension when they rename the file. Because the default file type for this box is 'All files', if the extension is deleted the file is saved with no type.I don't know of any way to force a file type on the save dialog (if there is one that would be my preferred route) so failing that can anyone suggest a safe way for me to do this that still allows the user to set the file name themselves using a standard dialog for their OS?I did try putting in a call to FileReference.browse() before the save() as shown in this tutorial, but that throws an error because you can only perform one FileReference call at a time.

View 5 Replies

Actionscript 3 :: Flash Saves In Windows Not In Linux / FileReference.save

Aug 14, 2011

The code below compiles fine on the Flex 4 SDK on Fedora 15.Mouse-click opens the dialog box, I click okay, and a file is saved, but the file is empty.I run the same SWF file (that was compiled on the Linux machine) on a Windows machine, and the created file contains the expected data.Then I broke the FileReference declaration out of the function into the class level, hoping to avoid a known bug, but the same problem persists.Hoping to set up a workaround, I added the debug Flash player to my path and ran the file from Flash without the benefit of the browser, and it works.So now a Flex problem has become a Firefox problem, maybe owing to a shady procedure I used to install the plugin without really understanding what was happening.I am running Firefox 5.0.In essence my workflow is fixed, but perhaps people who performed the above will not be able to use projects with FileReference.save()?[code]

View 1 Replies

Actionscript 3 :: Flex's FileReference.save() Can Only Be Called In A User Event Handler

Jul 21, 2010

I need to call FileReference.save() after a web service call has completed, but this method has a restriction: "In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an Error exception." (from the documentation here)

This restriction is a bit vague. Does it mean that I can only call the FileReference.save() method from within an event handler function that is registered as a listener for certain types of user events? If so then exactly which user events are valid? (Perhaps there's an event that will never be dispatched by user interaction with my application and I could register an event handler function for that event type and make the save() call from within that function?)

My difficulty is that I can't safely call the FileReference.save() method until my web service returns with the data that will be used as the argument of the FileReference.save() method call, so the event that triggers the FileReference.save() call is actually a ResultEvent rather than a user event, and I'm leery of dispatching a new (faux) user event type in order to be able to trigger the FileReference.save() call unless it's definitely a user event that would never be dispatched as a result of actual user interaction with my application.

In a nutshell what I'm doing now is this: I have a function that is registered as a handler for a button click. In this function I make my web service call to fetch data from the server. I also have a result handler function which gets invoked when the web service call completes, and it's in here that I want to call the FileReference.save() method since it's at this point that I know that the data is ready to be saved to a file. But the aforementioned restriction is blocking me from doing this -- I get an error:

Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.

I've tried many things to get around this such as creating a second mouse click event handler function with the FileReference.save() call within and calling it after a timeout interval (to give the web service time to complete), but I keep running into the same error -- maybe that approach doesn't work since the second function isn't registered as an event listener for the event type used as its argument.

View 3 Replies

ActionScript 3.0 :: Set A Default Extension When Saving An Image Using FileReference Save Method?

Nov 3, 2009

Is there a way to set a default extension when saving an image using FileReference save method?

Code:
var fileReference:FileReference = new FileReference();
fileReference.save( pngData, "image.png" );

If windows is set to "hide known file extensions", only image without extension will be displayed in save dialog. File type is "*.*". Some of my users hat the great idea to add .jpg extension in filename, because they couldn't see one. So file was saved broken as image.jpg.

View 1 Replies

ActionScript 3.0 :: 1061: Call To A Possibly Undefined Method Save Through A Reference With Static Type Flash.net:FileReference

Oct 6, 2009

I am trying to get simple example of it running. I can make it work if I publish in FlashPlayer10, but not FP 9

[Code]...

The reference material says Language Version : ActionScript 3.0Runtime Versions : AIR 1.0, Flash Player 9 Does this mean the AIR 1.0 and Flash Player 9 or what is the deal?the compile error is... 1061: Call to a possibly undefined method save through a reference with static type flash.net:FileReference.

View 4 Replies

Flex :: Error 1061 Call To Possibly Undefined Method Save Through A Reference With Static Type Flash.net:FileReference

Jun 2, 2011

I want to save XML File using Flex 4 SDK

var fr:FileReference=new FileReference();
fr.save( newXmlRow, 'D:/Sample.xml' );

Error Shows :

1061 "Call to possibly Undefined method save through a reference with static type flash.net:FileReference"

View 2 Replies

ActionScript 3.0 :: "screenshot" With BitmapData.draw And FileReference.save?

Sep 20, 2009

I made this dress-up type game, and have been trying to figure out how to let the user save an image of their creation. I've been researching and figured out I need to use bitmapData.draw and fileReference.save in the actionscript somewhere. The only problem is I want this to be a standalone .swf if possible. The 'game' is here. This is part of my code:

[Code]....

View 8 Replies

ActionScript 3.0 :: Making A Save Game Class?

Sep 26, 2010

I am an amateur programmer attempting to make an adventure game and I need a little help. The basic setup is a panoramic engine that loads external swf's when you click on a specific area. I need a way to globally store the states of the puzzle variables so that you can save your progress.The basic idea for my save game class is as follows:

[Code]...

View 7 Replies

Professional :: Switch Between WebcamsRecord And Save To The ServerWhen Making It Similar To Youtube's?

Apr 8, 2011

Have screen filled as much as possible with webcamBe able to go full screenJust keep it simple!Work out a way of giving you credit without putting stuff on the fullscreen version (I will not be distributing it commercially)Some things that would be kind of cool to add (both inspired by youtube's webcam thing)Ability to switch between webcamsRecord and save to the serverWhen making it similar to youtube's try to stay simple!

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved