This is a discussion on Re: execute javascript? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; It's not as complicated as all that. Just put the JS function you want to call on the same ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
It's not as complicated as all that. Just put the JS function you want to
call on the same HTML page where the Flash movie sits and then from within the Flash movie do this... getURL("javascript:myFunction('variable');"); That will call the function. Best, ZeroLogik - the tech podcast that entertains, educates, and judges everything you care about! www.zerologik.com On Wed, 25 Jan 2006 11:13:19 -0800, roN <NOspam@example.com> wrote: > Hi, > > I would like to execute a Javascript from my Flash movie, > for that I included following ActionScript: > [AS] > on (release) > { > fscommand("showMessageBox","I'm just a test ;)"); > } > [/AS] > And I have following html code (created by flash, just added the [if]): > HTML Code:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > /> > <title>banner_without_sound(link)</title> > </head> > <body bgcolor="#ffffff"> > <script language="JavaScript"> > <!-- > var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1; > // Handle all the FSCommand messages in a Flash movie. > function banner_without_sound(link)_DoFSCommand(command, args) { > var banner_without_sound(link)Obj = isInternetExplorer ? > document.all.banner_without_sound(link) : > document.banner_without_sound(link); > // > if (command == "showMessageBox") > { > alert(args); > } > // > } > // Hook for Internet Explorer. > if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && > navigator.userAgent.indexOf("Windows") != -1 && > navigator.userAgent.indexOf("Windows 3.1") == -1) { > document.write('<script language=\"VBScript\"\>\n'); > document.write('On Error Resume Next\n'); > document.write('Sub banner_without_sound(link)_FSCommand(ByVal > command, > ByVal args)\n'); > document.write(' Call > banner_without_sound(link)_DoFSCommand(command, > args)\n'); > document.write('End Sub\n'); > document.write('</script\>\n'); > } > //--> > </script> > <!--url's used in the movie--> > <a href="FSCommand:showMessageBox"></a> > <!--text used in the movie--> > <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" > id="banner_without_sound(link)" width="607" height="67" align="middle"> > <param name="allowScriptAccess" value="sameDomain" /> > <param name="movie" value="banner_without_sound(link).swf" /> > <param name="quality" value="high" /> > <param name="bgcolor" value="#ffffff" /> > <embed src="banner_without_sound(link).swf" quality="high" > bgcolor="#ffffff" > width="607" height="67" swLiveConnect=true > id="banner_without_sound(link)" > name="banner_without_sound(link)" align="middle" > allowScriptAccess="sameDomain" type="application/x-shockwave-flash" > pluginspage="http://www.macromedia.com/go/getflashplayer" /> > </object> > </body> > </html> > > Why doesn't it work? It's supposed to just releasing a MessageBox saying > "I'm just a test ;)" but it doesn't, why not? > Thank you! -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ |