This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > September 2005 > Re: Displaying .js content within flash...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Displaying .js content within flash...
David Stiller

2005-09-21, 7:24 pm

Ben,

> I have this script which will show the latest topic from my
> message board.
>
> <script language="JavaScript" type="text/javascript"
> src="http://www.deepandtwisted.co.uk/community/
> topics_anywhere.php?mode=show&f=a&n=10&b=non&lp
> i=y&t=_blank"></script>


JavaScript requires a JavaScript engine, which isn't included with Flash
(Flash has its own script, ActionScript). Most browsers have a JavaScript
engine, which is why scripts like the one above usually work in a browser.

You can use the getURL() function in ActionScript to trigger JavaScript
in the HTML page, but ... well, your script points to a PHP file and
features a number of parameters. I presume the PHP file returns a string of
JavaScript rather than a normal page ... if this is so, you *may* be able to
use getURL() with the java script: protocol, as referenced in the
documentation, but I'm not sure your SWF will be able to "get" that it has
to hit the PHP document first to retrieve the JavaScript.

getURL("java script:'http://www.deepandtwisted.co.uk/community/topics_anywhere.php?code=show&f=a&n=10&b=non&lpi=y&t=_blank'");


David
stiller (at) quip (dot) net
"Luck is the residue of good design."


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews