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
867 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 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

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…
Thanks to luck and dedication (hitting refresh every 5 seconds when the pre-orders were going live at midnight on April 10th) I managed to actually receive an Apple Watch on release day, April 24th. Which means I’ve been using it daily for just ov…
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): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

717 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