flash action script FsCommand problem....

Status
Not open for further replies.
aahhh...
this is driving me nuts, i read the help on this at least five times....
i put some action script to a button:
on(release)
{fscommand(messagebox,"somehting")} //doing this on top of my head right now may have some errors
i pubished it, with the option to include fscommand
now i worte the javascript function
function messagebox(text)
{displaymessagebox....(text);}
is there anything im doing wrong??it does not want to work at all!!
 
If I remember right, you can't actually call a function from the FSCommand in flash. What you're actually doing is sending text strings.

FSCommand( <CmdString>, <argString> )

So, what you have to do is set up either a select of if/else to first see what command you're sending, then check the arguments (if you need to).

Here's some sample code from Macromedia adapted to accept a messagebox (I'm using JavaScript in my example):

in the Flash button:
code:<HR>
Code:
on (release) {
	fscommand ("messagebox", "Hello World!");
}

In the HTML page:
code:<HR>
Code:
<SCRIPT LANGUAGE=JavaScript>
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function Movie1_DoFSCommand(command, args) {
  var Movie1Obj = InternetExplorer ? Movie1 : document.Movie1;
  if(command == "messagebox") {
   	  alert(args) ;
  }
}
// IE hook code provided by Macromedia....

...
</script>
I tested this code, and it works fine.

edit: I can't type : P
 
Status
Not open for further replies.