Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

(Actionscript 2) Refrencing dynamic object

  • 20-02-2010 08:39PM
    #1
    Registered Users, Registered Users 2 Posts: 2,891 ✭✭✭


    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