Actionscript 2
mc1.onRelease = function() {
}
mc1.onRelease = null;
Actionscript 3
import flash.events.MouseEvent; // if on timeline we don't need this line
mc1.addEventListener(MouseEvent.CLICK, mc1_click);
function mc1_click(e) {
}
mc1.buttonMode = true; // to have hand cursor when over it
mc1.removeEventListener(MouseEvent.CLICK, mc1_click); // to remove action
Further differences:
1. if something is covering it, it won’t work even if invisible it will not work
2. function need to have one parameter or it will not work.
3. we need to remeber to remove this listeners when not needed or we’ll cause memory leaks
I could find any way to make custom underline in TextField. The only what you can have from flash straight out the box is <u> tag which gives you plain line same colour as text. So if you want to have it different colour or style like dotted you need some workaroud. Asfaik you cannot set up it using StyleSheet and you cannot setup it using TextFormat. It’s not as imortant when you have Static Text cause then you can simply draw line on top of it. But it becomes important when you have Dynamic or Input Text. I will explain workaround on choosen scenario where we want to undescore all links (<a> tags) with blue dotted line inside of Dynamic Text Field. (more…)