Grap & highlight 'selected text' in a loaded SVG file via Actionscript.
i have been looking @ functionalities here...
http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/text/textsnapshot .html
there problem not clear on adobe examples or adobe forums...
is possible same svg loaded swf. able select
text charaters in svg within flash, , actual text selected can done in javascript.
when try select text inside svg file loaded flash, not selectable, , not seam
to fire events, neither 'pointer events' flash actionscript can catch.
when svg loaded can see text svg in debugger:
evt.target.textblock.content.text
evt.target.textblock.content.rawtext
is possible load svg file has text example, 'abc' in it, swf and
do like:
private function loadsvghandler(evt:event):void {
trace('find string iin svg: ' + evt.parent.textsnapshot.findtext(0, 'abc', false) ); // returns -1
trace('find string count in svg: ' +evt.parent.textsnapshot.charcount ); // returns 0
evt.parent.textsnapshot.setselectcolor(0x8a4862);
evt.parent.textsnapshot.setselected(0, 4, true);
trace('1) find iin svg: ' + evt.parent.textsnapshot.getselectedtext(false) ); // nothing happens
}
in tests, received no syntax error, received responses 'false' , -1 in cases.
i delved debugger etc, , looks not possible in actionscript 3.
please inform, correct, not possible in actionscript or missing something?
mark
textsnapshot used static text. you're not using static text if text loaded.
you should use dynamic textfield, assign text, use textfield and/or textformat properties/methods want.
More discussions in ActionScript 3
adobe
Comments
Post a Comment