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.

< Back to Index

Permalink

http://www.oblius.com/blog/view.php?ID=754cbada52f37c1fdf89a05d12d559b6

This post has 5 comments.

Posted by Kp on April 2nd, 2008:
Hello,
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.
Posted by oblius on April 2nd, 2008:
That I hate to say is one known problem with obedit. I designed it right from the start as a standalone editor and never got to testing it embedded inside of another Flash file.

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!
Posted by KP on April 2nd, 2008:
Hi,
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 :) )


Posted by oblius on April 2nd, 2008:
The selection may have something to do with the event hook. There is a function running in the background which keeps track of the selection and makes sure to replace it if the text box loses focus. You might check to see if that function is conflicting with something else in your Flash movie, or if you need to add further tracking to both movies to ensure the focus is tracked properly. Again, I'm sort of speaking in the dark because I haven't looked at the obedit code in some time!
Posted by DCuche on June 28th, 2008:
Hi there.
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.
Add a Comment to this Post
* Name
Email (optional)
* Comment
 

Enter the verification code shown below:

Verify