Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

(Actionscript 2) Refrencing dynamic object

Options
  • 20-02-2010 8:39pm
    #1
    Registered Users Posts: 2,845 ✭✭✭


    I have an object called subvalues, when I trace it comes up [object Object], this is what is meant to happen, but once I try to dynamically name the object the trace come up blank.

    The second commented out section of code is what should happen, the first part is where the problem occurs, I have the arrays dynamically named, the trace should come out the same way as below but its blank, completly blank, I've never even seen a trace window do that.
    I've been messing with this for hours and I still have nothing... any ideas?
    I also posted this over in the actionscript.org forums and haven't had any relpies.

    Any help greatly appreciated.

    Thank you
    for (a=0; a<10; a++) {
    _root["sub"+a+"values"] = new Array();
     _root["sub"+a+"sumvalues"] = new Array();
    for (i=0; i<16; i++) {
    _root["sub"+a+"values["+i+"]"] = {pname:anything, goals:parseInt("10"), lgoals:parseInt("10")};
     _root["sub"+a+"percent"] = _root["sub"+a+"values["+i+"]"].goals/_root["sub"+a+"values["+i+"]"].lgoals*100-100;
     _root["sub"+a+"values["+i+"]"].percent = int((_root["sub"+a+"percent"])*1)/1;
    _root["sub"+a+"sumvalues"].push(parseInt("10"));
    }
    trace(_root["sub"+a+"values"]); } /*
    
    for (a=0; a<10; a++) {
    subvalues = new Array();
    subsumvalues = new Array();
    for (i=0; i<16; i++) {
    subvalues[i] = {pname:anything, goals:parseInt("10"), lgoals:parseInt("10")};
    subpercent = subvalues[i].goals/subvalues[i].lgoals*100-100;
    subvalues[i].percent = int((subpercent)*1)/1;
     subsumvalues.push(parseInt("10"));
    }
    
    trace(subvalues); }*/
    


Advertisement