?????????????????
???????Colin Moock???
????????http://moock.org/webdesign/flash/fscommand/
????????????????????
?????????,????!
???
FS Command????
?FS Command?????
???????
????Flash ? JavaScript???
????JavaScript ? Flash ???
??? Flash JavaScript??????
??????????
FS Command????
????????????“fscommand”????Flash?JavaScript?????????Flash?Web??????JavaScript???????fscommand()??????????????????????????????fscommand()????????
“fscommand()”?Flash????????????Flash ??????????“????”??????????Flash?????????????????????Flash Player??????????????Web??????????Web?fscommand()??????Flash???click?????JavaScript???????????JavaScript?????Flash?????????Fscommand()??????Lingo???????????????????Flash Player???????“Quit”?“FullScreen”?“AllowScale”?“ShowMenu”??
?FS Command?????
????????????Web???fscommand()?????????Web???????Flash????????????????????fscommand()????????????????
·netscape 3 or 4 on win95/98/nt and mac ppc
·internet explorer 3 and greater on win95/98/nt
·netscape 6.2 (and later) running flash player 6.0.40.0 (and later)
??????fscommand()????????
·??? windows 3.1?????
·??? macintosh 68k ???????
·???Mac????IE
·netscape 6.1 ? 6.0 ?? flash player 6.0.29.0 ???????? (liveconnect ?????mozilla???????? ??mozilla????????????????? mozilla plugin api). ?? bugs 37710 ? 18838.
?????????Active X?IE???LiveConnect?Netscape 4???????????????????????????????????Flash 3??????Netscape 4????fscommand ?Flash????????????????LiveConnect????????Flash???????Netscape 6.2????????LiveConnect??????LiveConnect???????????????????EMBED ?????? swLiveConnect = “true”? ????????????Netscape?????? ”Starting Java…”????Java?????????
???????
?????????????????fscommand????????????????????????????fscommand???Flash?JavaScript????????????????????????JavaScript?Flash????
????Flash ? JavaScript???
?????fscommand()????JavaScript???????????JavaScript?????getURL()????????????<A>??JavaScript????GetURL()???fscommand()?????????????????????????????????????????????JavaScript??getURL??????????????????fscommand()????????
??fscommand()???????Flash????????JavaScritp???????????Flash?fscommand???????????????????JavaScript?????IE????VB Script?????????“??”fscommand?????????????????????“??”????????????????——???????fscommand() ???“Command”?“Arguments”???
???????????????????fscommand()?????JavaScript????Fscommand????”call_alert”?”Hello world!”?
?????
fscommand(“call_alert”, “Hello world!”);
????fscommand???Netscape?IE??????????????????????????????Flash?JavaScript??????????Flash???????????????????????????
????
FS Command?????Flash??JavaScript???
?????????????Flash??JavaScript?FS Command????????????1?Zip??????.fla?.swf?.html?????????????????????? Flash MX Professional 2004?????
1)?Flash???FS Command???
·????????????????????????????
·????????F9????????
·????????“??”???“+”?????“????”---“???/??”---fscommand()??????“fscommand”???????????????????????“Command”?“Arguments”???????????JavaScript?“fscommand??”????????????????????????Command????????????????Arguments???????????
·??????“"call_alert", "Hello world!"”;
2)????????HTML????
?????????HTML???????OBJECT ?EMBED??????????OBJECT ?EMBED??????????????OBJECT????”ID”??EMBED????”NAME”?????????????????????OBJECT ?EMBED?????????FS Command????????????????????FS Command????????????Netscape????LiveConnect???“swLiveConnect = “true””????????????????ID?NAME?swLiveConnect?????????????
<HTML>
<HEAD>
<TITLE>My First FS Command</TITLE>
</HEAD>
<BODY>
<OBJECT
CLASSID="clsid : D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="100%"
HEIGHT="100%"
CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
ID=testmovie>
<PARAM NAME="MOVIE" VALUE="mymovie.swf">
<PARAM NAME="PLAY" VALUE="true">
<PARAM NAME="LOOP" VALUE="true">
<PARAM NAME="QUALITY" VALUE="high">
<PARAM NAME="SCALE" VALUE="SHOWALL">
<EMBED
NAME="testmovie"
SRC="mymovie.swf"
WIDTH="100%"
HEIGHT="100%"
PLAY="false"
LOOP="false"
QUALITY="high"
SCALE="SHOWALL"
swLiveConnect="true"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</BODY>
</HTML>
3)?IE?????VB Script???
??????1???2?????IE????????VB Script?????fscommand??????????JavaScript????????????????VB Script????HTML???HEAD?????????“testmovie”????OBJECT ?EMBED????????????
<SCRIPT LANGUAGE="VBScript">
<!--
// Catch FS Commands in IE, and pass them to the corresponding JavaScript function.
Sub testmovie_FSCommand(ByVal command, ByVal args)
call testmovie_DoFSCommand(command, args)
end sub
// -->
</SCRIPT>
4)??JavaScript?????fscommand???
?????????????????????fscommand?????????????????HTML????????VB Script???????JavaScript??fscommand??——????????IE???????JavaScript????HEAD?????????“testmovie” ????OBJECT ?EMBED????????????
<SCRIPT LANGUAGE="JavaScript">
<!--
function testmovie_DoFSCommand(command, args) {
if (command == "call_alert") {
alert("Here's the Flash message: " + args);
}
}
//-->
</SCRIPT>
??JavaScript??????“testmovie_DoFSCommand”?????????“testmovie”???fscommand??????“DoFSCommand” ????Flash????????????fscommand???????“testmovie_”??????????????????????“testmovie”?????FS Command??????“testmovie_DoFSCommand”????????“(command, args)”??????????????????Flash??????? “Command”?“Arguments”????——“call_alert”?“Hello world!”
????JavaScript?????????FS Command???????????????
??????????? |