The text in the edit box can be selectable. What for, if you can not handle the selected part of the text?
When I select some of the text, example to make it bold (in the working swf) I need to pull it into a var or array to be able to add the <b> and </b> tags. I know that is possiblein MX with the selection object. Is it possible in 3dfa?
I believe it will be possible, but probably not as straightforward as in MX, as you'll have to play around with actionscript. This isn't well documented in 3DFA and doesn't work in preview mode, so you'll have to do a bit of research, and try a bit of trial and error, and always export to test everything.
I bet it's possible though. Anyone gonna take the bet?
When trying to use these in 3DFA, it says that Selection is an object type and not a variable. Therefore, I think we need to change it to something like:
sel_begin= element("Name Of Edit Box").Selection.getBeginIndex();
But this just returns 'undefined' in the variable sel_begin.
Can anyone think of a way to get the Selection.getBeginIndex() command to refer to the editbox that the selection is present in?
If it helps, here's a thread I found whilst researching:
Nope. I've tried and tried many times, and I think the syntax is different in 3DFA for these commands than in MX, and I can't work out how it needs to be changed.
I'm stumped. Any of the real coding guru's out there know how to get these commands to work?
It took me awhile to figure this out but I think I have it...
Since 3DFA has the "Selection" object defined for itself and won't export it the way we need we'll have to reference it some other way. What I found is that the "_global" object is where all the root classes are kept in flash so to reference the "Selection" object we need to use "_global.Selection".
You'd have to do some work on it to figure the logic of adding and removing tags, but this should give you a starter!
Simply type text in the top section. Highlight some it, then click the 'make selection bold' button. Apologies for not knowing how to use the <a> tag !
M.
Last edited by ForumNewbie; 12-06-2006 at 08:03 PM.