Skip to main content
Known Participant
January 14, 2009
Question

HTML links and Target Paths

  • January 14, 2009
  • 9 replies
  • 1019 views
I have a scrolling text box, I need to be able to continually add links to this box. They need to link to FRAMES within FLASH. I have used this information inside of the ACTIONS box on an empty layer: (below is the example I used it works as a link to an outside webpage, but I want to link to an actual frame within the FLASH movie.)

var URL:String =" http://www.macromedia.com"; var URLText:String = "Macromedia's website"; myTextArea.htmlText = "Go to <A HREF=\"" + URL + "\">" + URLText +"</A>"

This is the example they gave me to TARGET a frame, but it's not working. Can someone please explain how I'd use it. Is it in combination with the above?

Go to <A HREF=" http://www.macromedia.com" TARGET="frame_Name">Macromedia's website</A>

I appreciate all help thank you!
This topic has been closed for replies.

9 replies

kglad
Community Expert
Community Expert
January 16, 2009
you're welcome.
kglad
Community Expert
Community Expert
January 16, 2009
you're over-writing tf.htmlText with each line of code until the last (which will be the only one that will appear in your textfield).

to remedy, instead of using the assignment operator ( = ) use the append operator ( += ) AFTER the first assignment line of code.

in addition, you probably want those lines to have line breaks: use the break( <br> )or paragraph tag ( <p> ).
Known Participant
January 16, 2009
Great thanks again, it worked beautifully!
kglad
Community Expert
Community Expert
January 16, 2009
you're welcome.
Known Participant
January 16, 2009
Hmm, sorry abt. this but I do have one more question. I'm assuming this is how I would type out the rest of my code. I checked the syntax and its fine, but the links do not show up in the text box. Any idea?

kglad
Community Expert
Community Expert
January 16, 2009
is tf the instance name of your textfield?

if no, that's a problem. if yes, what do you see?
Known Participant
January 16, 2009
Ok, I love you! Sorry this took longer than it should have, again my coding skills not as high as the design skills. Thank you for all your help, I really appreciate it!

Btw. ofcourse this means ts was not my instance name, i renamed it and it worked!

kglad
Community Expert
Community Expert
January 16, 2009
ok, so that's the text in your text file. what's your actionscript look like that loads that text and then assigns something to your textfield?
Known Participant
January 16, 2009
Oh boy, well I've taken the code you gave me and tried to input the proper information in the right places, but I am very much off still. I've used one line of text.

function f(s:String){
gotoAndStop(s);
}

tf.htmlText = "<a href='asfunction:f,spk001'>SPK001 - Son Of Sound - Curious</a>";

spk001 is the frame label
SPK001 - Son Of Sound - Curious should be the link to that frame.

I've only been trying with one line would it be different for a multiline situation?
kglad
Community Expert
Community Expert
January 15, 2009
do you need to make your textfield multiline? is the textfield large enough to display whatever you need? (and it is html-enabled, correct?)

if you can't figure out the problem with the above info, copy and paste your code using the attach code option.
Known Participant
January 15, 2009
Yes it is multiline text. I've tried a million codes and none work so I'll show you what the text looks like:

SPDI001 - Step Mode - Full Moon Rising / Lift Your Hands

SPK0012 - Drrtyhaze, Featuring Lady Lovely - I Don't Care

SPK0009 - Drrtyhaze - The Jump / Heatwave

SPK0008 - Grizzlehand - It's Disco Dub / I'm a Hansa Dansa

SPK0007 - Son of Sound - Trial By Fire

SPK0006 - Michoacan - Held Up

SPK0005 - Nick Chacona - Hush No Rush / Broker Dealer

SPK0004 - Inflagranti - Additional Alpha Blocker / Effective Placebo Affect

SPK0003 - Son Of Sound - Start It Up / Supah Star

SPK0002 - Son Of Sound - Lust 'N Space / Uptown '84 / Rewind

SPK0001 - Son Of Sound - Curious

Basically it's a list of soundtracks. When clicked inside of the text box (or preferably rolled over) the album art is supposed to show up in a section of the FLASH movie. This list will be updated frequently so this is why I chose to use html text instead of just making flash buttons. I added the code you sent me in the ACTIONS box on a separate layer in the movie timeline.

does this help?
kglad
Community Expert
Community Expert
January 15, 2009
you're welcome.
Known Participant
January 15, 2009
Ok, I've seen some good information on adding text but not exactly what I need. I guess if I can load a .txt file I can just add the html to that page. Now my problem is figuring out what the HTML code would be for targeting a frame inside of the FLASH movie.

Any ideas?
kglad
Community Expert
Community Expert
January 15, 2009
this is a simple task that you're over-complicating. if tf is your html-enabled textfield, try:

kglad
Community Expert
Community Expert
January 15, 2009
use the flash help files. in the as2 index click on asfunction.
Known Participant
January 15, 2009
Ok, will do, thanks again. I'll let you know how it turns out!
kglad
Community Expert
Community Expert
January 15, 2009
check the asfunction.
Known Participant
January 15, 2009
I'm sorry but you'll have to elaborate a bit more. I'm not sure what you mean by "check the asfunction." My general Flash knowledge is decent but my actionscript knowledge is pretty low and I can't seem to find the answer to this issue in any book or online.

Thanks for helping.