Blog of Death
obedit v3.04 update released
February 16th, 2008
Important Security Update:obedit v3.04 fixes an important XSS (cross-site-scripting) bug which was recently discovered. See the obedit project page for details.
Permalink
http://www.oblius.com/blog/view.php?ID=754cbada52f37c1fdf89a05d12d559b6

Thanks your for your great work on your Flash Text Editor : obedit. Works fine !!!
Is it normal that when we load your SWF in an other SWF, we lost all the time the selection when we select the text and then we open a combo ?
Thanks again for your work.
I believe one of the main problems with the obedit code right now is it uses absolute targets to refer to objects in the timeline (aka _root). When you embed obedit inside of another Flash file, these references break because _root no longer points to obedit's _root but the containing object's _root.
Without looking at the code I can't give you a definite answer, but two places I would look are:
The MovieClip._lockroot property, which is used to ensure _root references stay correct in loaded movie clips:
http://tinyurl.com/2bnckk
And the other solution of course is to rewrite obedit to use relative targets, like this._parent.
When I get time to work on obedit again someday I will look into making the code more embed-friendly. I hope one of these solutions work for you in the meantime!
Thanks a lot for your quick answer.
Before post on this forum, I tested to add a the begining of your SWF the simple code : this._lockroot = true;
It fixed almost all the bug due at an inclusion in an ohter SWF, but, the only last problem is the selection lost in the text.
I will try to work on it, and if I find a simple solution, I post it here.
Thanks again for all,
Regards,
(don't hesitate if you need some help to work on it, I'm very intersted on developping this king of module, and sorry for my poor english...be indulgent, I'm french :) )
I just runned over your obedit project while searching for some ideas on rich text editing to send e-mails from flash.
Well, I actually don't have use for your obedit, but It's a really great project, and flawless work.
I just found one mayor thing you may want to update for better runtime of your program:
Having loops its never good, and I understand why you must have a loop there, but there's one simple way to avoid it.
Just creat a function called "getSelection()" or whatever, and make it like this:
function getSelection() {
if (Selection.getFocus() == "_level0.editingPane.label") {
_root.selstart = Selection.getBeginIndex();
_root.selend = Selection.getEndIndex();
sstart = _root.selstart;
send = _root.selend;
}
}
according to the way you are doing that.
And then, just add a "on (rollover)" statement to every button that calls "getSelection();" function, and thats it!.. no loop needed, and not a single chance (not even 1/20th of a second) of getting wrong the seleccion when setting some text format.