A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Looping through shared object data

  1. #1
    Member
    Join Date
    Jul 2004
    Posts
    86

    Looping through shared object data

    Hello,

    I'm trying to build an abstract shared object read function and I'm trying to treat the shared_object.data object as a regular array but it doesn't respond as such.

    Here's what I'd like to see happen or something similar:

    var shared_object = SharedObject.getLocal("user_data");

    //--- read the contents of the shared object ----
    for( var i:Number = 0; i < shared_object.length; i++ )
    {
    trace( shared_object[i] );
    }
    //-----------------------------------------------------



    Thanks for your help,
    Clem C

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    Code:
    var shared_object = SharedObject.getLocal("user_data");
    a=[];
    //--- read the contents of the shared object ----
    for( i in shared_object.data ){
    a.push(shared_object.data[i])
    trace(a);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center