dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: (newbie question) Calling X-position of an Instance

Hybrid View

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    24
    Hi,
    lets start ... I have an Instance called "ball1" at the x-position 20.

    now I try:
    trace (ball1._x)
    -> 20
    this works well, but when I try this one>:

    object = "ball" + 1;
    trace (object._x);

    it doesnt return anything.

    Why, what am I doing wrong, and what is the right way to do it?

    thx

  2. #2
    Retired Mod aversion's Avatar
    Join Date
    Jun 2000
    Location
    insomnia
    Posts
    7,917
    i can only think of one of two things;

    that the reference needs to be complete, eg; _root.object._x

    or more likely,

    that you need to evaluate the statement "ball" + 1 using eval("ball"+1)

    but i'm not sure exactly how that works in AS, maybe try asking in the actionscript forum?




  3. #3
    Junior Member
    Join Date
    Feb 2002
    Posts
    24
    yeah thx,

    it works with the eval stuff

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