Ask a Question related to Macromedia Flash Flashcom, Design and Development.

  1. #1

    Default getActiveInstances

    Hello,

    I'm trying to create an application system based on FMIS, and my basic model
    involves having multiple instances of one application running, and managing
    those instances with another application. I believe that I can implement my
    management with appropriately configured .asc files and NetConnection objects,
    but I want the application instances to be dynamically named, and to retrieve
    these instances in real time from the server. Based on my reading of the
    Administration API Reference, it seems that the getActiveInstances function
    should fulfill this need. However, I'm having trouble getting it to work.
    I've tried to implement it this way:

    var objResult = new Object();
    objResult.onResult = function() {
    /*trace("Result :" + this.toString());
    for (var obj in this) {
    trace(obj + " = " + this[obj]);
    }*/
    trace("Results :" + this.data);
    }
    objResult.onStatus = function() {
    /*trace("Status :" + this.toString());
    for (var obj in this) {
    trace(obj + " = " + this[obj]);
    }*/
    trace("Status :" + this.data);
    }
    nc.call("getActiveInstances", objResult);

    In the above, nc is a NetConnection object that is successfully connecting to
    my admin server. The commented out code in my onResult and onStatus handlers
    worked, but showed no array of string names of application instances. The data
    property of the objResult object is coming back undefined.

    I'd like to find an example of how to successfully implement this concept.
    I'm not married to the use of getActiveInstances, although I would like to be
    able to dynamically query the server and retrieve the currently running
    applications on FMIS. Thanks in advance for any assistance.

    SolitonMan Guest

  2. #2

    Default Re: getActiveInstances

    Hey,

    Nevermind! I figured out that I needed to modify my event handlers to include
    a parameter to represent the information object returned by the method call,
    and that this object then contains the data I'm seeking in the data property.
    So for example, the onResult handler is now:

    objResult.onResult = function(infoObj) {
    trace("Results :" + infoObj.data);
    }

    Thanks in advance for reading, hopefully my confusion will be useful to others!



    SolitonMan Guest

Posting Permissions

  • You may not post new threads
  • You may 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