A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: method for client to update (formatted) text in flash site

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Posts
    131

    method for client to update (formatted) text in flash site

    one of the worries that potential clients have about flash sites is that they might not be able to update information themselves. now, i'm not talking about complex database stuff ... but rather simple text-info like "news", "biography", etc. that needs to be updated every once in a while by someone who might only have a very basic understanding of computers.

    furthermore, it would be important to be able to add some simple formatting to the text based on the *site-design guidelines* - 1 or 2 color options, bold/italic/underline options, tab-indenting, maybe even url-linking. depending on the design of the site it could look something like these:





    what would make sense is a flash-based webinterface with a wysiwyg-text-editor that would e.g. show the current news (file), allow the user to add to it (including formatting according to preset rules) and/or delete older items, and send the updated info back to the sever from where it would be called by the site at runtime.

    i think that this would be useful info for a lot of the users here on flashkit, so perhaps some of the more knowledgable members would be willing to chip in ?

  2. #2
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    You are going to need some form of PHP and uploading the variables. My guess would be to have a textbox, with a variable name. and have a swf that only the client knows either the

    A) Password
    B) HTML Page address

    So they can type up the updated info, upload it to the server via PHP, and have Flash load the text from there into the text box with the same variable name.

    I cannot help much more than this, as PHP and me don't agree and it never works for me . But there are tut's out there about this kinda thing.

    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Posts
    131
    hi Steve_w_V,

    that's pretty much what i thought so too ... unfortunately, i don't have any experience with this either.

    i want to ignore the security aspect for the time being.
    instead i would like to focus how to enable basic formating for an input textfield and how this formatting can be preserved when sending the updated text back to the server and pulling it into the site-movie.

  4. #4
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    I think for this you can use the "%__" characters in lieu of say, a TAB whitespace for example. I don't know the code now, but as an example character "&" is "%26". So "Sally %26 Jimmy" returns "Sally & Jimmy".

    Is this the formatting you are after?
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  5. #5
    Senior Member
    Join Date
    Jan 2003
    Posts
    131
    aaahhh,
    but the whole point is that the client will not want to (and probably won't be able to) to enter text in that way ...

    it would have to work along these lines:

    client opens a web page with a swf. if there are multiple sections that can be updated, client selects which one.
    client sees an input-textfield with the current content (with all formatting in place).
    client adds text to the textfield.
    client selects a word he/she just typed and chooses *bold*.
    client selects another piece of the text and chooses *color white*.
    when done, clients clicks a *save/update* button -> presto!

  6. #6
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Hi,
    here is part of what you are looking for.

    http://www.mglenn.com/projects/flasheditor/

    this will allow you to both write new data to a text file or modify existing data.

    You will have to come up with the login routine.

    3PRIMATES

  7. #7
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You don't need php for that. Just create textfiles, which are formatted by stylesheets (MX2004). If you want to update the text, just enter the new text within the html tags and upload the new file.
    - The right of the People to create Flash movies shall not be infringed. -

  8. #8
    Senior Member
    Join Date
    Jan 2003
    Posts
    131
    funny thing is, i'm dissecting josh's file as we write ...

    i'll have a look at your file ... especially interested in the import/export function!

    thanx

  9. #9
    Senior Member
    Join Date
    Jan 2003
    Posts
    131
    cancerinform,
    no mx2004.

    clients want things nice&easy.
    no ftp.
    no tags.

  10. #10
    Senior Member
    Join Date
    Jul 2000
    Posts
    419
    take a look at this. I can't believe how easy it is. and by the looks of it, it seems to be something relatevely easy to create.

    http://www.feministplanet.com/buttondesigner

  11. #11
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I think that is a shared object. Forget about that. It just creates a cookie but it is not saved for others. Check here. I made this in the past.

    http://www.flashkit.com/tutorials/Dy...-820/more2.php
    - The right of the People to create Flash movies shall not be infringed. -

  12. #12
    Senior Member
    Join Date
    Jul 2000
    Posts
    419
    no your wrong, I found that site because my girlfriend created her own button and ordered it, they shipped her 10 real buttons that looked exactly like the design she made, it was amazing, she uploaded pictures and everything to it! it definetely saved the button in the database, I think it only uses sharedObjects to save unfinished buttons locally

  13. #13
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    The you should be able to load what I made. Type into the field joachim
    - The right of the People to create Flash movies shall not be infringed. -

  14. #14
    Senior Member
    Join Date
    Jul 2000
    Posts
    419
    didn't you read my post? I said when you save it, it saves to a sharedObject locally, I know this I checked it, BUT when you actually buy a button it saves it into a database, try it, load up your design and click "purchase" it opens up a paypal shopping cart, with the databases id (or something because it's long) as the serial number of your design. my girlfriend actually purchased 10 buttons from them. it worked really well.

  15. #15
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    What has that to do with the original problem?
    - The right of the People to create Flash movies shall not be infringed. -

  16. #16
    Senior Member
    Join Date
    Jul 2000
    Posts
    419
    hehe hell I don't know, all I'm saying is it's cool, and it uses just a few of the components that come with flash, isn't this what you want to do, make something where you can format the text and mabe even uplod pictures. then save it to a database?

  17. #17
    Senior Member
    Join Date
    Jan 2003
    Posts
    131
    ok guys,
    quit the bickering! this doesn't really relate to this thread ...

    this is what i got so far;

    i stripped a text editor by josh dura down to the basic functiond that i need to get started.

    there is some xml stuff in there that i couldn't get to work as in the original - so i commented it out in the "generate html button code".

    it seems to work anyway without the xml - at least within the movie.

    2 questions:
    1) how do i get the font to display "anti-aliased". if i set "include all" in the character options panel, no text appears at all ...?
    2) how do i save the "html file" to the server and how do i get it back into the movie?
    Attached Files Attached Files

  18. #18
    Senior Member
    Join Date
    Jan 2003
    Posts
    131
    i updated the files somewhat.

    i now have a .txt file with the html-formatting.
    i did this by opening flashMX -> drawing a dynamic textfield on the stage -> typing my text into this textfield and setting color and bold properties as desired -> setting a trace function *trace (textfield.htmlText)* -> publishing the movie -> copy the text from the output window -> paste it into a texteditor -> added a variable -> save as plain text with unicode.

    the attached fla then loads the .txt file. into a input textfield where the user can edit the text (add/delete stuff...)

    this is where i hit a few stumbling blocks ...

    1. it doesn't load the entire .txt or it doesn't display the entire .txt ... ? it always cuts off at the same spot.

    2. i can't get it to properly display the loaded text antialiased ... ?

    and <drumroll>
    3. i need help figuring out how to write the changes that were made back to the .txt ? (of course when everything is worked out this should be written to the server)

    thanx in advance for any assistance in this matter. :-)

    edit: removed old file. the new one is one post down.
    Last edited by bryan.fury; 12-07-2003 at 11:48 AM.

  19. #19
    Senior Member
    Join Date
    Jan 2003
    Posts
    131
    ungh! this is driving me crazy ...

    i figured out what the problem was for #1:
    when tracing the .htmlText, flash was "encoding" special charcters like *'* with *&amp* which on re-import were causing any text after the first ampersand to be ignored.

    after checking out a tutorial at cancerinform's site, i figured XML is the way to go ... sure enough the ampersand problem is solved! (thanx cancerinform :-) )

    however, i now have the problem that foreign characters like "äüö" are no longer properly "encoded" (is that the right word in this case?) when i trace them in flash??? and therefore are not displayed in the textfield when reading them from the XML file ... instead they are replaced by a solid square .


    i have updated the files in the zip package. they now include the following:

    exportText.fla
    this file is used to simply set up a dynamic textfield with a bunch of text which is formatted with color and *bold* settings. when published the swf traces the *html version* of the dynamic textfield to the output window. i then copy&paste it from there to the .xml file.

    userUpdate.fla
    this file (swf) load the info from the xml and places it into an input textfield where the client could add/delete the info.

    ausstellungen.xml
    contains the html text


    of course i still have the problems #2 & #3 :

    ad #2: the strange part is that text is anti-aliased as long as there is no foreign character (such as äüö) in a word or line. as soon as there is one such character in the textfield then that particular line of text is aliased. if the next line doesn't contain any such character it will display properly again???
    Attached Files Attached Files

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