Wally

Use the HTMLText property and listen for the link event. The following
example should help (Note that I am not good with Style Sheets so there
is probably a better way of styling the links):

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="onCreationComplete()">
     <mx:Script>
         <![CDATA[
             import flash.events.TextEvent;
             import mx.controls.Alert;

             private var hoverStyles:String = "a:hover { color: #00ffff;
text-decoration: underline; } a { color: #0000ff; text-decoration:
underline; }";

             private function onCreationComplete():void
             {
                 theTextArea.addEventListener(TextEvent.LINK,
onLinkClick);
                 var ss:StyleSheet = new StyleSheet();
                 ss.parseCSS(hoverStyles);
                 theTextArea.styleSheet = ss;
             }

             private function onLinkClick(event:TextEvent):void
             {
                 switch(event.text)
                 {
                     case "codeEvent":
                         Alert.show("Show the CODE Window.");
                     break;
                     case "partialTimeEvent":
                         Alert.show("Show the PARTIAL TIME Window.");
                     break;
                 }
             }
         ]]>
     </mx:Script>
     <mx:Panel title="TextArea Control Example" height="75%" width="75%"
         paddingTop="10" paddingBottom="10" paddingLeft="10"
paddingRight="10">
         <mx:TextArea id="theTextArea" width="500" height="200">
             <mx:htmlText>
                 <![CDATA[Please record your hours by typing them in the
corresponding day. Also include the appropriate code behind the number
of hours (for example, 8 REG). Re-check for accuracy and submit at
appropriate time.
The <a href="event:codeEvent">CODE</a> and <a
href="event:partialTimeEvent">PARTIAL TIME</a> descriptions will open in
a new window. Place any comments or clarifications in the comment
box.]]>
             </mx:htmlText>
         </mx:TextArea>
     </mx:Panel>
</mx:Application>


I pretty much cobbled this together from:

http://livedocs.adobe.com/flex/3/langref/mx/controls/TextArea.html#event\
:link

and

http://www.flexafterdark.com/docs/Flex-HtmlText




HTH




Steve



--- In [email protected], "Wally Kolcz" <wko...@...> wrote:
>
> I have text on one of my applications that has 2 hyperlinks (CODE and
PARTIAL TIME) that needs to pop a window the PopUpManager. Is there any
way to do that?
>
> The text:
> Please record your hours by typing them in the corresponding day. Also
> include the appropriate code behind the number of hours (for example,
8 REG). Re-check for accuracy and submit at appropriate   time.
>
> The CODE and PARTIAL TIME descriptions   will open in a new window.
Place any comments or clarifications in the comment   box.
>
> I was going to use htmlText property of the Text Class, but not sure
how to listen for the click. Think it might be goofy to try to mix
linkbuttons and text. Any other option?
>

Reply via email to