Re: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread Jim Armstrong

sebastian wrote:

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?



Have you looked at asfunction?

good luck!

- jim

--
Jim Armstrong::Mathematician::Algorithmist::Programmer
Singularity::www.algorithmist.net
Blog::algorithmist.wordpress.com



___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread Paul Venton
asfunction :-)

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of sebastian
Sent: 16 May 2007 12:13
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] AS2: capturing a href=link/a events?

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.
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread eka

Hello :)

in actionscript (1 or 2) you can use the notation :

a href=asfunction:myMethod,param1,param2Link/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,param2Link/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.
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread JOR

You can use asfunction.


function foo (bar) {
  trace (bar);
}
this.createTextField(my_txt, this.getNextHighestDepth(), 0, 0, 200, 100);
my_txt.autoSize = true;
my_txt.html = true;
my_txt.htmlText = a href=\asfunction:foo, Hello Word!\Click Me/a;

-- JOR

James O'Reilly  —  Consultant
Adobe Certified Flash Expert
http://www.jamesor.com
Design • Code • Train



sebastian wrote:

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.

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread sebastian

thank you everyone! you (and 'asfunction') rocks
;)

seb.
___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread Durai Raj
I guess you can also assign function for that. When u click on that link you
can execute a function in which u can set the link and the event can be
dispatched from that function.

Cheers
Durai
Www.expertbuddy.net


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of sebastian
Sent: Wednesday, May 16, 2007 4:43 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] AS2: capturing a href=link/a events?

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.
___
Flashcoders@chattyfig.figleaf.com
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



DISCLAIMER:
This communication may be confidential and privileged and the views expressed 
herein may be personal and are not necessarily the views of ReDIM.
It is for the exclusive use of the intended recipient. If you are not the 
intended recipient, please note that any distribution,
copying or use of this communication or the  information in it is strictly 
prohibited.If you have received this communication 
in error, please notify us by email ([EMAIL PROTECTED]) and then delete the 
email and any copies of it.


___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread Paul Venton
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: flashcoders@chattyfig.figleaf.com
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,param2Link/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,param2Link/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.
 ___
 Flashcoders@chattyfig.figleaf.com
 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

 ___
 Flashcoders@chattyfig.figleaf.com
 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
 
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] AS2: capturing a href=link/a events?

2007-05-16 Thread JOR
If you try my example in a previous reply you'll see it working with 
passed parameters.


-- JOR


sebastian wrote:

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,param2Link/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,param2Link/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.
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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