A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Name property problem

  1. #1
    Lovely Lisa
    Join Date
    Jan 2009
    Location
    New York City
    Posts
    31

    resolved [RESOLVED] Name property problem

    Hello everyone...is there any known bugs with the .name property?

    Check out my problem... I created a movieclip and added it to the stage via addchild. Here's the code:

    var myChoice:choice=new choice();
    myChoice.x=100.0;
    myChoice.y=100.0;
    myChoice.name="extravagant";
    addChild(myChoice);
    trace(myChoice.name);


    the trace statement shows that myChoice name is in fact "extravagant". So is "extravagant" my instance name? I don't know, because when I try to use extravagant as the instance name for a button the compiler says extravagant is undefined.

    Here's the complete code...


    var myChoice:choice=new choice();
    myChoice.x=100.0;
    myChoice.y=100.0;
    myChoice.name="extravagant";
    addChild(myChoice);
    trace(myChoice.name);

    extravagant.addEventListener(MouseEvent.CLICK,move Safe,false,0,true);

    function moveSafe(event:MouseEvent):void
    {
    trace("name change successful");

    }

    when I test movie, I'm getting this error:

    1120: Access of undefined property extravagant.


    Is this is a bug or it's me? as 3 is so strict and strange at times....

    thanks...

    x lisa x

  2. #2
    Lovely Lisa
    Join Date
    Jan 2009
    Location
    New York City
    Posts
    31
    I got it guys...myChoice is the instance name...thanks...

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