Links within dynamic text box?

Hello all,
My question is how can I add multiple links within a dynamically loaded paragraph of text?

Thanks, LOTW

This is quite easy and useful.

make sure your text field is set to allow HTML text in it. simply put in a regular html link like so:

for just a straight link somewhere:

text = “<a href=“http://www.somewhere.com”>click here</a>”;

to have it open up in new window:
text = “<a href=“http://www.somewhere.com” target=“blank”>click here</a>”;

to have it perform a function in flash:

text = “<a href=“asfunction:funcName,param1”>click here</a>”;

this makes a link in the text box just like it would in html… when you click “click here” it will call the actionscript function
funcName(param1);

you can add as many of these as you want and populate the variable that holds your text through an loops, loadVars(), arrays, whatever.

I have a site that i am using these on quite a bit… check it out www.circol.net click “find construction links”. Most of the data is sent into flash through asp/sqlServer and some like the “select category” process are all sent in and put in an array to search through, find appropriate search criteria, and continue in flash.

This is quite easy and useful.

make sure your text field is set to allow HTML text in it. simply put in a regular html link like so:

!! please note that everything below should be in complete html tags below… a & /a should both have the > and < around it!! can’t put those on here or will not show up on post

for just a straight link somewhere:

text = “a href=“www.somewhere.com”>click here/a”;

to have it open up in new window:

text = “a href=“www.somewhere.com” target=“blank”>click here/a”;

to have it perform a function in flash:

text = “a href=“asfunction:funcName,param1”>click here/a”;

this makes a link in the text box just like it would in html… when you click “click here” it will call the actionscript function
funcName(param1);

you can add as many of these as you want and populate the variable that holds your text through an loops, loadVars(), arrays, whatever.

I have a site that i am using these on quite a bit… check it out www.circol.net click “find construction links”. Most of the data is sent into flash through asp/sqlServer and some like the “select category” process are all sent in and put in an array to search through, find appropriate search criteria, and continue in flash.

Thanks tavisau, for the info… But

I don’t know why, but this makes no sense to me at all.

In my text box,with the render html enabled, i typed in this, text=“a href=“http://www.cnn.com”>CNN/a” And the opening, closing <>. And that’s what I get that exactly, no link just what i typed.

So am I putting it the wrong place? I have no Idea. Could you post a demo .fla so I can see exactly what’s going on?

Any thoughts, LOTW

Thanks tavisau, for the info… But

I don’t know why, but this makes no sense to me at all.

In my text box,with the render html enabled, i typed in this, text=“a href=“http://www.cnn.com”>CNN/a” And the opening, closing <>. And that’s what I get that exactly, no link just what i typed.

So am I putting it the wrong place? I have no Idea. Could you post a demo .fla so I can see exactly what’s going on?

Any thoughts, LOTW

put that code with the tags in a variable and then set the text field to display the variable.

set it in properties box for text field or using flash 6 method in ex attached

just download ex at http://www.circol.net/examples/linkexample.zip

Thanks Travisua,

I kind of understand now. but how would you add more than one link? Also, how would you be able to place that link inside a paragraph that you have typed? For example…

"This is a paragraph that I have typed inside a text box. [COLOR=blue]LINK[/COLOR] This is where i want one of my links to display. how would I get it to display here?

Thanks for the example, LOTW

look up string functions in action script dictionary…

use a + to add fields together.

so “blah blah blah blah<BR><BR>” + someVariable + "blah blah a href=“www.link.com”>link here</a

again missing a few < and >

but basically just add your text together…

make sure you use " which is the escape character for ". you have to use that when putting together strings in flash. I usually use arrays to list multiple links in text windows…
ex:

linkList = “company1,company2,company3”;
// just a basic string

linkArray = linkList.split(",");
// make an array out of the basic string declared above… this populates the array by using the “,” as a delimter. so after doing this your array will be:

linkArray[0] --> “company1”
linkArray[1] --> “company2”
etc…

now make another array of the actual links:
httpList=“http://www.company1.com,http://www.company2.com,http://www.company3.com”;
httpArray = httpList.split(",");

now to make your paragraph with all five links in it:

display = “”; // this is your variable to hold the final text display value, you will set your text field to display this variable.

for ( i=0; i<=linkArray.length; i++) {
display += (i+1) + “. <a href=”" + linkArray* + “” target="_blank"></a><BR>";
}

+= is the same thing is using display = display + “…”;

your results will look like:

  1. Company1 (it will be a link and clicking will open up in a new window http://www.company1.com

check out example at http://www.circol.net/examples/links2.fla

thats about all i can show you… adding anything else is just basic variable manipulation… should be plenty of tutorials out there for that. good luck

Hey that makes more sense.

Thanks for all your help, Travisau. Ill give that a try.

LOTW