A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: check equility between loaded varaibles

  1. #1
    Senior Member ninjakannon's Avatar
    Join Date
    Sep 2004
    Posts
    393

    check equility between loaded varaibles

    Hi,

    I am using Flash MX.
    I have some variales that are loaded and then movieclips are duplicated depending on what the variables equal. This works fine but, I want to say that if another variable is loaded (this before a movieclip is duplicated) and its variable + another variable is equal to the Instance name of a movieclip that is allready on the stage then it does not duplicate a movieclip.

    eg.
    code:

    //This is the code to check weather its name allready exists:
    if (variableA+variableB == _root[variableA+variableB]) {
    //do nothing
    } else {
    //this is the movieclip being duplicated
    mymc.duplicateMovieClip(variableA+variableB, 0)
    }



    But this doesnt work, in the example the first part (pefore the ==) is the new variables and the part after is the path of movieClip.

    I know that_root[variableA+variableB] is the correct path because I checked using a removeMovieClip and it worked.

    If you can tell me how to make this work ill be very grateful.
    Thanx,
    ninjakannon

    - My Website -

  2. #2
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    You should test for the _name property:
    code:

    if (variableA+variableB == _root[variableA+variableB]._name) {
    trace("ok");
    }


    K.

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