Click to See Complete Forum and Search --> : preview of rich text editor in KM (waaay incomplete)
OwenAus
12-15-2002, 09:02 PM
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!
bridelh
12-15-2002, 09:58 PM
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
--
OwenAus
12-15-2002, 10:30 PM
Guessing .. XML stuff, OOP stuff, and cutting edge. :)
OwenAus
12-15-2002, 10:33 PM
Wait! ... not the Wiki? :)
bridelh
12-15-2002, 11:26 PM
No, not the Wiki - yet....
Cutting edge? Yes...
Only Flash can do it - or so they thought....
OwenAus
12-16-2002, 01:09 AM
Ack. Now curiosity is chewing me up. Can't wait.
:p
necromanthus
12-16-2002, 10:50 AM
Great job Owen !
;)
johnie
12-16-2002, 10:38 PM
Its neat- reminds me of my little editor I made that was not feature rich.
OwenAus
12-16-2002, 10:52 PM
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. :p
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.
bridelh
12-17-2002, 10:30 AM
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
--
OwenAus
12-17-2002, 08:09 PM
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. :D
bridelh
12-17-2002, 10:22 PM
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
--
OwenAus
12-17-2002, 11:09 PM
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 :p ) and come back another day.
bridelh
12-18-2002, 12:50 AM
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
--
OwenAus
12-18-2002, 12:52 AM
k. Thanks. :)
OwenAus
12-20-2002, 12:43 PM
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.
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.