Making the Scheduler Application Available Online

The scheduler application that you have created thus far retains a user’s schedule only when it is run consistently from the same computer. This is because the schedule data is stored in a local shared object. However, with just a few small changes, you can adapt this application so it can be accessed online from any computer. In the next two sections, you can choose from three different alternatives for how to do this.

Using Remote Shared Objects

The easiest way to convert the scheduler application to make it available online is to store the data in a remote shared object instead of a local shared object. However, this option is available only if you have access to a FlashCom server.

To modify the application to use a remote shared object, complete the following steps:

  1. Create a new FlashCom application on the server. Name the application schedulerApp.

  2. Edit the Schedule component code, as shown in the following code block. Most of the code remains the same, so only the code that changes is shown. Modifications are shown in bold.

    #initclip
    
    function Schedule(  ) {
      this.items = new Object(  );
      this.notifiers = new Object(  );
    
      // Create a new net connection and connect to the FlashCom application.
      var myConnection = new NetConnection(  );
                              myConnection.connect("rtmp:/schedulerApp");
      // Create a remote shared object and connect to it. When the shared object date
      // is retrieved, call the setValues(  ) method.
      this.so = SharedObject.getRemote("mySchedule", ...

Get Actionscript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.