A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Flashcom Shared Objects

  1. #1
    I was refering to the second statement about shared objects which I am just begining to figure out. The Flashcom can be used as a limited database with shared objects. Of course this would be slow with large amounts of data.

    So my question really become how do you do the following:

    1. list all the shared objects.
    2. add a shared object
    3. update a shared object
    4. delete a shared object.

    I am going back to macromedia info again and see if I can get any new insights as there are no tutorials that I have been able to find.

    Any help will be greatly appreciated.

    Chris

  2. #2
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    I dont think it gets so slow just if having a large amount of data.It depends of how you store it.
    Gonna try to answer your questions

    1. list all the shared objects.
    ...eh...look at the serverside actionscript reference and you might find something. But I can tell you about how to get the data in one shared object=

    for(var a in mySo_so.data){
    trace("the value of "+a+" is: "+mySo_so.data[a]);
    }

    2. add a shared object
    dynamically? One way could be to have an _so within an object(mc) and the _so instance will be added whenever the object is attached to the timeline.

    The way that I have used it is to make the new "_so" as data in one _so. For example, if the user have typed his name in a textfild, it could be done like this:

    videoStreams_so.data[username.text+"video"]=recordingname.text;


    3. update a shared object

    to update data you simply overwrite it. If you want the data to be updated, a in "syncronized", there is a special function for this, onSync

    mySo.onSync=function(list){
    drugsList.removeAll();
    var(var a in mySo.data){
    drugsList.addItem(mySo.data[a]);
    }
    }
    }


    4. delete a shared object.
    mySo.data[username.text+"sexlife"]=null;


    ....but really, dont trust me, trust the refference

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