A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: arrays

  1. #1
    Member
    Join Date
    Apr 2000
    Posts
    74

    arrays

    I have a list of variables that I want to store in an array.
    Each variable has a category and subcategory it belongs to. How do I make the category, subcategory and variable an array and then match that to the variables that are in an array?

    Category1[[color]variable1, variable2],[[size]variable3,variable4],[[depth]variable5, variable6]

    Category2[[color]variable1, variable2],[[size]variable3,variable4],[[depth]variable5, variable6]


    This of course isnt the correct syntax, but what is?

  2. #2
    Senior Member
    Join Date
    Feb 2003
    Posts
    825
    Not to up on arrays, but try this:

    myArray = newArray();
    myArray[category1] = (color.variable1, variable2, size.variable3,variable4, depth.variable5, variable6)

    That's probably way off, but it may spark something in someone else's brain

  3. #3
    I have an icon and U dont! johnwun's Avatar
    Join Date
    Nov 2000
    Location
    Santa Cruz, CA
    Posts
    258
    this work?


    Code:
    myColor = new Array("v1","v2");
    mySize = new Array("v3","v4");
    myDepth = new Array("v5","v6");
    Category1 = new Array(myColor,mySize,myDepth);
    trace("---cat1  is ---");
    trace(Category1[0][0]);
    trace(Category1[0][1]);
    myColor = new Array("v7","v8");
    mySize = new Array("v9","v10");
    myDepth = new Array("v11","v12");
    Category2 = new Array(myColor,mySize,myDepth);
    trace("---cat 2 is ---");
    trace(Category2[0][0]);
    trace(Category2[0][1]);
    trace("---cat 1 is still same---");
    trace(Category1[0][0]);
    trace(Category1[0][1]);
    I changed color to myColor and size to mySize since color and size are keywords... bad idea to use as variable names...
    [a.fun>b.fun ? trace("do(a)") : trace("do(b)");

    wundes.com

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