Brian Lin
asked on
RollOver question
Hi, Experts
I made a MC called " test " and inside the MC, there is a insvible button called " test 2 ".... howerver, the second roll over does not working...I think there can only have one onRollOver....how can I fix it but also work when roll over on test 2 button? Thanks
test.onRollOver = function() {
trace("this is test 1");
//test._visible = true;
//test_menu = "show2";
};
test.test2.onRollOver = function() {
trace("this is test 2");
};
stop();
I made a MC called " test " and inside the MC, there is a insvible button called " test 2 ".... howerver, the second roll over does not working...I think there can only have one onRollOver....how can I fix it but also work when roll over on test 2 button? Thanks
test.onRollOver = function() {
trace("this is test 1");
//test._visible = true;
//test_menu = "show2";
};
test.test2.onRollOver = function() {
trace("this is test 2");
};
stop();
ASKER
mm, actually, my question is hard to explain.... do you mind take a look at file ? :)
upload it to the free space offered by ee. will download and have a look.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi mingchih.
Yes, you're correct. Events only get broadcast to the topmost movieClip.
What I would do, is have "test" and "test2" as two seperate MCs, but have test2 on top of test. So, don't have test2 inside test, have it as it's own MC.
This is the only way that you can get them both to get focus.
However, when the mouse moves over test2, test will get an onRollOut event, since (according to Flash) you're hovering over test2 now, not test.
Cheers
Gav
Yes, you're correct. Events only get broadcast to the topmost movieClip.
What I would do, is have "test" and "test2" as two seperate MCs, but have test2 on top of test. So, don't have test2 inside test, have it as it's own MC.
This is the only way that you can get them both to get focus.
However, when the mouse moves over test2, test will get an onRollOut event, since (according to Flash) you're hovering over test2 now, not test.
Cheers
Gav
if you have a button inside of a movieclip, and you assign a rollover event to both, the movieclips rollover will obviously take precedence, if you happen to be rollling over both areas simultaneously.
if you explain what exactly you want to do with each one then we can provide a better solution.