PDA

View Full Version : Competing onRelease events -- help!


slipjack
07-21-2004, 03:05 PM
Hey all,

I was wondering if anyone had run into a problem when you have a mc that spans most of the flash area with various functions attached to it, ie. onRollover, onRelease, etc., and then, you have another mc or even just a regular button that has onRelease actions attached to it, and they don't work!

Is there any way around this? I reaaaally don't want to recode my entire site if I don't have to. Basically what I'm trying to do is download a .pdf from a button that sits on top of another mc that also has onRelease functionality attached to it. What I want, is for the onRelease to ONLY trigger the pdf button, but right now it seems to trigger the mc underneath and compelely ignore the pdf download button on top...

I'm sure I've made a mess of trying to explain this, so I'll clarify if anyone has questions.

Thanks!!!

:eek:

slipjack
07-21-2004, 03:15 PM
Hmm, couldn't get my code to post, so I'll attach it.

slipjack
07-21-2004, 03:17 PM
Hmm, couldn't get my code to post, so I'll attach it.

ergh... ok here it is.

slipjack
07-21-2004, 11:41 PM
Basically, I need to know how to manipulate two movie clips with onRelease events that overlap eachother.. any tips?

Thanks,

slip

FlashBulb
07-26-2004, 04:51 PM
I think that hitTest can solve your problem. You can check and see with an onMouseDown handler if the cursor intersects with specific movieClips or not.

See this thread (http://www.actionscript.org/forums/showthread.php3?t=38903) for my similar problem. (the hitTest part is at the last thread!)

slipjack
07-29-2004, 03:40 PM
HIT TEST... very smart.


thanks so much.

slip

slipjack
07-29-2004, 03:58 PM
One nice thing I realized is you can dot reference a mc that's dynamically loaded... Like this:
brBox.onRelease = function() {
if (this.active != 1) {
var obj = {_height:origH, _width:origW-brFullSize};
blBox.tweenTo(obj, speed);
var obj2 = {_height:origH+brFullSizeH, _width:origW+brFullSize};
brBox.tweenTo(obj2, speed, brBox, callBack);
var obj3 = {_height:origH, _width:origW-brFullSize};
tlBox.tweenTo(obj3, speed);
var obj4 = {_height:origH-brFullSizeH, _width:origW+blFullSize};
trBox.tweenTo(obj4, speed);
blColor.setRGB(0x666666);
tlColor.setRGB(0xCCCCCC);
brColor.setRGB(0x0B9DF4);
trColor.setRGB(0xB2B2B2);
fadeOutText();
this.active = 1;
}
if (this.hitTest(contentMC3.pdf_mc)) {
getURL("satisfied_customer_1.pdf", "_blank");
}
};

pdf_mc doesn't even exist on the stage until after the rollOver Event... anyway, i thought it was nifty. This method worked perfectly, and embedding the embedded button functionality within the top level button rocks too.

slip