Understanding and Using fscommand()
Số trang: 8
Loại file: pdf
Dung lượng: 30.77 KB
Lượt xem: 14
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Sự hiểu biết và sử dụng fscommand () fscommand () là một chức năng cho phép một bộ phim Flash để giao tiếp với các ứng dụng hiện đang nắm giữ các bộ phim. Sau đây là những ví dụ về các ứng dụng mà giữ (chủ nhà) Flash phim
Nội dung trích xuất từ tài liệu:
Understanding and Using fscommand() < Day Day Up > < Day Day Up >Understanding and Using fscommand()fscommand() is a function that enables a Flash movie to communicate with theapplication thats currently holding the movie. The following are examples ofapplications that hold (host) Flash movies: • Standalone Flash player • Web browser • Executable that displays the Flash movie, such as those created by third-party tools discussed later in this lesson; or executables created using C++, Visual Basic, and so onIts simple to use an FSCommand from within Flash. The fscommand() function acceptstwo parameters: a command name, and optional extra information. The extra informationis used as a parameter of the command:fscommand(command_name, optional extra stuff);When Flash executes an fscommand(), the host application receives notification that acommand has been sent to it. The name of the command is sent, as well as any optionalparameter data. The host application must be programmed to deal with these incomingcommands; it looks at the name of the incoming command and reacts accordingly, usingany optional parameter data to complete the task. This functionality will become cleareras we progress in this lesson. < Day Day Up >Lets explore in detail some of the previously mentioned uses of the fscommand()function.Controlling the Standalone Flash Player (Projectors)Using the Publish settings in Flash, you can publish a Flash movie as a projector. Aprojector file typically contains your movie as well as the Flash player. Opening the filecauses your movie to play in its own application window (the Flash player/Projectorwindow). The fscommand() function can be used in your movie so that it cancommunicate with the projector in various ways. There are six built-in FSCommands thatthe standalone player can execute:fscommand(quit)This command closes the standalone player window.fscommand(fullscreen, true) < Day Day Up >orfscommand(fullscreen, false)This command forces the standalone player to play at full screen (if true) or at the definedmovie size (if false).fscommand(allowscale, true)orfscommand(allowscale, false)This command determines what happens if the user resizes the projector window whileyour movie is playing. If true, the movie is scaled to fit 100% in the resized standaloneplayer window. If false, the player window is still resizable, but the movie playing insideit remains at its original size.fscommand(showmenu, true)orfscommand(showmenu, false)Right-clicking (Control-clicking on a Macintosh) a movie playing in the standaloneplayer opens a context menu. The minimal version of this menu is shown if this < Day Day Up >fscommand() parameter is set to false. The full menu is shown if true.fscommand(exec, fileName)This command executes (opens) another application (such as an .EXE file on Windows).The parameter is the filename of the application to open. Applications opened using thiscommand must reside in a folder named fscommand. This folder must reside in the samedirectory as the projector.fscommand(trapallkeys, true)orfscommand(trapallkeys, false)If true, all key events are sent to the Flash player. If false, certain key events such asaccelerator keypresses are not sent.Any of these commands can be executed from within your movie using syntax similar tothe following:myButton_btn.onRelease = function(){ fscommand(quit);}Standalone FSCommands have no effect on Flash movies played outside the stand alone < Day Day Up >player.Executing Applescripts with FscommandsAppleScript is a built-in scripting language for the Macintosh operating system.AppleScripts (files containing AppleScript code) are used to tell the operating system toperform tasks such as these: • Batch processing • File conversion and manipulation • Performing tasks at specified timesOne of the more powerful aspects of using the exec FSCommand in a Macintosh-basedprojector is its capability to execute an AppleScript. Lets look at a simple example.NOTEThis is not intended to be extensive instruction on how to create AppleScripts, but rathera simple demonstration of how AppleScripts can be executed via Flash. For moreinformation on AppleScript, visit http://www.apple.com/applescript/.The following AppleScript opens the file named catalog.pdf on the My CD disk:tell application Finderactivateselect file catalog.pdf of disk My CDopen selectionend tellTo execute this AppleScript from Flash, you name it (for example, launchCatalog), saveit in the fscommand folder, and create a script within your Flash movie similar to thefollowing:myButton_btn.onRelease = function(){ < Day Day Up > fscommand(exec, launchCatalog);}When myButton_btn is clicked, the launchCatalog AppleScript is executed, andcatalog.pdf opens.Communicating with a Web BrowserWhen a Flash movie is embedded in an HTML page and the page is viewed in a Webbrowser, the fscommand() function enables the Flash movie to communicate with thebrowser via JavaScript. This feature allows you to do tasks such as open alert boxes,resize the browser, and other JavaScript activities.NOTEBecause the success of this communication depends on the specific browser and version,some Flash developers limit their use of the fscommand() function. For more informationabout using the FSCommand to communicate with a browser, visitwww.macromedia.com.Creating an Enhanced Executable (Projector)Several companie ...
Nội dung trích xuất từ tài liệu:
Understanding and Using fscommand() < Day Day Up > < Day Day Up >Understanding and Using fscommand()fscommand() is a function that enables a Flash movie to communicate with theapplication thats currently holding the movie. The following are examples ofapplications that hold (host) Flash movies: • Standalone Flash player • Web browser • Executable that displays the Flash movie, such as those created by third-party tools discussed later in this lesson; or executables created using C++, Visual Basic, and so onIts simple to use an FSCommand from within Flash. The fscommand() function acceptstwo parameters: a command name, and optional extra information. The extra informationis used as a parameter of the command:fscommand(command_name, optional extra stuff);When Flash executes an fscommand(), the host application receives notification that acommand has been sent to it. The name of the command is sent, as well as any optionalparameter data. The host application must be programmed to deal with these incomingcommands; it looks at the name of the incoming command and reacts accordingly, usingany optional parameter data to complete the task. This functionality will become cleareras we progress in this lesson. < Day Day Up >Lets explore in detail some of the previously mentioned uses of the fscommand()function.Controlling the Standalone Flash Player (Projectors)Using the Publish settings in Flash, you can publish a Flash movie as a projector. Aprojector file typically contains your movie as well as the Flash player. Opening the filecauses your movie to play in its own application window (the Flash player/Projectorwindow). The fscommand() function can be used in your movie so that it cancommunicate with the projector in various ways. There are six built-in FSCommands thatthe standalone player can execute:fscommand(quit)This command closes the standalone player window.fscommand(fullscreen, true) < Day Day Up >orfscommand(fullscreen, false)This command forces the standalone player to play at full screen (if true) or at the definedmovie size (if false).fscommand(allowscale, true)orfscommand(allowscale, false)This command determines what happens if the user resizes the projector window whileyour movie is playing. If true, the movie is scaled to fit 100% in the resized standaloneplayer window. If false, the player window is still resizable, but the movie playing insideit remains at its original size.fscommand(showmenu, true)orfscommand(showmenu, false)Right-clicking (Control-clicking on a Macintosh) a movie playing in the standaloneplayer opens a context menu. The minimal version of this menu is shown if this < Day Day Up >fscommand() parameter is set to false. The full menu is shown if true.fscommand(exec, fileName)This command executes (opens) another application (such as an .EXE file on Windows).The parameter is the filename of the application to open. Applications opened using thiscommand must reside in a folder named fscommand. This folder must reside in the samedirectory as the projector.fscommand(trapallkeys, true)orfscommand(trapallkeys, false)If true, all key events are sent to the Flash player. If false, certain key events such asaccelerator keypresses are not sent.Any of these commands can be executed from within your movie using syntax similar tothe following:myButton_btn.onRelease = function(){ fscommand(quit);}Standalone FSCommands have no effect on Flash movies played outside the stand alone < Day Day Up >player.Executing Applescripts with FscommandsAppleScript is a built-in scripting language for the Macintosh operating system.AppleScripts (files containing AppleScript code) are used to tell the operating system toperform tasks such as these: • Batch processing • File conversion and manipulation • Performing tasks at specified timesOne of the more powerful aspects of using the exec FSCommand in a Macintosh-basedprojector is its capability to execute an AppleScript. Lets look at a simple example.NOTEThis is not intended to be extensive instruction on how to create AppleScripts, but rathera simple demonstration of how AppleScripts can be executed via Flash. For moreinformation on AppleScript, visit http://www.apple.com/applescript/.The following AppleScript opens the file named catalog.pdf on the My CD disk:tell application Finderactivateselect file catalog.pdf of disk My CDopen selectionend tellTo execute this AppleScript from Flash, you name it (for example, launchCatalog), saveit in the fscommand folder, and create a script within your Flash movie similar to thefollowing:myButton_btn.onRelease = function(){ < Day Day Up > fscommand(exec, launchCatalog);}When myButton_btn is clicked, the launchCatalog AppleScript is executed, andcatalog.pdf opens.Communicating with a Web BrowserWhen a Flash movie is embedded in an HTML page and the page is viewed in a Webbrowser, the fscommand() function enables the Flash movie to communicate with thebrowser via JavaScript. This feature allows you to do tasks such as open alert boxes,resize the browser, and other JavaScript activities.NOTEBecause the success of this communication depends on the specific browser and version,some Flash developers limit their use of the fscommand() function. For more informationabout using the FSCommand to communicate with a browser, visitwww.macromedia.com.Creating an Enhanced Executable (Projector)Several companie ...
Tìm kiếm theo từ khóa liên quan:
máy tính mạng máy tính internet phần mềm ứng dụng lập trình SQL HTML sever web XMLTài liệu có liên quan:
-
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 2
102 trang 299 0 0 -
Giáo án Tin học lớp 9 (Trọn bộ cả năm)
149 trang 299 0 0 -
Bài giảng: Lịch sử phát triển hệ thống mạng
118 trang 283 0 0 -
Ngân hàng câu hỏi trắc nghiệm môn mạng máy tính
99 trang 280 1 0 -
47 trang 250 4 0
-
Đề cương chi tiết học phần Thiết kế và cài đặt mạng
3 trang 247 0 0 -
80 trang 239 0 0
-
6 trang 230 0 0
-
Giáo trình môn học/mô đun: Mạng máy tính (Ngành/nghề: Quản trị mạng máy tính) - Phần 1
68 trang 227 0 0 -
122 trang 223 0 0