A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Array question

Hybrid View

  1. #1
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    try this:
    _root.boys[length][0] = (Name);
    _root.boys[length][1] = "test";
    _root.boys[length][2] = "test2";
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  2. #2
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784
    No that did not work, although I realize one of my mistakes.
    What I want is to create a list of names.
    Each of those names has proporties though. So for instance, I want this to happen.
    array = [
    ["Joe", 1, 4, 3];
    ["Jim", 3, 2, 1]
    ]
    Code change
    Code:
    add_student = function () {
    	var gender = _root.gender_text.text;
    	var Name = _root.name_text.text;
    	if(gender == "Male") {
    		var length = _root.boys.length;
    		_root.boys[length][0] = (Name);
    		_root.boys[length][1] = _root.choice_1.text;
    		_root.boys[length][2] = _root.choice_2.text;
    		trace(_root.boys[length][0]);
    	}
    }
    "If I have seen further it is by standing on the shoulders of giants." Isaac Newton
    ------------------------------------------------------------------------------

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