Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>IIRC to fix this issue, when dealing with proximity zones, I used the mouse position to show/hide the content (the button). I would use the hitZone to trigger a mouse move listener. Once the mouse position is outside the hitZone: hide the button and remove the mouse move listener.</p> <pre><code>import com.greensock.*; import com.greensock.easing.*; import flash.events.MouseEvent; var endPoint:Number = 31; hitZone.addEventListener(MouseEvent.ROLL_OVER, onHitZoneOver); hitZone.addEventListener(MouseEvent.CLICK, onHitZoneClick); btn.addEventListener(MouseEvent.ROLL_OVER, onBtnOver); btn.addEventListener(MouseEvent.ROLL_OUT, onBtnOut); btn.addEventListener(MouseEvent.CLICK, onBtnClick); btn.mouseChildren = false; function onHitZoneOver(e:MouseEvent):void { TweenLite.to(btn, 0.75, {x:endPoint, ease:Expo.easeOut}); stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoved); hitZone.removeEventListener(MouseEvent.ROLL_OVER, onHitZoneOver); trace("over hitZone"); } function onHitZoneOut(e:MouseEvent):void { TweenLite.to(btn, 0.75, {x:-1, ease:Expo.easeOut}); trace("out hitZone"); } function onBtnOver(e:MouseEvent):void { trace("over BTN"); } function onBtnOut(e:MouseEvent):void { trace("out BTN"); } function onBtnClick(e:MouseEvent):void { trace("click BTN"); } function onHitZoneClick(e:MouseEvent):void { trace("click hitZone"); } function onMouseMoved(e:MouseEvent):void { if( !hitZone.hitTestPoint(mouseX, mouseY) ) { trace("Sacrebleu!"); TweenLite.to(btn, 0.75, {x:-41, ease:Expo.easeOut}); stage.removeEventListener( MouseEvent.MOUSE_MOVE, onMouseMoved ); hitZone.addEventListener(MouseEvent.ROLL_OVER, onHitZoneOver); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload