Professional Web Applications Themes

still no answer - Macromedia Flash Flashcom

hi I have an array stored in a remote shared object except i don't know how to get the array out of the remote shared object and use it. How do i get the array and use it?.....what causes access.text = SO.data.slot0.array0[0]; ......... to fail and display undefined? client_nc = new NetConnection(); client_nc.onStatus = function(info) { trace("Level:" + info.level + newline + "Code: " + info.code); } client_nc.connect("rtmp:/RSO"); SO = SharedObject.getRemote("data0", client_nc.uri, false); SO.connect(client_nc); SO.onSync = function(list) { for ( var i = 0; i < list.length; i++ ) if ( list[i].name == "slot0" && list[i].code != "success") { array0 ...

  1. #1

    Default still no answer

    hi I have an array stored in a remote shared object except i don't know how to
    get the array out of the remote shared object and use it. How do i get the
    array and use it?.....what causes access.text = SO.data.slot0.array0[0];
    ......... to fail and display undefined?


    client_nc = new NetConnection();
    client_nc.onStatus = function(info) {
    trace("Level:" + info.level + newline + "Code: " + info.code);
    }
    client_nc.connect("rtmp:/RSO");
    SO = SharedObject.getRemote("data0", client_nc.uri, false);
    SO.connect(client_nc);
    SO.onSync = function(list) {

    for ( var i = 0; i < list.length; i++ )
    if ( list[i].name == "slot0" && list[i].code != "success")
    {
    array0 = SO.data.slot0;
    break;
    }
    };
    start_btn.onPress = addarray;
    function addarray() {
    SO.data.slot0 = array0;
    slot0.text = SO.data.slot0;
    access.text = SO.data.slot0.array0[0];
    }
    var array0 = new Array();
    var mins = 1;
    var secs = 2;
    array0[0] = mins;
    array0[1] = secs;


    calmchess333 Guest

  2. #2

    Default Re: still no answer

    Try storing back in Array first and then calling array0[0]; because [ ] might have different meaning depending on context.
    video conferencing Guest

  3. #3

    Default Re: still no answer

    slot0 is the name of the slot in the remote shared object i wish to use...in
    case i want to store somthing else in slot1 or slot2 or whatever a remote
    shared object is similar to an array in the way it stores information.....in my
    case a slot in an array storing an array.

    calmchess333 Guest

  4. #4

    Default Re: still no answer

    slot0 is the name of the slot in the remote shared object i wish to use...in
    case i want to store somthing else in slot1 or slot2 or whatever a remote
    shared object is similar to an array in the way it stores information.....in my
    case a slot in an array storing an array.

    calmchess333 Guest

  5. #5

    Default Re: still no answer

    for ( var i = 0; i < list.length; i++ )
    trace("mins:"+SO.data[list.name][0]);
    }

    what you want to try, in my view, is that : SO.data["slot0"][0]. I most warn
    you that depending of your application, using complex data in a shared
    object(object, array....) might slow down your app and increase the message
    number and data send to users. If your application doesn't interact with a lot
    of people you can continue on your way otherwise you should revise your
    design(your code) to simplify properties in the SO like this example.

    It is important to understand that when you updated a SO propertie ALL THE
    DATA in this propertie is send to every SO connected user. If you look at the
    example the good one will send only a number, string... and the bad one will
    send a array of data. This can be a major problem.


    examples :

    Good
    mySO [
    firstProp: value;

    secondProp: value;

    ....

    ]


    Will work but...

    mySO [
    firstProp : [mins, secs, .....]
    secondProp: [...]
    ]


    I hope this can help you and understand my poor English(I'm a French
    developper).

    anonymous thing Guest

  6. #6

    Default Re: still no answer

    Yes you are correct and i've had the same thought .....for now i'm leaving it the way it is but in the future i will simplify the SO....good eye for code you have ...take care my french friend
    calmchess333 Guest

Similar Threads

  1. Here is the answer we are looking for
    By gels17 in forum Macromedia Flash Player
    Replies: 8
    Last Post: December 6th, 07:45 PM
  2. ANSWER THIS TOO..
    By AkronNick in forum Macromedia ColdFusion
    Replies: 6
    Last Post: March 12th, 05:52 AM
  3. ANY ONE ANSWER ME PLEASE !
    By Larry Li in forum PHP Development
    Replies: 1
    Last Post: September 18th, 09:28 AM
  4. : Hi , here is your answer
    By Richie in forum Web Design
    Replies: 0
    Last Post: August 26th, 08:40 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139