Make sure you aren't putting spaces in your function call ... ie 
"asfunction:myFunc,p1,p2"

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sebastian
Sent: 16 May 2007 15:17
To: [email protected]
Subject: Re: [Flashcoders] AS2: capturing <a href="">link</a> events?

BTW: I've noticed the second parameter doesn't pass, only the first.
I'm using flash 8, AS2.

I think this is a known issue... but I could be wrong. I'm using a split 
function to extract more parameters...

Thought I'd share!

wk,

seb.

eka wrote:
> Hello :)
> 
> in actionscript (1 or 2) you can use the notation :
> 
> <a href="asfunction:myMethod,param1,param2">Link</a>
> 
> In your code... in the parent of your textfield (the parent movieclip), you
> can creates the method "myMethod" ....
> 
> example :
> 
> var format:TextFormat = new TextFormat("arial", 12) ;
> format.bold = true ;
> 
> var target:MovieClip = this.createEmptyMovieClip("mc", 1) ;
> target._x = 25 ;
> target._y = 25 ;
> target.myMethod = function( arg1, arg2 )
> {
>    trace( "callback : " + arg1 + " : " + arg2) ;
> }
> 
> var field:TextField  = target.createTextField( "field", 1, 0 , 0, 200, 
> 20) ;
> field.autoSize = true ;
> field.border = true ;
> field.setNewTextFormat( format ) ;
> field.html = true ;
> field.htmlText = '<a href="asfunction:myMethod,param1,param2">Link</a>' ;
> 
> You can use TextField.StyleSheet to apply a css style in your fields 
> etc....
> 
> Read the actionscript reference with the words TextField and asfunction :)
> 
> EKA+ :)
> 
> 2007/5/16, sebastian <[EMAIL PROTECTED]>:
>>
>> Hello again, a more difficult question maybe...
>>
>> Is there any way for me to capture a user click on an href tag inside of
>> a CSS formatted html text field?
>>
>> Here is what I do:
>> - CDATA formatted text in an XML file.
>> - load it and associate a CSS file to a generated text field at run time.
>> - resulting <a> tags have links assigned to them.
>> - user 'clicks' them -> event capture??
>>
>> In other words: what I need to do is to hear the event so I can dispatch
>> an event to my Controller class [who then sends info to the stats class,
>> and opens a browser window with predetermined formatting].
>>
>> At the moment I can't see a way for this event to be heard by my
>> controller. Maybe this is simple? maybe its impossible, or complex...
>> any ideas? Javascript maybe?
>>
>> Thanks for your help!
>>
>> seb.
>> _______________________________________________
>> [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

Reply via email to