A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: hitTest mis-script

Hybrid View

  1. #1
    Junior Member
    Join Date
    May 2005
    Posts
    1

    hitTest mis-script

    Hi, I will be very grateful if someone can help me with the following:

    I have attached a mc to the mouse and then my buttons no longer worked as the mc was between the pointer and my buttons. So I changed my buttons into mcs and put hitTest script on the mcs. I probably mis-scripted this but the desired effect (ie that the button/mc disappears on rollOver and appears again on rollOut) is not achieved - it disappears but does not reappear on rollOut. This is the script:

    attachedToMouse_mc.onEnterFrame=function(){
    if (this.hitTest(wasButton_mc)){
    hit = true;
    trace("hit");
    wasButton_visible = "0";
    }else if (hit != true) {
    trace("no hit");
    wasButton_visible = "1";
    }
    }

    I used the trace to determine whether this script was working and "no hit" works initially until rollOver and then no more.

    What is my mistake?
    Michelle.

  2. #2
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    These changes may halp.

    attachedToMouse_mc.onEnterFrame=function(){
    if (this.hitTest(wasButton_mc)){
    hit = true;
    trace("hit");
    wasButton._visible = 0;
    }else if (hit != true) {
    trace("no hit");
    wasButton._visible = 1;
    }
    }

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