Mailing List
Home
Forum Home
Flash Pro
Subjects
Subject: RE: Firework Effect
Web Service Results
Flash Interface with 10mb xml file
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash MX 2004 Sucks
Reading and displaying RSS feeds in Flash MX
Flash and QuickTime VR
Textfield prototype question
XML to Object help
Order of events per frame
MX2004 Dataset itemClassName
memory management removeMovieClip /
Event Dispatcher between classes
Help: MX 2004 How to script a print button to print the entire sli
ScrollPane component doesn 't auto update
setInterval bug identified and fixed
setInterval bug identified and fixed
Listener Object 's best practice
 
Subject: SharedObjects

Subject: SharedObjects

2004-03-04       - By Jesse Warden

 Back
Reply:     1     2  

You define the onSync before the so.connect, right?  Make sure you do.

Secondly, the first parameter of a remote shared object's onSync method is
an array of change objects, not an object.  You can modify your code like
so:

this.so.onSync = function(shareArray:Object){
  trace("*** SharedObject.onSync ***");
  var i = shareArray.length;
  while(i--){
    var o = shareArray[i];
    switch (o.code){
      case "change":
        trace("Change");
      case "success":
        trace("Success");
      case "reject":
        trace("Reject");
      case "clear":
        trace("Clear");
      case "delete":
        trace("Delete");
    }
  }
};

       trace( "Synchronizing Data");

       for (name in shareInfo){
           switch (shareInfo[name].code){
           
           case "change":
               trace("Change");
               
           case "success":
               trace("Success");
           case "reject":
               trace("Reject");
           case "clear":
               trace("Clear");
           case "delete":
               trace("Delete");
           }
       }

-- --Original Message-- --
From: Clint Little [mailto:clittle@(protected)]
Sent: Wednesday, March 03, 2004 05:52 PM
To: flashnewbie@(protected)
Subject: [Flashnewbie] SharedObjects


Hey all, I posted this on FlashComm but got no response so I was hoping
someone over here could help me.

I am working with the sharedObject class and having some stuff I am just not
following happen. I make a connection to the flashComm with no problems (get
a connection success message).

Once the connection is made, I setup my sharedObject like this:

   this.so = SharedObject.getRemote("graphInfo", netConnect.uri, true);
   this.so.connect(netConnect);


Then in an input window I type some text, press a button, and the click of
that button is to change the data property of my sharedObject like this:

   // Set Shared Object
   this.so.data["aPlace"] = textInfo;

So from my understanding, once this happens, a onSync event is to occur
where I can then check the status code and handle properly. The problem is I
am not getting any onSync event. Here is the code for that check.

   this.so.onSync = function(shareInfo:Object){

       trace( "Synchronizing Data");

       for (name in shareInfo){
           switch (shareInfo[name].code){
           
           case "change":
               trace("Change");
               
           case "success":
               trace("Success");
           case "reject":
               trace("Reject");
           case "clear":
               trace("Clear");
           case "delete":
               trace("Delete");
           }
       }

Could someone please help me with this?

Thanks,

-- Clint


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Supported by Fig Leaf Software
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Lower Prices for Certified Training! Check out new lower prices for
Certified Macromedia Training from Fig Leaf Software. Expand your skill set
with courses in ColdFusion, Flash, Rich Internet Applications and .NET in
the new year.  Fig Leaf Software provides
the highest caliber instruction at our training centers in Washington  
D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your
location.

Get the details at http://training.figleaf.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected)
For additional commands, e-mail: flashnewbie-help@(protected)


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Supported by Fig Leaf Software
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Lower Prices for Certified Training! Check out new lower prices for
Certified Macromedia Training from Fig Leaf Software. Expand your
skill set with courses in ColdFusion, Flash, Rich Internet
Applications and .NET in the new year.  Fig Leaf Software provides
the highest caliber instruction at our training centers in Washington  
D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at
your location.

Get the details at http://training.figleaf.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected)
For additional commands, e-mail: flashnewbie-help@(protected)