A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 47

Thread: Editing text files from web site?

  1. #21
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Tha server path often starts with the name of the drive d: or something like that.

    I tried the adress to your FlashDB files ( knuckle.com ) but the server responded with a error. Have you given all the files write permissions?

    ( these scripts come in two versions, for Windows 2000 servers and for Unix servers ( yours is probably a Unix? ) ). Its important that you use the right ones.

    I also tested that you had a texfile in a folder called flashdata which you seem to have ( a empty one ).

    Put this attachment in the root of your site and give it permissons. By calling it from a browser it will write all internal paths of your server. Its very handy . ( its zipped so you have to open it first )

    The if(state=="done" )

    ... statement has to be repeated as it constantly has to check the variable until the condition is true. You must have it in a frameloop.( going back and forth between two frames ). For instance have the if statement in frame 3

    f (state == "done") {
    // Done, so break out of this loop and go to frame 4
    gotoAndPlay(4);
    } else {
    // Not done, so go back to frame 2 so this action is repeated
    gotoAndPlay(2);
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  2. #22
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Just saw something. You should not specify the textfile in the flashDB scripts ( thats why you specify textfile to write to inside Flash ). Just the path to the folder that contains the textfile, and the path should have a / as the last character..


    ....pathToServer/flashdata/


    AND the showenv.pl script should be i the cgi-bin of course. My error.
    Last edited by pellepiano; 04-21-2004 at 12:58 PM.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #23
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    alrighty.
    i used that nifty program your attached (thank you for that by the way)

    my server does not seem to start with a drive letter as far as i can see

    if you wanna look yourself here is the url
    http://www.knuckle.ca/cgi-bin/showenv.pl

    the path to my db files are
    http://www.knuckle.ca/cgi-bin/

    i tried accessing them myself through the browser and also got an error message..but i assure you i've chmod'd them for full permissions a million times.

    i'm attaching my actual fla file, and if you've got the time please have a look at it and see if there is anything else wrong.

    i put the if statment into the 3 frame like you suggested...but obviously something is either still missing from my flash file...or something is up with the db files...cuz it's still not working for me.

    oh yes, i didn't actually put the textfile name into the db files...i just wrote that here in the forum for some reason...oops.

    i really really appreciate your time and your help.
    thank you
    Attached Files Attached Files
    "Programmed to Rock!"

  4. #24
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    The path seems to be "/home/knuckle/public_html/"

    First. You are sending the variables from within the movieclip. Thats where you also will recieve the state=done, so for now you are checking the wrong timeline.

    Ypu have 2 on(release) actions on your button, tha loadVariables action and a...

    on (release) {
    gotoAndPlay(2);
    }

    That action tells the CURRENT timeline to go to frame 2, of which there is none. You want to tell the main timeline to go and play frame 2

    on (release) {
    _root.gotoAndPlay(2);
    }

    Well, I reorganized your fla so everything is in one timeline. It should work ( if you fix the path in the scripts ).

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #25
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    thanx so much...i see what you did...that helps me alot.

    but, it's still not working on the damn site...i can't get the FlashDBwrite/read.pl files to work. i thought maybe i had the wrong ones (the ones for windows instead of unix) so i tried getting the unix ones again and putting them back on the server...but alas, to no avail.

    i'm gonna have to talk to my host to see why my chmod commands aren't working on these two files.

    until then. thanx a lot for your time and effort.
    and if you can think of anything that i haven't, that might explain why those files aren't getting the right permissions let me know.

    ttfn.

    what would i do without flashkit.com, and it's helpful surfers?
    "Programmed to Rock!"

  6. #26
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I tested the script from my browser and it works now.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  7. #27
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Heres a new file that seem to work. I also checked your textfile that it really got updated.

    I took away the scroll bar and let the textfield pe present on a few more frames. Dont know which made the difference.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  8. #28
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    thats really weird. i could not get that DBwrite file to work from the browser last night...and i tried for ages.
    well it's working now and thats great.


    a question though.

    the movie is indeed writing to the file, which is awesome, but it's not just writing in the text i typed in.
    it's adding all sorts of other information from the time line...like gibberish about the type of scrollbar i'm using etc.

    should i not be identifying what i want to transfer specifically instead of just everything on the timeline?


    for example instead of

    on (release) {
    filename = "myTextfile";
    this.loadVariables("http://www.knuckle.ca/cgi-bin/FlashDBwrite.pl", "POST");
    gotoAndPlay(2);
    }
    ---------------------------

    shouldn't i be doing something like;

    on (release) {
    filename = "myTextfile";

    //change the "this" statement into the name of the text field "Field" like below?

    Field.loadVariables("http://www.knuckle.ca/cgi-bin/FlashDBwrite.pl", "POST");
    gotoAndPlay(2);
    }
    ---------------------------------

    the file also is failing to "read" back the info saved to file

    if you wanna see it in action i've uploaded the movie to

    http://www.knuckle.ca/write.html
    and the text file is here
    http://knuckle.ca/flashdata/myTextfile.txt
    "Programmed to Rock!"

  9. #29
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    ok...even weirder.

    it seems if i just leave things alone for a while they mysteriously start working

    everything is working just fine right now.
    thanks for all your help.
    "Programmed to Rock!"

  10. #30
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    oh man...sorry. one more question

    i've added the read part into another file. so that the content i've updated loads into a whole other movie.
    it works great. with one problem
    i've added a scroll bar to that new movie on the text field...but it won't scroll.
    i've tried everything i can think of.
    it just doesn't seem to work!

    now. in the original movie you helped me with...i did add in the scroll bar both on the input text field and the output text field.
    they both scrolled perfectly.
    it just seems to be in this new movie where no scrolling is taking place.

    any suggestions?
    "Programmed to Rock!"

  11. #31
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Do you target the right name of the textfield from the scrollbar? It is probably set to use the instance name and not the variable name ( maybe).

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  12. #32
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    nah....i tried the var name and the instance name....it's not working for me either way
    "Programmed to Rock!"

  13. #33
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can copy the working textfield and scroller from the other fla perhaps.

    Do you have enough text in the textfield so it CAN scroll? Is it set to wordwrap so there is not just one line?

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  14. #34
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    i'll try the copy.
    yes it's set to wordwrap and yes it does have enough to scroll
    "Programmed to Rock!"

  15. #35
    frombeyond.ca knuckle's Avatar
    Join Date
    Aug 2002
    Location
    !CA-NA-DA!
    Posts
    118
    dang.
    tried the copy and paste as well.

    just doesn't wanna work for me

    i'm uploading the file if you or anyone else wants to have a look at it to this url;
    http://www.knuckle.ca/outrightdefiance/new/index.fla

    the issue is insed the movieclip called SCREENLOAD on the last frame
    "Programmed to Rock!"

  16. #36
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Discard.
    Last edited by pellepiano; 04-23-2004 at 01:37 PM.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  17. #37
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Place the loading code on frame one in the movieclip instead. The scrollbar checks the the texfield if something is loaded into it so the text has to be there when it checks.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  18. #38
    Celebrity By Association FrankieB's Avatar
    Join Date
    Jul 2003
    Location
    The Matrix, KY
    Posts
    114
    I am still unclear as to how to get the text files loaded into the input field for editing.

    I understand the write method after text has been entered, but to get the text file into the imput field is where I am having a hard time.

    On frame 1 of my movie, I have four buttons. The first button goes to Frame 2. On Frame 2, I have an input field, a component from www.flashloaded.com (FlashTextEditorLite), and a send button. On the Actions layer of this frame I have

    filename="data/news";
    this.loadVariables("cgi-bin/FlashDBread.pl","POST");

    I was under the assumption that this would put my news.txt into the input field for editing, but nothing at all shows up.

    This has all gotten so confusing I am almost ready to quit designing websites.
    ---In The Conflict Of Stream And Stone, The Stream Will Win, Not By Strength, But By Persistence---

  19. #39
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You could load the textfile at the beginning of your movie instead.

    The textfile contains variables. Your textfields has instance names, thats why they dont show up automatically. You should use variable names on the textfields.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  20. #40
    Celebrity By Association FrankieB's Avatar
    Join Date
    Jul 2003
    Location
    The Matrix, KY
    Posts
    114
    I am not quite sure what you mean...could you show some code examples?
    ---In The Conflict Of Stream And Stone, The Stream Will Win, Not By Strength, But By Persistence---

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center