Editing .txt files inside flash

Right now, I have it set up so that each button on my flash will open up a .txt file. I want to have it set up so that the user can not only read the txt file but edit it and save it to the original .txt file. My current code looks like this:
dMemo.addEventListener(MouseEvent.CLICK,displayD);
lMemo.addEventListener(MouseEvent.CLICK,displayL);
function displayD(e:Event):void{
txtloader.load(new URLRequest("design_vocab.txt"));
function displayL(e:Event):void{
txtloader.load(new URLRequest("logo_design_tips.txt"));
var file:URLRequest = new URLRequest("instructions.txt");
var txtloader:URLLoader = new URLLoader();
txtloader.addEventListener(Event.COMPLETE, loadtxt);
txtloader.load(file);
function loadtxt(event:Event):void{
memotext.text = txtloader.data;

you should use the filereference class to load and save text files that you want to edit:
var s:String;
var fref_load:FileReference = new FileReference();
var fref_save:FileReference = new FileReference();
fref_load.addEventListener(Event.COMPLETE, loadcompleteF);
fref_load.addEventListener(Event.SELECT, selectF);
fref_load.browse([new FileFilter("Text", "*.txt")]);
function selectF(e:Event):void {
    fref_load.load();
function loadcompleteF(e:Event):void {
    s = e.target.data;
    // now edit the string s and when you want to save the updated text, call saveF();
function saveF():void {
    fref_save.save(s,fref_load.name);

Similar Messages

  • How to open and edit "*.txt" file with "Notepad"

    Hello guys!
    I'm facing problem with SharePoint 2010 Enterprise and got no clue how to solve it.
    What I want to do is to open "*.txt" (which is placed to "Documents Library") in "Notepad", so I could edit it and save (publish) directly to SharePoint from "Notepad".
    If I upload any Microsoft office File, such as "*.docx", "*.xls", etc - it works as it should - document opens in appropriate application and everybody is happy.
    But, when I create documents library, put some "*.txt" file there and click on it - it opens in new browser's tab as text, so I cannot edit the file.
    What I tried to do is to activate feature "Open Documents in Client Applications by Default" - not happy.
    Edit "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML\DOCICON.XML" - I've modified "txt" entry as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <DocIcons>
        <ByProgID>
        </ByProgID>
        <ByExtension>
    <Mapping Key="txt" Value="ictxt.gif" EditText="Notepad" OpenControl="SharePoint.OpenDocuments"/>
        </ByExtension>
        <Default>
            <Mapping Value="icgen.gif"/>
        </Default>
    </DocIcons>
    Still not happy.
    So, how do I make this stuff work?

    Found this link which has more information on this scenario:
    http://sharepoint.stackexchange.com/questions/1427/open-txt-file-in-notepad-from-sharepoint
    A programmatic workaround:
    http://weblogs.asp.net/bsimser/archive/2005/01/24/359911.aspx
    Andrew Milsark, MCITP,MCTS
    Fpweb.net - The SharePoint Hosting Pioneer
    Blog : http://blog.fpweb.net
    Twitter : http://www.twitter.com/amilsark

  • How to Edit PSD Files In Flash Template

    Hi Everyone,
    I am new to flash and I am trying to create my first flash site using a template that I have downloaded. I can edit the first page fine, but when I click the "about us" or any other section, the standard template text, Which isn't even in english, appears. I believe that these are psd files, and I have tried to edit them, saved and replaced file on my computer, but still I get the same unchanged text on this site when I preview. Could someone please tell me how to edit and replace these files within the flash movie?

    Instance names are the reference names that you give to the individual items on the stage. Only movieClip and button symbols can have instance names.
    When you import a photoshop file to Flash you will get individual bitmap objects on the stage and in a folder in the movie's Library. You will need to select each item, one at a time, on the stage and convert each one to a symbol. When you make that conversion the name that you give to that new movieClip or button is the name that you will see in the Library.
    When you select that new symbol on the stage, look at the Properties window. You will now see a space at the top where you can give that item an instance name. The instance name is what you will use in Actionscript to control that object on the stage.
    When you look in the movie's Library, you will see the original bitmap and the symbol that you created that contains that bitmap.
    Does that help?

  • Problems getting elements to work in a txt file within Flash.

    Hello! I'm working on my band's new website and have been
    searching many hours for answers to some problems I'm having with
    txt files referenced as HTML in Flash.
    Our site is
    http://moumusic.com.
    One of the problems is having an image as a link. For
    instance, I have a photo and try to link a website to it:
    quote:
    <a href="
    http://cdbaby.com/cd/motuniverse"
    target="_blank"><img src="images/cdbaby.gif" width="100"
    height="100"></a>
    It works when loaded as an HTML file, but not when viewed in
    the Flash site. The text file for this is at
    http://moumusic.com/moualbum.txt.
    The page comes up when you click the "MoU's First CD" link on
    moumusic.com.
    Next, I can't link to external media files. For instance, I
    tried inserting the code:
    quote:
    <a href="
    http://fusco-moore.com/videos/SongforCliff-2.wmv">Song
    for Cliff Video Part 2</a>
    . You can click the text (while viewing it as
    part of the Flash site), but nothing happens. You can even copy the
    shortcut, but you can't use the link properly.
    Last, I want to put a PayPal Buy It Now button on one of the
    pages. The link is pretty long:
    quote:
    <a
    href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=producer%40wcjm%2ecom&it em_name=%22Masters%20of%20the%20Universe%22%20CD%20by%20MoU&amount=10%2e00&no_shipping=2&n o_note=1&currency_code=USD&lc=US&bn=PP%2dBuyNowBF&charset=UTF%2d8">Buy
    Now!</a>
    . I heard that there's a 128 character limit for
    links in Flash. Is there any way around this?
    What about forms? PayPal has the option of doing a form for a
    shopping cart. Flash won't even begin to recognize it when I just
    drop the form code in there.
    Well, thanks for the help in advance- hopefully this stuff
    can be accomplished!
    Jim

    I assume you are using the Flash TextField object set to
    render html.
    First to understand is that the extent of html recognized is
    limited and by
    player version. That means you cannot use any HTML tag you
    wish.
    See
    http://livedocs.macromedia.com/flash/8/main/00001459.html
    for the
    supported list in Flash Player 8
    You might check "About making hypertext links out of embedded
    media " as
    well:
    http://livedocs.macromedia.com/flash/8/main/00001477.html
    Malformed html in a TextField can render any tag in the field
    non
    functional. Be sure the html in the TextField is validated.
    I would assume the anchor tag in Flash text field would
    follow the same
    rules an anchor tag in HTML as to length of the query string.
    Finally consider using Flash with a button and getURL for the
    PayPal link.
    http://livedocs.macromedia.com/flash/8/main/00001730.html
    Lon Hosford
    www.lonhosford.com
    Flash, Actionscript and Flash Media Server examples:
    http://flashexamples.hosfordusa.com
    May many happy bits flow your way!
    "wcjmproducer" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hello! I'm working on my band's new website and have
    been searching many
    > hours
    > for answers to some problems I'm having with txt files
    referenced as HTML
    > in
    > Flash.
    >
    > Our site is
    http://moumusic.com.
    >
    > One of the problems is having an image as a link. For
    instance, I have a
    > photo and try to link a website to it:
    >
    >
    quote:
    <a href="
    http://cdbaby.com/cd/motuniverse"
    target="_blank"><img
    > src="images/cdbaby.gif" width="100"
    height="100"></a>
    >
    > It works when loaded as an HTML file, but not when
    viewed in the Flash
    > site.
    > The text file for this is at
    http://moumusic.com/moualbum.txt.
    The page
    > comes
    > up when you click the "MoU's First CD" link on
    moumusic.com.
    >
    > Next, I can't link to external media files. For
    instance, I tried
    > inserting
    > the code:
    quote:
    <a
    > href="
    http://fusco-moore.com/videos/SongforCliff-2.wmv">Song
    > for Cliff Video Part 2</a>
    . You can click the text (while viewing it
    > as
    > part of the Flash site), but nothing happens. You can
    even copy the
    > shortcut,
    > but you can't use the link properly.
    >
    > Last, I want to put a PayPal Buy It Now button on one of
    the pages. The
    > link
    > is pretty long:
    quote:
    <a
    >
    href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=producer%40wcjm
    >
    %2ecom&item_name=%22Masters%20of%20the%20Universe%22%20CD%20by%20MoU&amount=10%2
    >
    e00&no_shipping=2&no_note=1&currency_code=USD&lc=US&bn=PP%2dBuyNowBF&charset=UTF
    > %2d8">Buy Now!</a>
    . I heard that there's a 128 character limit for
    > links
    > in Flash. Is there any way around this?
    >
    > What about forms? PayPal has the option of doing a form
    for a shopping
    > cart.
    > Flash won't even begin to recognize it when I just drop
    the form code in
    > there.
    >
    > Well, thanks for the help in advance- hopefully this
    stuff can be
    > accomplished!
    >
    > Jim
    >

  • How to edit .FLV file in Flash?

    Hi,
    Can anybody giude me how to Edit .flv movie file in Flash
    Professional 8 in MAC.
    I can open the .flv file. I can see each frame.
    Now when i select some frames from the starting movie &
    cut(delete) those frames, I should get the remaining movie.
    But i can still see the starting movie frames in my .flv
    file.
    I don't know how to select particular frames & cut those
    frames.
    Please reply if you know the answer.
    I appreciate your support.
    Thanks in advance.
    - Nik

  • "Finding occurrences" error when editing .mxml file in Flash Builder 4.6 Premium (Trial)

    I am evaluating Flash Builder 4.6.  Windows 7 Ultimate x64
    I am trying to go through the Flex in a week training series but I am getting a lot of the "Finding occurrences" errors when editing the mxml files.
    The error:
    An internal error occurred during: "Finding occurrences".
    java.lang.NullPointerException
    This error occurs almost every time an xml tag is edited.
    I can dismiss the error window that pops up by hitting 'Enter' and can continue editing the .mxml file but the error keeps repeating.
    I was getting this error in the Day 1 set of exercises but after awhile the errors just stopped.
    Now that I have imported the Day 2 starter projects, the error has started again but is occurring on almost every keystroke when editing an xml tag/element!.
    Anyone have any ideas how to correct this issue?

    Ok, I seemed to have found a solution/workaround for the error.
    After importing the Day 2 starter projects, I did not exit and restart Flash Builder. After exiting/restarting Flash Builder, I can now edit the .mxml files without the annoying "Finding occurrences" errors.

  • Editing xml file inside a Jar

    Hello ,
    After creating my desktop application i created a Jar for it, but when i tried to change my program settings through the jar(Which is set in an xml file), i found that the changes did not happen.
    After some search i found that i can only edit files in a Jar by re-creating the jar again.
    Sure there's another easier way ? .... This is a normal demand.
    If not then what's the best way to deliver my program to my clients ?
    Thanks ,
    Hesham

    pbrockway2 wrote:
    i found that i can only edit files in a Jar by re-creating the jar again.That's correct.
    You could consider using the [Preferences API|http://java.sun.com/javase/6/docs/technotes/guides/preferences/index.html] to store program settings.
    ... or put the altered config in an external XML file. You could still keep a default config XML in the jar.

  • Editing flv files in flash

    I have a long video in flv format that I want to break up
    into smaller chunks. Is it possible to do this in Flash cs3 and
    how?
    thanks.

    From your description, it sounds like all of the loaded
    movies, are loaded in at the start of the first Flash movie.
    Additionally, in this 6.swf movie, the first .flv file is set to
    begin to play as soon as that movie is loaded. That's why you are
    hearing the sound track playing when the first movie loads.
    You can fix this by changing the code in 6.swf so that the
    first movie doesn't begin to stream/play when it loads. If there is
    a button to play this movie then this should be a trivial task.
    Another option is to not load 6.swf when the first movie starts,
    but to wait until 6.swf is called to be shown.

  • Open all TXT files in Ultraedit

    Currently from the below code I am able to open a new empty file in ultraedit. But I need to open all *.txt files from a particular directory in ultraedit. Could anyone please help me with this.
    private void ueditButActionPerformed(java.awt.event.ActionEvent evt)
         java.awt.EventQueue.invokeLater(new Runnable()
              public void run()
                   try
                        Process procViewEd =Runtime.getRuntime().exec("C:\\Program Files\\UltraEdit\\UEDIT32.EXE ");
                   catch(IOException ioe)
                        System.out.println(ioe.getMessage());
    } For instance, when I click on ueditBut, all the txt files inside the path c:\temp should open in ultraedit.
    Message was edited by:
    Simmy
    Message was edited by:
    Simmy

    As an example, this code opens all of the .java files in the current directory using notepad:import java.io.*;
    public class Test {
        public static void main (String... parameters) throws IOException {
            File currentDir = new File (".");
            File[] javaFiles = currentDir.listFiles (new FilenameFilter () {
                public boolean accept (File parent, String filename) {
                    return filename.endsWith (".java");
            for (File javaFile: javaFiles) {
                Runtime.getRuntime ().exec (String.format ("cmd /c notepad %s", javaFile.getAbsolutePath ()));
    }

  • How to use txt files in jar file

    Hi all
    I just made a program that uses a text file, but I havent managed to work it correctly, program runs without jar correctly, but when I packaged all files into a jar, it couldnt find txt file, so I can only run it when I create another text file outside of jar.
    How can I solve this??

    I used this:
    Scanner fileScan = new Scanner (new file
    ("Words.txt"));
    but when I make a jar file, it doesnt find the txt
    file inside a jar,
    do I need to specify path or something?I have already told you that you shouldn't use new File(..) you should use getResourceAsStream(String name) to get an InputStream to the file.
    Kaj

  • Loading *.txt files in web service

    I have a running web service on Axis, and can communicate with it from a j2se client and a browser test client.
    I'm attempting to load a txt file of data in the web service (stores a list of usernames). But the code can't locate the text file. Where are external resource placed if they're needed in a web service? I was assuming I could just place it next to my *.java files.
    Thanks

    I should add that I'm using Eclipse , and as such my web service seems to be self contained in my workspace for Eclipse. The structure is
    EclipseWorkspace -> myProject -> projectNamespace -> *.java
    I thought I could place my *.txt files inside the namespace directory with my Java files. I have also tried placing the *.txt file in the project directory, still no luck.

  • How can I transfer my edited RAW files to a flash drive?

    I have 30 RAW files (NEF) from a holiday party that I have edited, and would like to give to a friend for further editing. We both work on Macs. I selected the 30 photos in Bridge, went to "Copy to" and selected the flash drive. The raw files along with their xmp files show up. But unfortunately when I bring up the files on the flash drive using the "View as Cover Flow" option in Preview, they show up in the original RAW form - as if I'd just downloaded them off my camera again - without edits.
    Many people have mentioned exporting and DNG conversion. With regard to the first: when I select photos, right click, and go to "export to" my only option is "hard drive". Once I select that, nothing appears to happen. No new folders or files seem to appear in my hard drive. With regard to the second: I am nervous about losing information via the DNG conversion. I want to make sure my friend has all the information pertaining to each photo in the event that she needs to do a more significant round of second edits.
    How can I achieve this transfer? Also, should the fact that my friend plans on using Lightroom for edits bear any significance on my decisions? Thank you...

    The Save as DNG is not in Bridge, It is only available in Camera Raw.
    Open your file in ACR, at the lower left click the SAVE IMAGE button. From there you can select several different formats.
    Select DNG and adjust the options. You can also embed the original raw file inside the DNG (but gives larger file size)
    It's not clear if you are opening the files directly from the flash drive or saving them first to the hard drive.
    I would recommend always saving files to the hard drive, eject the flash drive, and then open from there rather than directly from flash drive
    We've all had flash drives that go bad or act wonky.
    Not trying to work on the files while they still reside on the flash drive is just one less problem to worry about.
    Good Luck

  • How to edit a text file inside jar

    Hi all;
    I have a code that created text file and put this file to other jar archive.
    How can I edit this text file inside jar, add string to this file ?
    Thanks,

    Unpack the jar, edit the file, repack the jar.

  • Reading a TXT file from a Flash Movie

    Using "LoadVariables" to establish a connection between the
    running Flash program and a text file in the same folder works just
    as expected with no problems. I am on a Windows machine and using
    the recipe from the fabulous help system.
    The problem - yes there IS a problem - arises when the text
    file contains special Danish characters.
    The odd part here is, that everything works fine from inside
    Falsh using "Test Movie", but not when publishing the movie and
    launching from inside a browser (both IE and Firefox).
    The help system says, that data should be URL-encoded. Trying
    that (characters %e6, %f8 and %e5) does not fix anything. The input
    is read, but the offending character is gobbled up along with the
    two next characters, or the program simply hangs.
    Any suggestions?[

    No i didn't do that in my first series of tries. Following
    your suggestion I did that (embedding Latin I, that should contain
    all the necessary characters), but it didn't do the trick. Actually
    it prevented my writing to a dynamic text field intended to
    interact with the user.
    Using English cahracters only it worked fine (with invisible
    text ;-) ).
    Using Danish characters I got the same result: Not working
    properly.
    Using the Danish characters from inside Flash to fill in text
    fields (static, dynamic and input) normally works fine, so I am
    puzzled - still

  • How to store the data typed in flash to .txt file?

    Hi all,
    I have a query to all, I have created a notepad in flash, if I typed something in that and save that file as .txt format in my local drive. So, any help on the same....
    Thanks in advance
    Santhosh Kumar M

    i don't think this is complicated enough for anyone to write a tutorial.  but i could be wrong about that.
    you have 2 steps:
    1.  use the urlloader class to send data to a server-side php script that saves your data to a .txt file
    2.  use the filereference class to download that file.
    they're both pretty easy if you use the flash help files to start you off.

Maybe you are looking for

  • Search Help Problem - Passing parameter between to search helps.

    I created following 2 table for entering data in PO screen using ME21N using Custom Data Tab. ZSTATE_TAB - State table  (has elementary search help ZSTATE_SH - Value of SCODE is exported) SCode(Key)     Description S001           New York S002       

  • Embed + compiler define works different with air 3.7+ comparing to 3.5

    Hello. I've noticed that new compiler works differently when using construct Embed with conditional compilation (comoiler define option). It looks like new compiler always embeds files in output swf even if Embed construct is used in dead code. Here

  • Archive Smartform copies

    Hi, Does any one know how to archive smartform copies and he field tdarccop . When I set it it to X and pass an invoice with copies to the smartform i get an OTF // error.

  • Yahoo maps not working in air? pls help!!! someone!!!

    Hi  everyone, I have created a partial air app and now i need a yahoo map. The code which I have works in dreamweaver when i test it as a normal web html file but does not work then when I use it in aptana studios for air apps. The code is : <head> 

  • Installation audit vault agent with RAC configuration

    Hi at all, I have a question about the installation of the agent on the RAC configuration. Where must I install the Audit vault agent, on all RAC nodes or is there a properly configuration? Thanks Vincenzo