A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Help needed about currentTarget

  1. #1
    Member
    Join Date
    Nov 2007
    Posts
    83

    Help needed about currentTarget

    What's wrong in this code:

    code:
    function mouseUp(event:MouseEvent):void {
    event.target.stopDrag();
    event.updateAfterEvent();

    if (event.currentTarget == sym01_id) {
    trace(event.currentTarget);
    }
    }



    sym01_id is a library item. The event listener in the other function is newSymbol.addEventListener(MouseEvent.MOUSE_UP, mouseUp); It doesn't output anything. Can anyone help me?

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Have you traced what you get when you trace event.currentTarget alone without any if statement?
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Nov 2007
    Posts
    83
    Yes, it outputs [object sym01_id]

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Try this

    if (event.currentTarget == "[object sym01_id]") {
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Member
    Join Date
    Nov 2007
    Posts
    83

    It works

    Thanks a lot, cancerinform!

Tags for this Thread

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