RSS


[ Pobierz całość w formacie PDF ]
.The fscommand() function has two parameters: command and arguments.To send a message tothe stand-alone version of Flash Player, you must use predefined commands and arguments.Forexample, the following action sets the stand-alone player to scale the SWF file to the full monitorscreen size when the button is released:on(release){fscommand("fullscreen", "true");}The following table shows the values you can specify for the command and arguments parametersof fscommand() to control a SWF file playing in the stand-alone player (including projectors):Command Arguments PurposequitNone Closes the projector.fullscreentrue or false Specifying true sets Flash Player to full-screen mode.Specifying false returns the player to normal menu view.allowscaletrue or false Specifying false sets the player so that the SWF file is alwaysdrawn at its original size and never scaled.Specifying trueforces the SWF file to scale to 100% of the player.showmenutrue or false Specifying true enables the full set of context menu items.Specifying false dims all the context menu items exceptSettings and About Flash Player.execPath to Executes an application from within the projector.applicationTo use fscommand() to send a message to a scripting language such as JavaScript in a webbrowser, you can pass any two parameters in the command and arguments parameters.Theseparameters can be strings or expressions and will be used in a JavaScript function that  catches,or handles, the fscommand() function.An fscommand() function invokes the JavaScript function moviename_DoFSCommand in theHTML page that embeds the SWF file, where moviename is the name of Flash Player as assignedby the NAME attribute of the EMBED tag or the ID attribute of the OBJECT tag.If Flash Player isassigned the name myMovie, the JavaScript function invoked is myMovie_DoFSCommand.186 Chapter 10: Working with External Data To use fscommand() to open a message box from a SWF file in the HTML pagethrough JavaScript:1 In the HTML page that embeds the SWF file, add the following JavaScript code:function theMovie_DoFSCommand(command, args) {if (command == "messagebox") {alert(args);}}If you publish your SWF file using the Flash with FSCommand template in the HTMLPublish Settings dialog box, this code is inserted automatically.The SWF file s NAME and IDattributes will be the filename.For example, for the file myMovie.fla, the attributes would beset to myMovie.(For more information about publishing, see  Publishing in UsingFlash Help.)Alternatively, for Microsoft Internet Explorer applications, you can attach an event handlerdirectly in the tag, as shown in this example:.2 In the Flash document, add the fscommand() function to a button, as shown in this example:on(press) {fscommand("messagebox", "This is a message box invoked from withinFlash.");}You can also use expressions for fscommand() and parameters, as in this example:fscommand("messagebox", "Hello, " + name + ", welcome to our website!")3 Select File > Publish Preview > HTML to test the document.The fscommand() function can send messages to Macromedia Director that are interpreted byLingo as strings, events, or executable Lingo code.If the message is a string or an event, you mustwrite the Lingo code to receive it from the fscommand() function and carry out an action inDirector.For more information, see the Director Support Center at www.macromedia.com/support/director.In Visual Basic, Visual C++, and other programs that can host ActiveX controls, fscommand()sends a VB event with two strings that can be handled in the environment s programminglanguage.For more information, use the keywords Flash method to search the Flash SupportCenter at www.macromedia.com/support/flash.About Flash Player methodsYou can use Flash Player methods to control a SWF file in Flash Player from web browserscripting languages such as JavaScript and VBScript.As with other methods, you can use FlashPlayer methods to send calls to SWF files from a scripting environment other than ActionScript.Each method has a name, and most methods take parameters.A parameter specifies a value thatthe method operates upon.The calculation performed by some methods returns a value that canbe used by the scripting environment.Sending messages to and from Flash Player 187 There are two different technologies that enable communication between the browser and FlashPlayer: LiveConnect (Netscape Navigator 3.0 or later on Windows 95/98/2000/NT or PowerMacintosh) and ActiveX (Internet Explorer 3.0 and later on Windows 95/98/2000/NT).Although the techniques for scripting are similar for all browsers and languages, there areadditional properties and events available for use with ActiveX controls.For more information, including a complete list of Flash Player scripting methods, use thekeywords Flash method to search the Flash Support Center at www.macromedia.com/support/flash [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • nvs.xlx.pl