Skip to main content
Known Participant
April 9, 2011
Question

Link a word in a sentence to go to another frame?

  • April 9, 2011
  • 1 reply
  • 720 views

I want to be able to do the following:

Type out a sentence and then highlight one of the words in the sentence and create a link to go to another frame.

Is this possible?

The only other way which is time consuming (Especially with possibly hundreds of sentences) is to create each word as a button and then fit each word as a sentence together.

surely there is an easier way?

It will be the basis of an Elearning course for kids to click on a word in a sentence and based on their choice they go to a Correct or Wrong frame.

Captivate cannot do this unfortunately.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
April 9, 2011

I'm not sure regarding the whole typing/highlighting end of things if you mean to do that will the file is running.   But in the authoring mode if you use the htmlText property of the textfield you can assign links in the text and use the TextEvent class to listen for clicking of the links and then take action on that.

aTextField.htmlText = "Here's <a href=\"event: frame10\">One Link</a> and here's <a href=\"event: frame20\">Another</a>";
           
aTextField.addEventListener(TextEvent.LINK, linkEvent);

function linkEvent(evt:TextEvent):void {
     var frameLabel = evt.text;

     gotoAndStop(frameLabel);
}

Known Participant
April 9, 2011

Hi,

thanks, that will be useful. I have tested it out and it works fine.

Is it posiible to remove the hypertext colour and underline though?

Ned Murphy
Legend
April 9, 2011

I haven't done it myself, so rather than me looking it up figuring it out and explaining it to you, see if you can find out how it might be do-able from the following link (or do what I just did and search Google for other links regarding "AS3 CSS")

http://www.republicofcode.com/tutorials/flash/as3css/

Based on what appears to be a sample in the page it may have just what you need. .