A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: getProperty statement problem

  1. #1
    Member
    Join Date
    Nov 2000
    Posts
    64

    getProperty statement problem

    I have to get the _y property of a movieclip that is dynamically named. ie.."nav1", "nav2" etc

    Within each there is an action that sets a variable navdef in a clip higher up called nav. This works fine. What Im having a problem with is within nav Im trying to get the _y property of the dynamically named mc but the target has to be defined with the variable navdef.

    Tested with one of the mcs and it works fine...such as...
    Code:
    navminiypos = getProperty(navx.nav2, _y);
    Tested my variable navdef ...lets say I click on the mc nav5 and navdef becomes nav5. Good so far.

    So.. how can I target the mc using the variable navdef?
    I tried..
    Code:
    navmc = navdef;
    navminiypos = getProperty(navx.navmc, _y);
    or just..
    Code:
    navminiypos = getProperty(navx.navdef, _y);
    I also tried making the var navdef just the number ...so...
    Code:
    navminiypos = getProperty(navx."nav"+navdef, _y);
    Hope Im making some sense trying to explain this.

  2. #2
    Member
    Join Date
    Nov 2000
    Posts
    64
    Ok ...

    CAN I replace the name of a mc with a variable in a getProperty statement? I need to get the _y property of a dynamically named object.

    Help!

  3. #3
    Junior Member
    Join Date
    Mar 2003
    Posts
    15
    Try this

    Code:
    navminiypos = eval("navx." + navmc + "._y");
    where navmc is a variable that contains the instance name for the movieclip you want to target
    Last edited by xelion; 08-07-2007 at 06:37 AM.

  4. #4
    Member
    Join Date
    Nov 2000
    Posts
    64
    Quote Originally Posted by xelion
    Try this

    Code:
    navminiypos = eval("navx." + navmc + "._y");
    where navmc is a variable that contains the instance name for the movieclip you want to target
    Xelion! Thank you! That works!
    Light at the end of the tunnel ...I do believe I see it.

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