Hi there,
I need a little help to complete the hitTest for my animation sequence. Please see the [COLOR=DarkOrange]orange[/COLOR] section of my code:
[COLOR=Blue]stop[/COLOR]();
[COLOR=Blue]var[/COLOR] myLoader03:[COLOR=Blue]Loader[/COLOR]=[COLOR=Blue]new Loader[/COLOR] ();
temperature_small[COLOR=Blue].addEventListener[/COLOR]([COLOR=Blue]MouseEvent.MOUSE_DOWN[/COLOR],dragTemperature);
[COLOR=Blue]function[/COLOR] dragTemperature(myevent:[COLOR=Blue]MouseEvent[/COLOR]):[COLOR=Blue]void[/COLOR] {
temperature_small[COLOR=Blue].startDrag[/COLOR]([COLOR=Blue]true[/COLOR]);
temperature_small[COLOR=Blue].scaleX[/COLOR]=0.5;
temperature_small[COLOR=Blue].scaleY[/COLOR]=0.5;
//Mouse clicks on the movieclip called "temperature_small" and begins the dragging action.
}
temperature_small[COLOR=Blue].addEventListener[/COLOR]([COLOR=Blue]MouseEvent.MOUSE_UP[/COLOR], dropTemperature);
[COLOR=Blue]function[/COLOR] dropTemperature(myevent:[COLOR=Blue]MouseEvent[/COLOR]):[COLOR=Blue]void[/COLOR] {
temperature_small[COLOR=Blue].stopDrag[/COLOR]();
temperature_small[COLOR=Blue].alpha[/COLOR]=0;
//Mouse release stops the dragging and turns the movieclip invisible.
}
[COLOR=Blue]stage.addEventListener[/COLOR]([COLOR=Blue]Event.ENTER_FRAME[/COLOR], hitTest);
[COLOR=Blue]function[/COLOR] hitTest(yourEvent:[COLOR=Blue]Event[/COLOR]):[COLOR=Blue]void [/COLOR]{
[COLOR=Blue]if[/COLOR] ((temperature_small.[COLOR=Blue]hitTestObject[/COLOR](CH1_btn)) && [COLOR=DarkOrange]**[SIZE=3](temperature_small[COLOR=Blue].stopDrag[/COLOR]()))[/SIZE]** [/COLOR]{
[COLOR=Blue]trace[/COLOR]([COLOR=DarkGreen]"they hit"[/COLOR]);
[COLOR=Blue]var[/COLOR] myURL03:[COLOR=Blue]URLRequest[/COLOR]=[COLOR=Blue]new URLRequest[/COLOR]([COLOR=DarkGreen]"page4.swf"[/COLOR]);
myLoader03[COLOR=Blue].load[/COLOR](myURL03);
[COLOR=Blue]addChild[/COLOR](myLoader03);
}
}
myLoader03.[COLOR=Blue]addEventListener[/COLOR]([COLOR=Blue]MouseEvent.CLICK[/COLOR], unloadcontent03);
[COLOR=Blue]function[/COLOR] unloadcontent03(myevent:[COLOR=Blue]MouseEvent[/COLOR]):[COLOR=Blue]void[/COLOR] {
[COLOR=Blue]removeChild[/COLOR](myLoader03);
}
As you can see (hopefully), I need the movieclip to be released by stopDrag and it must also overlap with the CH1_btn button before the URLRequest can proceed. But what I’m getting now is the mouse loses control of the temperature_small movieclip when it contacts the CH1_btn (I keep moving the mouse around, but the movieclip remains stuck with the CH1_btn button). The trace didn’t work and the URLRequest didn’t proceed as well.
Please help, thanks!!