# Dynamic text with links

**URL:** https://forum.kirupa.com/t/dynamic-text-with-links/61408
**Category:** Uncategorized
**Created:** [August 18, 2004, 11:48am UTC](https://forum.kirupa.com/t/dynamic-text-with-links/61408 "2004-08-18T11:48:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Urme](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@Urme](https://forum.kirupa.com/u/Urme)
#### Post date: [August 18, 2004, 11:48am UTC](https://forum.kirupa.com/t/dynamic-text-with-links/61408/1 "2004-08-18T11:48:33Z")

</div>

Hi,

I have a dynamic text field where I import the text from a php file. It is html-enabled and some words are links in that text to other parts of the Flash file.

The text can be something like this:

```php

$alotoftext = "asd asd sad asd as ds da sds d <a href=\"asfunction, link, 1\">This is a link</a> and some more text";

```

Is it possible to do a “hover/over” function for that link? Maybe change the color of the text 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: [August 19, 2004, 3:45am UTC](https://forum.kirupa.com/t/dynamic-text-with-links/61408/2 "2004-08-19T03:45:35Z")

</div>

If you are targeting the Flash Player version 7, then you can do this using the new CSS features in it. You need to have css with a:hover and a:link styles defined. You can either do this in code or use stylesheet.load to load an external css file instead.

```php

	createTextField ("txt", 1, 0, 0, 300, 300);
	txt.html = true;
	txt.multiline = true;
	txt.wordWrap = true;
	txt.border = true;
	
	css = new TextField.StyleSheet ();
	css.setStyle ("a:link", {color:"#0000FF"});
	css.setStyle ("a:hover", {color:"#FF0000"});
	
	txt.htmlText = "<a href='asfunction:trace,link1'>Link 1</a><br><a href='asfunction:trace,link2'>Link 2</a>";
	txt.styleSheet = css;

```
