flash actionscript:
I have a button that when clicked makes a movie visible. That movie is
draggable. I have a button inside that movie that I want to close or "hide" the
movie. For some reason it doesn't seem to recognize the button in the movie, it
seems to recognize everything as the draggable content. My question is, how can
I get buttons to work inside draggable content?
I was told to try hitTest() but don't know much about it. After hours of
reading about it I couldn't get a grasp of how it would help my situtation.
Most of the tutorials and information was directed toward situtions involving
boundries or collision movements of objects.
Question: How can I get buttons inside a movie that is draggable to work and
be recognized as buttons? Is hitTest the answer and if so, is there an example
of how to use it in my situation?
Below is what I have for code so far. I have also provided a link of what I am
trying to achieve.
LINK: (click skip to skip video)
http://www.hp.com/personalagain/us/en/shaun_white.html Thanks in advance for any ideas or information! It will be greatly appreciated!
Luke
//DOUBLE CLICK TO SHOW CONTENT
//set initial variables
click = false;
//function for the button press
button_btn.onPress = function() {
//if this is the first click
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
//if it is a double click
if ((timer2-timer)<.25) {
//toggle the box mc on and off
if (_root.box_mc._visible==false) {
_root.box_mc._visible = true;
} else {
_root.box_mc._visible = false;
}
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
};
//DRAGGING CONTENT
//border variables
left = 0;
top = 0;
right = Stage.width;
bottom = Stage.height;
//drag the mask
_root.box_mc.onPress = function() {
startDrag(this);
}
_root.box_mc.onRelease = function() {
stopDrag();
}
stop();