MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Specifiche Pagina 131

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 369
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 130
Application Development Tips and Tricks 53
On the server side
On the server side, you must implement slightly different code, using
global instead of _root.
Here, assume you want to include a file called my_file.asc.
if (global._my_file_asc == null) {
global._my_file_asc = true;
// All the code for myfile.asc goes here
}
Also, instead of using the #include command, the server-side script uses a load command:
load("my_file.asc");
Using unique instance names
A typical deployment environment consists of multiple users connecting to the same server at the
same time. To avoid collisions such as streams getting crossed or shared objects being overwritten,
use unique instance names in your
NetConnection.connect commands. This technique is
discussed in detail elsewhere in this manual (see “Applications and application instances” on page
14). It is included here as a reminder of how important this is to Flash Communication Server
application development.
Adding the NetConnection debugger file
Get in the habit of including the NetConnection debugger file in the first line of your client-side
source code. Adding the following ActionScript to your FLA file allows you to view important
details about your network connection to the server.
#include "NetDebug.as"
Forcing the Player Settings panel to appear
When an application tries to access the user’s camera or microphone, or to save data on the client
machine, the Flash Player displays the Player Settings dialog boxes to get permission. The user can
also open the Player Settings panels by right-clicking (Windows) or Control-clicking (Macintosh)
on the player Stage. If you want to force the Player Settings panels to appear, use the following
code:
// Opens the panel the user viewed last
System.ShowSettings();
// Opens the Privacy panel
System.ShowSettings(0);
// Opens the Local Storage panel
System.ShowSettings(1);
// Opens the Microphone panel
System.ShowSettings(2);
// Opens the Camera panel
System.ShowSettings(3);
For example, if your application requires the use of a camera, you can inform the user that they
must choose “Allow” in the Privacy Settings panel, and then issue a
System.showSettings(0)
command. (Make sure your Stage size is at least 215 by 138 pixels; this is the minimum size Flash
requires to display the panel.) For more information, see
System.showSettings in the Client-
Side Communication ActionScript Dictionary.
Vedere la pagina 130
1 2 ... 126 127 128 129 130 131 132 133 134 135 136 ... 368 369

Commenti su questo manuale

Nessun commento