Asfunction from a dynamic text box

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:

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

And then this is my function:

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?

You need to encapsulate the cooking.swf, like this


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

That’s not working for me :frowning:

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

Thanks for the help anyway!!

[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!