O'Reilly logo

Actionscript Cookbook by Joey Lott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required