dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Array Question

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Location
    Birmingham, Alabama
    Posts
    5
    this works fine ...


    _root.Maintenance.borderColor = 0x0000ff;
    _root.Maintenance.backgroundColor = 0x0000ff;
    _root.Maintenance.textColor = 0xffffff;


    this does not ...

    textArray[_root.counter].borderColor = 0x0000ff;
    textArray[_root.counter].backgroundColor = 0x0000ff;
    textArray[_root.counter].textColor = 0xffffff;


    why??????????

    -bh

  2. #2
    Senior Member
    Join Date
    May 2002
    Location
    The Great Northwest
    Posts
    380

    2 different things

    the first one works because you are setting the actual objects properties whereas the second it looks like you are just setting array values. The array is probably being generated just as you coded it. Maybe more of a description of what you are trying to accomplish would help.

  3. #3
    Member
    Join Date
    Sep 2001
    Location
    aussiestan
    Posts
    35
    i think i know what ur trying to do...

    u got an array with different MC instance names in it..

    eg textArray[_root.counter] could contain the value Maintenance

    in that case u would want to assign ur values like so:
    Code:
    _root[textArray[_root.counter]].borderColor = 0x0000ff; 
    _root[textArray[_root.counter]].backgroundColor = 0x0000ff; 
    _root[textArray[_root.counter]].textColor = 0xffffff;
    hope that helped.. this should work... cos i been doin it all morning and it's been working.. this is i am assuming correctly bout ur array containing the instance names of mc's...

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