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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Apple iTunes - Move from PC to PC First login to your old PC 1. Click on File. 2. Then click Library. 3. Now open the Export Library. 4. Save the .xml file to your desktop. This file will hold all of the information about your playl…
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 which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
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.

856 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