Skip to main content
Participant
Jan 7, 2009 10:42 PM UTC
Answered

Link to local function?

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 is closed to new replies. Start a new post to keep the conversation going.
rdermerCorrect answer
Inspiring
Jan 8, 2009 4:11 AM UTC
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

4 replies

Inspiring
Jan 8, 2009 6:46 PM UTC
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
Translate
Feb 20, 2009 3:07 PM UTC
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.
Translate
Jan 8, 2009 10:59 AM UTC
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
Translate
rdermerCorrect answer
Inspiring
Jan 8, 2009 4:11 AM UTC
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
Translate