A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: preview of rich text editor in KM (waaay incomplete)

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Posts
    289

    preview of rich text editor in KM (waaay incomplete)

    Here is the beginning of a text editor:

    http://www.oyoyoy.com/funfiles/richtext.html

    This is a "proof of concent" pulled from a bigger project and it is still full of holes and incomplete. But it shows what can be done with KM swf creation!

    Many buttons still do nothing (but they will merely be implementing more of the same sort of thing already in place). Some do work. Some are toggles, like bold. Some need special handling at the moment, like alignment, which requires highlighting first char of a text block.

    Note also that the "style" is project specific, and does zero here, and that "font" draws from predefined fonts, not the user font list. getvars from Text files have replaced the actual backend, and save has been removed for the time being.

    Also, I use text boxes for traces, they are still there, and they impact on the actual app as focus jumps around a bit.

    Don't expect it to work perfectly, I have a lot to do to make it behave coherently. I can make it misbehave without even trying! This is merely here to show off some KM functionality.

    Bob, you have a winner of a product!

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    Great stuff Owen!
    I think you are well on the way to having made the first ever swf "Application" outside of the Flash IDE!

    Keep at it....

    I should have some more exciting news for KM backend junkies very soon...can you guess?

    Hilary

    --

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Guessing .. XML stuff, OOP stuff, and cutting edge.

  4. #4
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Wait! ... not the Wiki?

  5. #5
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    No, not the Wiki - yet....
    Cutting edge? Yes...

    Only Flash can do it - or so they thought....

  6. #6
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Ack. Now curiosity is chewing me up. Can't wait.


  7. #7
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Great job Owen !

  8. #8
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Its neat- reminds me of my little editor I made that was not feature rich.

  9. #9
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Heya. Thanks guys.

    I am hitting some snags, though.

    To cut, txtfld.replaceSel(""); or any variation I can think of to replace with nothing does not work, will only replace if there is actually something between the quotes (or in the variable). So there is a fairly ugly work-around.

    To copy/paste means user has two clipboards, mine and the ctrl-C/ctrl-V system board. I don't know how to access the system clipboard. But I suppose this can be promoted as a bonus for the user.

    And more ... But it will come right.

    BTW, the AS dictionary shows a heap of "F" things, eg Fscroll, Flist, Fcombo, as components. Can we access these via KM, or do we need MX - I hope we can, as KM is the only software I have to create flash movies.

  10. #10
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    I'll look into the cut/paste issue tomorow for you.

    The "F" stuff are properties and methods of classes used in the Flash MX components (listbox, combobox, scrollbar, radion buttons and more).

    Components are part of the Flash IDE and not usable in KM, or I should say the components are not usable in KM (yet), but the classes (actionscript) would be usable in KM if we had components - sort of like the chicken an egg ....

    For us to be able to develop components for KM we would need a symbol library ( this subject keeps coming up;-) so that correct instaniation of the components could occur. At the moment it is almost impossible to make such re-usable things in KM, but I'm sure Bob is taking the hint

    As Necro said, a library would be a lot of work for Bob...

    Hilary

    --

  11. #11
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Hiya Hilary,

    Thanks for the info on "F" (Sesame street - Todays post is brought to you by the letter F and the number 0).

    Please don't waste any time with cut/paste, etc.

    Looking forward to seeing the cutting edge thingy. I love it when things that "can't be done" are done.

  12. #12
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    Originally posted by OwenAus
    To cut, txtfld.replaceSel(""); or any variation I can think of to replace with nothing does not work, will only replace if there is actually something between the quotes (or in the variable).
    Have you tried: myVar = null;

    Hilary

    --

  13. #13
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Yep,

    mv=null; txt.replaceSel(mv); and txt.replaceSel(null); replace the selected text with the word "null".

    As a work-around I am taking the next character beyond the selected range and extending the range by 1. Then replacing the extended range with that character. If the selected range includes the last character, I take the one before charAt(beginRange-1), and if the range is the entire text I just clear the lot.

    Conditional code rules in that little function!

    With the copy/paste via keys, I think I might try to trap ^c and ^v keystrokes, although I am not sure of the priorities involved (will windows or flash get my selected text before I do, will we both get it, etc).

    Am nearing a completion point, there is a huge amount that can be done to make it better but I need to move on. So will rewrite the thing with existing functionality ( it needs rewriting, more commented out stuff than active code ) and come back another day.

  14. #14
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    mv=null; txt.replaceSel(mv); and txt.replaceSel(null); replace the selected text with the word "null".
    Hmm... it should not replace it with the string "null" - that may be an AS bug. I will ask Bob to look at that one....

    Hilary

    --

  15. #15
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    k. Thanks.

  16. #16
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Attached (hopefully) is a zip of the fun and support files for the rich text editor.

    Most of it works, including colour slider, text enhancements, etc. But some functionality disabled because it requires serverside stuff, and some bugs must exist (I wrote it, after all).

    Any changes and improvements, please send them to me so I can learn new skills.

    Thanks.
    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