Solved

In Flash CS5 using AS3, is it possible to select and link text in the TLF text mode (Advanced Character option) to jump to another frame instead of hyperlinking it to open up an html site?

Posted on 2010-08-26
5
858 Views
Last Modified: 2013-11-24
Hello, I'm working in Flash CS5 (for the Mac), using ActionScript 3.0.  I'm creating something simliliar to a web site (it will be hosted on our Agency's intranet) and would like to select a few words of text in a TLF textbox and be able to link the text to jump to another frame number/name and play it from there when the user clicks on the link.  Under Advanced Character in TLF text, I only see the option to hyperlink the text to open up a URL when clicked on.  I have also attached a component UIScrollbar to the text box.

Is there any way possible to fix this issue?

Thank you.
0
Comment
Question by:DEPAdmin
5 Comments
 
LVL 3

Expert Comment

by:ayanaculis
ID: 33547196
As far as I know, there is no way to do that. Maybe you can do that using flashvars. I will look into it and get back to you if I come up with something.
0
 

Author Comment

by:DEPAdmin
ID: 33557976
I wasn't sure if this was even possible myself.  Thanks, I appreciate it!
0
 
LVL 19

Accepted Solution

by:
moagrius earned 250 total points
ID: 33862487
here's a working sample, taken from this link: http://blancer.com/tutorials/85933/flash-cs5-for-designers-using-tlf-text-as-a-button/


import flashx.textLayout.events.FlowElementMouseEvent;
import flashx.textLayout.elements.LinkElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.formats.TextDecoration;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.elements.Configuration;
import flashx.textLayout.formats.TextAlign;

var containerSprite:Sprite = new Sprite();
this.addChild( containerSprite );
containerSprite.x = 25
containerSprite.y = 50;

			 
var container:ContainerController = new ContainerController( containerSprite, 400, 300);
var config :Configuration = new Configuration();
var charFormat:TextLayoutFormat = new TextLayoutFormat();
charFormat.fontFamily= "Arial, Helvetica,_sans";
charFormat.fontSize = 14;
charFormat.color = 0X000000;
charFormat.textAlign = TextAlign.LEFT;
config.textFlowInitialFormat = charFormat;

var textFlow :TextFlow = new TextFlow();
var p:ParagraphElement  = new ParagraphElement();
p.linkHoverFormat  = { color:0XFF0000 };
p.linkNormalFormat = { color:0x0000FF,textDecoration:TextDecoration.NONE };

var link:LinkElement = new LinkElement();
link.addEventListener(FlowElementMouseEvent.CLICK, linkClicked);

var linkSpan:SpanElement = new SpanElement();
linkSpan.text = "Click here" ;
link.addChild(linkSpan);

var span:SpanElement = new SpanElement();
span.text = " to see your star spin on the stage";
p.addChild(link);
p.addChild(span);

textFlow.addChild(p);
textFlow.flowComposer.addController(container);
textFlow.flowComposer.updateAllControllers();

function linkClicked(evt:FlowElementMouseEvent) :void{
   trace("hi");
   // gotoAndPlay(3);
}

Open in new window

0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 34059431
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question