Skip to main content
Participant
January 7, 2009
Answered

Link to local function?

  • January 7, 2009
  • 3 replies
  • 609 views
In earlier versions of Flash, it was possible to link to a local function. In the htmlText of a text area, you could link to event:functionName instead of a website. Is that possible in the text layout framework? If so, can someone post an example?
This topic has been closed for replies.
Correct answer rdermer
For click events you can do this:
click="myEventHandler(event);"

Additionaly you can set the href on the link as:
href="event:eventName" and then add a listener for eventName to the textFlow.

Richard

3 replies

Adobe Employee
January 8, 2009
I have not looked at slideshowpro - well I just saw the website now.

Look at the CustomLinkEventHandler.as example in the TextLayout Framework download. That example connects an AS function to a clicked link.

Thanks,
Richard
February 20, 2009
Hi,

I have some problems with links, using this code:

quote:


textFlow.addEventListener("myFunctionName", linkHandler);

function linkHandler(e:FlowElementMouseEvent):void{
trace(e);
}



How get some parameter with myFunctionName and then read it from linkHandler function ?

Thanks.
January 8, 2009
Im having a very similar problem. I have a script which feeds a dynamic text field named t_txt, I would like to use the textlayout component instead of the regular dynamic text field. currently the script informing t_txt looks like this:
--------------------------------------------------------------
import net.slideshowpro.slideshowpro.*;

function onImageData(event:SSPDataEvent) {
if (event.type=="imageData") {
t_txt.htmlText=event.data.caption;
}
}

my_ssp.addEventListener(SSPDataEvent.IMAGE_DATA, onImageData);
-------------------------------------------------------------------
Im using the slideshowpro component which is hooked up to an external database which provides captions, pictures and titles. What href would i supply to the textlayout component? and are there any changes i need to make to the above script? thx, Yasha
rdermerCorrect answer
Adobe Employee
January 8, 2009
For click events you can do this:
click="myEventHandler(event);"

Additionaly you can set the href on the link as:
href="event:eventName" and then add a listener for eventName to the textFlow.

Richard