actionscript 3 - Img tags inside an Anchor in an Flash/AS3 HTMLtextfield with embedFonts = true, and a css file for styles behaves unexpected? Any solution? -
When embedFonts are removed, then it works entirely with expectation, otherwise when a picture is clicked , Then the whole text is selected around it.
Alternatively, instead of using any HTML, can the dynamic text field style suggest a way?
I was able to bring the same effect without using anchor tags. Obviously there is a bug in using anchor tags with images, anyways what I have done to overcome it here.
import flash.display. *; Import Flash. Text. *; Import flash.events *; Import Flash.ui.Mouse; Private function Init (): Zero {// .... var txt: string = "Creator Dolar Eros, Gravida A.
class = 'defStyle' & gt; & lt; img src = '003.jpg' Id = '0002' & gt; & lt; br & gt;
< Source: Ages Pede Nibajejet Audio. & Lt; / p & gt; "; Testtext.htmlText = txt; Var myPattern: RegExp = / & lt; Img [^ & gt;] + ID * = s * [']] ([A-Za-z0- 9] +) [']] [^ & gt;] * \ s * & gt; / Igmxs; Var result: object = myPattern.exec (txt); While (result! = Null) {var id = result [1]; Trace (id); Var Image: DisplayObject = testtext.getImageReference (ID); Image.addEventListener (MouseEvent.CLICK, imgClick); Image.addEventListener (MouseEvent.MOUSE_OVER, mouseoverhandler); Image.addEventListener (MouseEvent.MOUSE_OUT, MouseAutHandler); Results = myPattern.exec (txt); } ... // more} function imgClick (e: MouseEvent): zero {trace ('hello' e.target.name); } MouseOverHandler function (e: MouseEvent): zero {Mouse.cursor = 'button'; } MouseOutHandler function (e: MouseEvent): zero {Mouse.cursor = 'auto'; }
Comments
Post a Comment