Flash
  Home arrow Flash arrow Page 2 - Nonpersistent Client-Side Remote Shared Ob...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Nonpersistent Client-Side Remote Shared Objects
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2009-01-08

    Table of Contents:
  • Nonpersistent Client-Side Remote Shared Objects
  • Instantiating Remote Shared Objects
  • Inspecting a Shared Object
  • Minimalist Project for Shared Movie Clip

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Nonpersistent Client-Side Remote Shared Objects - Instantiating Remote Shared Objects


    (Page 2 of 4 )

    This chapter is going to demonstrate three different remote shared objects with minimal code. The first will be a pointer that allows you to point to any location on another person’s page. This kind of pointer can come in handy if you’re making a presentation to a remote location and you have to point out different things to the audience. Second, you will see how to make a minimal text chat where the text entered into an input text box shows up on all of the users’ screens. Finally, using a shared movie clip, you will see how to open up web pages on remote viewers’ screens. These are all minimal examples, but they show how you can do different things with remote shared objects. The rest is up to your imagination.

    First, though, note that instantiating a shared object is a little different than most class instances. The general format for instantiating a shared object is shown in Figure 4-1.


    Figure 4-1.  Instantiating ShardObject class

     

    Generally, it’s a good idea to set the scope of the shared object by simply declaring the shared object’s name and data type, such as:

      var my_so:SharedObject;

    If your declaration is at the top level you can do the actual instantiation in different scopes. If you want to use a single step for the instantiation and declaration, you would use the format:

      var so:SharedObjec=SharedObject.getRemote(string,uri);

    Setting Up Shared Object Storage: Slots

    When you set up a shared object instance, you need to set up a storage system based around the object’s dataproperties. By assigning different attributes to thedataproperty you can create slots using most kinds of data types. The following shows a simple data slot:

      var memberName:String= name_txt.text;
      so.data.nameNow = memberName;

    The shared object has adataattribute,nameNow. So it now has a storage slot for a string name that can be shared with others connected to the same application. In the same way, you can set up as many slots as your application needs, using the appropriate data type for the data to be stored.

    More Flash Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Learning Flash Media Server 2, an O'Reilly...
     

    FLASH ARTICLES

    - Critical Flash Vulnerability Heats Up the Web
    - More on Nonpersistent Client-Side Remote Sha...
    - Nonpersistent Client-Side Remote Shared Obje...
    - Using the Decorator Pattern for a Real Web S...
    - Using Concrete Decorator Classes
    - Delving More Deeply into the Decorator Patte...
    - The Decorator Pattern in Action
    - A Simple Decorator Pattern Example
    - Decorator Pattern
    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek