dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Life game issues

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Posts
    17
    Sorry, weird, it cut my message off.
    Anyhow, it returns plant4, so it reads the array correctly, and it returns the correct x position for plant4._x, but it returns undefined for all the stand-ins.

    I want to be able to use the array to specify movieclips.
    How can I alter plansonscreen[3]._x so that it will return the x position of the fourth movieclip named in the array?
    thanks in advance,
    B

  2. #2
    gskinner.com
    Join Date
    Feb 2002
    Location
    N.America
    Posts
    455
    You need to evaluate the string in the array to get the instance reference.

    You can do it like this:

    eval(plantsonscreen[3])._x;

    or:

    this[plantsonscreen[3]]._x;

    Hope it helps.

    Cheers,
    ZE.

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