in flash how to give a link on static text with the mouse over=underline effect....
please rep开发者_C百科ly....
Adding hyperlinks to a static text is not straightforward as in the case of a normal text field because
StaticText
doesn't havehtmlText
property like aTextField
- it inherits directly fromDisplayObject
.- You cannot mimic it by listening to mouse events as
DisplayObject
doesn't dispatch mouse events - only anInteractiveObejct
would dispatch mouse/keyboard events. - There is no
graphics
property for aDisplayObject
, hence you cannot mimic underlining behavior. - The authoring tool may export multiple text field objects comprising the complete text. For example, for vertical text, the authoring tool will create one text field per character.
May be you can work around these limitations by wrapping the static text inside a Sprite
- but I would use a TextField
instead of reinventing the wheel.
精彩评论