Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
880 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
Suggested Courses

610 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