Thanks Ryan, so I guess the AS3 way will be that it is an event, and you
just create handlers. The example they gave in case anyone is curious
is:
private var myMP3:Sound;
public function TextField_event_link() {
myMP3 = new Sound();
var list:TextField = new TextField();
list.autoSize = TextFieldAutoSize.LEFT;
list.multiline = true;
list.htmlText = "<a href=\"event:track1.mp3\">Track
1</a><br>";
list.htmlText += "<a href=\"event:track2.mp3\">Track
2</a><br>";
addEventListener(TextEvent.LINK, linkHandler);
addChild(list);
}
private function playMP3(mp3:String):void {
try {
myMP3.load(new URLRequest(mp3));
myMP3.play();
}
catch(err:Error) {
trace(err.message);
}
myMP3.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}
private function linkHandler(linkEvent:TextEvent):void {
playMP3(linkEvent.text);
}
Can't wait to start writing AS 3 code, but I guess I will just have to.
Jason Merrill
Bank of America
Learning & Organizational Effectiveness
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Ryan Potter
>>Sent: Wednesday, November 08, 2006 1:52 PM
>>To: Flashcoders mailing list
>>Subject: RE: [Flashcoders] Detecting a click on an html link in a text
field
>>
>>I don't know squat about as3 yet, but from the docs there is this:
>>
>>http://livedocs.macromedia.com/labs/as3preview/langref/flash/text/Text
Field
>>.html#event:link
>>
>>
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf Of
Merrill,
>>Jason
>>Sent: Wednesday, November 08, 2006 11:15 AM
>>To: Flashcoders mailing list
>>Subject: RE: [Flashcoders] Detecting a click on an html link in a text
>>field
>>
>>A side note, fairly irrelevant, but I heard/read somewhere asfunction
is
>>going away in AS3 - I think I saw that in the AS3 documentation -
anyone
>>know what the equivalent form would be in the future?
>>
>>Jason Merrill
>>Bank of America
>>Learning & Organizational Effectiveness
>>
>>
>>
>>
>>
>>
>>>>-----Original Message-----
>>>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>>>[EMAIL PROTECTED] On Behalf Of Mark Burvill
>>>>Sent: Wednesday, November 08, 2006 11:39 AM
>>>>To: [email protected]
>>>>Subject: [Flashcoders] Detecting a click on an html link in a text
>>field
>>>>
>>>>Hi List,
>>>>
>>>>If you have an href link within an html text field in Flash, is
there
>>>>any way of detecting when the user clicks on it?
>>>>
>>>>Not being a standard button, you obviously can't do:
>>>>
>>>>on (press) {
>>>> doStuff();
>>>>}
>>>>
>>>>
>>>>But is there another way?
>>>>
>>>>Cheers.
>>>>
>>>>_______________________________________________
>>>>[email protected]
>>>>To change your subscription options or search the archive:
>>>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>
>>>>Brought to you by Fig Leaf Software
>>>>Premier Authorized Adobe Consulting and Training
>>>>http://www.figleaf.com
>>>>http://training.figleaf.com
>>_______________________________________________
>>[email protected]
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
>>_______________________________________________
>>[email protected]
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com