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
856 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
A lot of new and distinct gadgets are making their appearance every other day. The latest gadget that has wooed the attention of all gadget lovers and non gadget lovers alike is the Smartwatch. This tiny gadget is capable of offering live access to …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now