# Asfunction from a dynamic text box

**URL:** <https://forum.kirupa.com/t/asfunction-from-a-dynamic-text-box/264366>\
**Category:** Uncategorized\
**Created:** [June 25, 2008, 2:08pm UTC](https://forum.kirupa.com/t/asfunction-from-a-dynamic-text-box/264366 "2008-06-25T14:08:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaggieBroon](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@MaggieBroon](https://forum.kirupa.com/u/MaggieBroon)\
**Post date:** [June 25, 2008, 2:08pm UTC](https://forum.kirupa.com/t/asfunction-from-a-dynamic-text-box/264366/1 "2008-06-25T14:08:20Z")

</div>

Hello.

I have a site built in flash using a dynamic text box and the text includes a link to another page within the flash site. I cant seem to get the asfunction to do ANYTHING never mind launch the page.

Am I doing it right? This is in my external text file:

```auto
<a href='asfunction:launchPage, cooking.swf'>What's Cooking?</a>

```

And then this is my function:

```auto
function launchPage(pagename) {
   _global.newpage = pagename;
   this.gotoAndPlay("out");
}

```

But to be honest I cant even make it do a trace so I dont _think_ its the function thats the problem.

Any ideas?

---

<div class="post-metadata">

**Author:** ![RubenFlash](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@RubenFlash](https://forum.kirupa.com/u/RubenFlash)\
**Post date:** [June 25, 2008, 2:41pm UTC](https://forum.kirupa.com/t/asfunction-from-a-dynamic-text-box/264366/2 "2008-06-25T14:41:11Z")

</div>

You need to encapsulate the cooking.swf, like this

```auto

<a href="asfunction:launchPage, 'cooking.swf'">What's Cooking?</a>

```

---

<div class="post-metadata">

**Author:** ![MaggieBroon](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@MaggieBroon](https://forum.kirupa.com/u/MaggieBroon)\
**Post date:** [June 25, 2008, 3:03pm UTC](https://forum.kirupa.com/t/asfunction-from-a-dynamic-text-box/264366/3 "2008-06-25T15:03:54Z")

</div>

That’s not working for me ☹

---

<div class="post-metadata">

**Author:** ![MaggieBroon](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@MaggieBroon](https://forum.kirupa.com/u/MaggieBroon)\
**Post date:** [June 25, 2008, 3:31pm UTC](https://forum.kirupa.com/t/asfunction-from-a-dynamic-text-box/264366/4 "2008-06-25T15:31:31Z")

</div>

Ah I figured it out. I put the Function in the root & targeted it with asfunction:\*\*\_root.\*\*launchPage

Thanks for the help anyway!!

---

<div class="post-metadata">

**Author:** ![RubenFlash](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@RubenFlash](https://forum.kirupa.com/u/RubenFlash)\
**Post date:** [June 25, 2008, 3:34pm UTC](https://forum.kirupa.com/t/asfunction-from-a-dynamic-text-box/264366/5 "2008-06-25T15:34:14Z")

</div>

[quote=MaggieBroon;2348883]Ah I figured it out. I put the Function in the root & targeted it with asfunction:\*\*\_root.\*\*launchPage

Thanks for the help anyway!![/quote]

No problem. Glad you figured it out!
