# Hyperlinks in Flash

**URL:** <https://forum.kirupa.com/t/hyperlinks-in-flash/17177>\
**Category:** Uncategorized\
**Created:** [April 2, 2003, 4:06am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177 "2003-04-02T04:06:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exedus](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@Exedus](https://forum.kirupa.com/u/Exedus)\
**Post date:** [April 2, 2003, 4:06am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/1 "2003-04-02T04:06:27Z")

</div>

Ok here’s a good question for all you flash geeks out there. I’m puting together my portfolio site. In the portfolio section I want to be able to create links to my work in a dynamic text box.

See I’m using a dynamicaly loaded text from a txt file. Is it possible to use HTML in the txt file and have it work once loaded into flash. I want to creat the links to my portfolio work in the txt file itself. Is it possible?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 4:55am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/2 "2003-04-02T04:55:42Z")

</div>

yes its possible:  
Have an external text file (I’ll call it “html.txt” for an example)  
in the text file I’ve type this:  
text=a href="[http://www.kirupa.com](http://www.kirupa.com)"Kirupa/a

(enter the appropriate \< and \> tags)

in a frame in the movie enter the actionscript:  
loadVariablesNum (“html.txt”, 1); //loads text file at level 1

make a dynamic text box after the frame where you’ve loaded the text file and call the variable field:  
\_level1.text //this calls the dynamically loaded text file

Make sure that the properties of the dynamic text box have the html tags toggle turned on.

I can send you some files if I didn’t make sense.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 5:02am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/3 "2003-04-02T05:02:15Z")

</div>

well I already have the text box and I’m already loading txt files for my home page and my about section. Here the code:

loadText = new loadVars();  
loadText.load(“home.txt”);  
//creating the loadVarsText function  
loadText.onLoad = function() {  
scroller.text = this.hometext;  
};

Do I have to alter this code at all to get the link tags to work?

Also where is the button to turn on html tags? I can’t find it in the properties bar

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 5:04am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/4 "2003-04-02T05:04:07Z")

</div>

just a bit… 😉

```auto
loadText.onLoad = function() {
scroller.html = true;
scroller.htmlText = this.hometext;
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 5:12am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/5 "2003-04-02T05:12:34Z")

</div>

should I paste that under the code I already have?

Thanks for all you help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 5:15am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/6 "2003-04-02T05:15:36Z")

</div>

not exactly… replace the onLoad event handler you have with the one i posted 😉

```auto
loadText = new loadVars();
loadText.load("home.txt");
loadText.onLoad = function() {
scroller.html = true;
scroller.htmlText = this.hometext;
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 6:00am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/7 "2003-04-02T06:00:17Z")

</div>

now when I’m doing the markup in the txt file do I need the \<html\> tags and the \<body\> tags? Or just the \<a href\> tags?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 2, 2003, 6:21am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/8 "2003-04-02T06:21:41Z")

</div>

Just the \<a href\> tag

Since Flash only formats certain font formatting tags, your HTML and BODY tags will not be formatted, but will instead be printed out with the rest of the text.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 4, 2003, 5:51am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/9 "2003-04-04T05:51:30Z")

</div>

okay I’ve got the link working. Now how do I get it to open in a new window once the link is clicked?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 4, 2003, 6:07am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/10 "2003-04-04T06:07:54Z")

</div>

```php
<A TARGET="_blank" HREF="url">linktext</A>

```

I believe the target attribute works in Flash as well.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 4, 2003, 9:01pm UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/11 "2003-04-04T21:01:24Z")

</div>

Yeah it does but it would have to be target=’\_blank’ as the " will give you actionscript errors.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 4, 2003, 9:45pm UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/12 "2003-04-04T21:45:54Z")

</div>

Ah, yes you are right, I wasn’t thinking about there actually being double quotes around the whole tag, I just wrote out the HTML code.

My fault… good catch 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2003, 7:27pm UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/13 "2003-04-06T19:27:32Z")

</div>

OK I’m a little confused.

\<A TARGET="\_blank" HREF=“url”\>linktext\</A\>

So do I actually type in \_blank? Or do I need to put something else there? Also do I put the quotes around \_blank or something else?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2003, 8:37pm UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/14 "2003-04-06T20:37:41Z")

</div>

Just switch from double quotes to single quotes…

```php
<A TARGET='_blank' HREF='url'>linktext</A>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2003, 1:13am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/15 "2003-04-07T01:13:11Z")

</div>

wow, this forum is always full of such helpfull people!! :beam:

So now it opens in a new window. One more question. Is there a way to have the text show up underlined like a regualr hyperlink? Or should I just underline it in the txt file?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2003, 1:18am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/16 "2003-04-07T01:18:41Z")

</div>

Just use the underline HTML tag.

```php
<U>text</U>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2003, 2:02am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/17 "2003-04-07T02:02:06Z")

</div>

sweet! I didn’t know if that would work. I guess I should have tried.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2003, 2:04am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/18 "2003-04-07T02:04:42Z")

</div>

Font formatting tags work.

```php

<I></I>
<U></U>
<B></B>
<BR>
<FONT FACE='font' COLOR='#000000' SIZE='1'></FONT>

```

Etc etc, I don’t know all the exact tags that work, but there aren’t many, so just try it out and see if it works if you aren’t sure 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2003, 2:37am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/19 "2003-04-07T02:37:07Z")

</div>

[http://www.macromedia.com/support/flash/ts/documents/htmltext.htm](http://www.macromedia.com/support/flash/ts/documents/htmltext.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2003, 2:39am UTC](https://forum.kirupa.com/t/hyperlinks-in-flash/17177/20 "2003-04-07T02:39:22Z")

</div>

:cool: thanks kax, I was being lazy and didn’t feel like looking for it.

[Next page](https://forum.kirupa.com/t/hyperlinks-in-flash/17177.md?page=2)
