xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
import flashx.textLayout.events.FlowElementMouseEvent;
import flashx.textLayout.elements.LinkElement;
import mx.controls.Alert;
import mx.events.CloseEvent;
private var linkTarget:String;
private function doSomething(e:FlowElementMouseEvent):void {
e.stopImmediatePropagation();
e.preventDefault();
var le:LinkElement = e.flowElement as LinkElement;
linkTarget = le.href;
Alert.show("You are about to navigate away from this page.","Alert",Alert.OK |Alert.CANCEL, this, alertListener, null, Alert.OK);
}
private function alertListener(e:CloseEvent):void {
if (e.detail == Alert.OK) {
navigateToURL(new URLRequest(linkTarget), '_self')
}
}
editable="false"
focusEnabled="false">
The following link takes you to: target="_blank" click="doSomething(event)">Adobe.com