抓到Flash所選取文字

TextArea組件放到場景上後,取名為ta

AS2.0
ta.onMouseUp=function(){
trace(ta.text.slice(Selection.getBeginIndex(),Selection.getEndIndex()));
}

AS3.0
ta.addEventListener (MouseEvent.MOUSE_UP , function(e:Event){
trace(ta.text.slice(ta.selectionBeginIndex,ta.selectionEndIndex));
})

http://tw.knowledge.yahoo.com/question/question?qid=1008090411262

0 意見: