MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuel d'utilisateur Page 18

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 155
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 17
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
15
Availability
Flash Communication Server 1
Example
The following example checks the
name property against a specific string before it executes some code:
if (application.name == "videomail/work"){
// Insert code here.
}
application.onAppStart()
application.onAppStart = function (){}
Invoked when the server first loads the application instance. Use this handler to initialize an application state. The
onAppStart() event is invoked only once during the lifetime of an application instance.
Availability
Flash Communication Server 1
Example
application.onAppStart = function (){
trace ("*** sample_guestbook application start");
// Create a reference to a persistent shared object.
application.entries_so = SharedObject.get("entries_so", true);
// Prevent clients from updating the shared object.
application.entries_so.lock();
// Get the number of entries saved in the shared object
// and save it in application.lastEntry.
var maxprop = 0;
var soProperties = application.entries_so.getPropertyNames();
trace("soProperties:" + soProperties);
if (soProperties == null) {
application.lastEntry = 0;
} else {
for (var prop in soProperties) {
maxprop = Math.max (parseInt(prop), maxprop);
trace("maxprop " + maxprop);
}
application.lastEntry = maxprop+1;
}
// Allow clients to update the shared object.
application.entries_so.unlock();
trace("*** onAppStart called.");
};
application.onAppStop()
application.onAppStop = function (info){}
Invoked when the server is about to unload an application instance. You can use onAppStop() to flush the appli-
cation state or to prevent the application from being unloaded.
Vue de la page 17
1 2 ... 13 14 15 16 17 18 19 20 21 22 23 ... 154 155

Commentaires sur ces manuels

Pas de commentaire