How can I load and save text using FileReference class

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
I 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.
Any help would be much appreciated especially if you could point me in the direction of a relevant tutorial
Thanks

the filereference class is for downloading and uploading files.
if you want to load xml, use the xml class.
and, if you want to write to an xml file and don't want to use server-side code, wait.

Similar Messages

  • How can u insert and retrieve text files in any format using forms6i.

    how can u insert and retrieve text files in any format using forms6i.
    can u give me an example of an insert statement, let's assume the file is located in the a:drive.
    and retrieving the files, i would give the user a list of all the files that are in the database, the user would select one, but what command(or piece of code) would open the file in its apppropriate editor.
    e.g .pdf formatted file would open in acrobat.
    any help would be appreciated.
    Thanks
    Hussein Saiger

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • How can I read and write text in rings that are inside an array?

    Hello All!!!
    How can I read and write text in rings that are inside an array?
    Regards and thanks in advance.

    Use a Property Node linked to the Ring inside the array.
    Of course, all elements in the array will have the same text values.
    B-)
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:47 AM
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:48 AM
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:49 AM
    Attachments:
    Strings-BD.PNG ‏17 KB
    Strings-FP1.PNG ‏23 KB

  • How do I load and save to my iMac a dvd purchased elsewhere?

    how do I load and save to my iMac a dvd purchased elsewhere?  Thank you.

    The mods here are adverse to mentioning software to duplicate commercial media, which is called "ripping." However, you can search outside of this forum for the software you need.

  • HT1296 How can I capture and save an image on my screen for later retrieval

    How can I capture and save an image on my iPad screen for later retrieval, perhaps on my Laptop (Windows 7)?
    Is there a way to copy the image to a storage device?
    Thanks, Don.

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    Its easy to take an iPad screenshot. Press & release the Home and the Power buttons quickly at the same time. I have trouble with that so I press & hold the Home button and then very quickly press and release the Power button. Your screenshot is stored in the Camera Roll of the Photos app. Probably the easiest way to get it to your PC is to be using iCloud, or email it to your PC. There are also some wireless sync apps in the iTunes app store that let you send photos from the iPad to a Mac or PC. I use PhotoSync.

  • HOW CAN I GROUP AND DELETE TEXT MESSAGES IN BULK

    HOW CAN I GROUP AND DELETE TEXT MESSAGES IN BULK

    message - edit - select each text message - delete.
    that is the only method to delete message on your iphone.

  • How can I copy and paste text into Word in Acrobat 9 Pro

    How can I copy and paste text into Word from Acrobat 9 Pro?

    You might find it easier to export the file to Word under File > Export > Word in Acrobat 9.

  • How can i edit and save a spreadsheet or excel sheet on my MACbook pro

    how can i edit and save and rename excel or spreedsheet on my macbook pro

    Just download LibreOffice and click on the Spreadsheet icon in the splash screen:
    ...and it will open almost any Excel document...
    (This is an old football roster created in Excel).
    Good luck,
    Clinton

  • How can I edit and save parts of songs (like a chorus).

    How can I edit and save parts of songs (like a chorus).

    The iTunes-only way is:  figure out where you want your excerpt to begin and end.  Right-click the track, Get Info, Options tab, set the Start/Stop times accordingly, and OK out.  Right-click again, and choose Create XXX version (where XXX is the format indicated in your Import settings).  Right-click one more time, and unset the Start/Stop times.
    This procedure will leave the full track in place, and will create a new file and library entry with just your excerpt.

  • How can I design and send emailers using Adobe Muse?

    Hello Geeks,
    How can I design and send emailers using this wonderful software called Adobe Muse?

    Hi
    Are you referring , creating email templates or sending marketing campaigns ?
    We cannot create templates as Muse doesn't output HTML optimized for e-mail output.
    Regarding email campaigns, you can setup this from hosting platform end.
    More details :
    https://forums.adobe.com/message/5469744
    Re: Is it possible to create email templates using Muse?
    Thanks,
    Sanjit

  • How can I edit and save a raw file in jpeq and open it in windows live photo gallery

    how can I edit and save a raw file in ps elements 10 and open it in windows live photo gallery?

    Change to 8 bit mode before clicking the Open Image button, then jpeg will become available as a choice.
    Click to view image

  • Youtube Videos: How can I download and Save?

    1. Where's the internet connection sign in desktop of MacBook Pro?
    2. How can I download and save videos from Youtube?

    See my reply to your other post for connecting to WiFi : https://discussions.apple.com/thread/5513072?tstart=0
    For YouTube, try doing an internet search or having a look in the Mac App Store app on your Mac
    Or try asking in Mac App Store or Mountain Lion forums - this is the iTunes Store forum.

  • In my Thunderbd 24.4.0-Windows7-how can I copy and save to DVD all the emails? Unlike in previous Thundrbd they no longer come up in Defaults under Mail.

    In my win XP, after Profiles to Default with all those numbers, then Mail, up came Local Folders which contained all the current emails, which were then easily open-able and save-able.
    How can I now do the same with my newer thunderbird on my windows 7?
    Thank you

    Thank you - I now can find the Mail folder, and then only when I select : pop3.virginmedia-1.com (my server) from it's 3 choices, does it show all my email folders. They are all in 2 versions. Those ending .msf I cannot open as they are "not a valid Win 32 application". The others with a little page icon, do all open - in Wordpad or Libreoffice, but the messages are almost totally lost amongst dozens of complex data pages before and after each little actual message! How can I open and see just the actual email messages without all the vast other data, so that I can then save them to a DVD?
    Thank you,
    Ted

  • Load and save text file???

    hi,i've this program works as far as i know.what i need to do now is load the file when the program starts and saves any updates made when i exit the program to the text file called "PublicationList.txt" how can i do this?i dont know where to start.if someone can show me the code to put in so it works that would be what i need please.thanks alot if you can help.
    The text file look contains the information as so:
    PubID 1 Pubname Times Pubtype National Pub UM Status A PPR 50
    PubID 2 Pubname Guardian Pubtype National Pub UM Status A PPR 60
    PubID 3 Pubname Sun Pubtype National Pub UM Status A PPR 30
    public class publication
    public int PublicationID;
    public String publicationname;
    public String publisher;
    public String PricePerIssue;
    public String pubstatus;
    public String publicationtype;
    public publication(int NewPublicationID, String Newpublicationname, String Newpublisher, String NewPricePerIssue, String Newpubstatus, String Newpublicationtype)
    PublicationID = NewPublicationID;
    publicationname = Newpublicationname;
    publisher = Newpublisher;
    PricePerIssue = NewPricePerIssue;
    pubstatus = Newpubstatus;
    publicationtype = Newpublicationtype;
    public String toString ()
    String pubreport = "---------------------------Publication-Information-----------------------------\n\n";
    pubreport += "Publication ID:" PublicationID" Publication Title: " publicationname"\n";
    pubreport += " publisher: " publisher " price Per Issue: " PricePerIssue"\n";
    pubreport += " publication Status: " pubstatus " publication Type: " publicationtype"\n";
    return pubreport;
    public void SetPublicationID(int PubID)
    PublicationID = PubID;
    public int GetPublicationID()
    return PublicationID;
    public void Setpublicationname(String pubname)
    publicationname = pubname;
    public String Getpublicationname()
    return publicationname;
    public void Setpublisher(String Pub)
    publisher = Pub;
    public String Getpublisher()
    return publisher;
    public void SetPricePerIssue(String PPI)
    PricePerIssue = PPI;
    public String GetPricePerIssue()
    return PricePerIssue;
    public void Setpubstatus(String Status)
    pubstatus = Status;
    public String Getpubstatus()
    return pubstatus;
    public void Setpublicationtype(String Pubtype)
    publicationtype = Pubtype;
    public String Getpublicationtype()
    return publicationtype;
    import java.util.*;
    import publication;
    public class PublicationContainer
    LinkedList PubList;
    public PublicationContainer()
    PubList = new LinkedList();
    public int add (publication newpublication)
    PubList.addLast(newpublication);
    return PubList.size();
    private class PubNode
    public publication pubrecord;
    public PubNode next;
    public PubNode (publication thepublicationrecord)
    publication p = thepublicationrecord;
    next = null;
    public String toString()
    return PubList.toString();
    public void remove(int PubID)
    PubList.remove(PubID);
    public publication get(int PubID)
    return (publication)PubList.get(PubID);
    public void set(int PubID,publication newpublication)
    PubList.set(PubID, newpublication);
    import cs1.Keyboard;
    import publication;
    import java.util.*;
    public class publicationmain
    public static void main(String args[])
    PublicationContainer pubdatabase = new PublicationContainer();
    int userchoice;
    boolean flag = false;
    while (flag == false)
    System.out.println("------------------------------------Publications--------------------------------");
    System.out.println();
    System.out.println("please Make a Selection");
    System.out.println();
    System.out.println("1 to add publication");
    System.out.println("2 to delete publication");
    System.out.println("0 to quit");
    System.out.println("3 to View all publications");
    System.out.println("4 to Edit a publication");
    System.out.println();
    userchoice = Keyboard.readInt();
    switch (userchoice)
    case 1:
    String PubName;
    String PricePerIssue;
    String Publisher;
    String Pubstatus;
    String Pubtype;
    int PubID;
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype = Keyboard.readString();
    pubdatabase.add (new publication(PubID, PubName, Publisher, PricePerIssue, Pubstatus, Pubtype));
    break;
    case 0:
    flag = true;
    case 2:
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    System.out.println ("publication: "+(PubID)+" removed");
    System.out.println();
    break;
    case 3:
    System.out.println (pubdatabase);
    break;
    case 4:
    System.out.println ("Enter Publication to be edited by Publication ID: ");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    String PubName1;
    String PricePerIssue1;
    String Publisher1;
    String Pubstatus1;
    String Pubtype1;
    int PubID1;
    System.out.println ("Enter Publication ID:");
    PubID1 = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName1 = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher1 = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue1 = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus1 = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype1 = Keyboard.readString();
    pubdatabase.add (new publication(PubID1, PubName1, Publisher1, PricePerIssue1, Pubstatus1, Pubtype1))
    break;
    default:
    System.out.println("Incorrect Entry");
    }

    public void readFile()
         BufferedReader br = new BufferedReader( new FileReader("PublicationList.txt") );
         String row;
         while( (row = br.readLine() ) != null)
              StringTokenizer st = new StringTokenizer(row," ");
              String temp = st.nextToken();
              String pubid = st.nextToken();
              temp = st.nextToken();
              String pubname = st.nextToken();
              temp = st.nextToken();
              String pubtype = st.nextToken();
              temp = st.nextToken();
              String pub = st.nextToken();
              temp = st.nextToken();
              String status = st.nextToken();
              temp = st.nextToken();
              String ppr = st.nextToken();
              // now you have in the Strings the values you needed
              // so what you want to do now
         } // read next line
         br.close();
    }try the writing on your own.
    tobias

  • How can I find and change text in Hyperlinks?

    I have 6000 hyperlinks in my document, I need to change all of the "&" they contain (in the url destination, not in the textflow) to "%26" so I can export to Epub correctly (I'm getting the classic "Export failed" and found out in forums that ampersands in hyperlinks are the problem).
    Can this replacement be automated? Maybe with Javascript? I just don't know how to search just through hyperlinks' text (url).
    Thanks a lot.

    It's perfect! Thanks a lot again!
    2011/7/19 John Hawkinson <[email protected]>
    Oh, incidently, Harbs has a script that does this with a UI.
    >
    >
    http://in-tools.com/downloads/indesign/scripts/ReplaceHyperlinkUrlValues.jsx
    >
    It's basically the same thing, but maybe a bit more user-friendly.
    >

Maybe you are looking for