Solved

RollOver question

Posted on 2006-10-23
5
157 Views
Last Modified: 2010-04-03
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();
0
Comment
Question by:mingchih
5 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 17793826
what exactly are you trying to achieve?
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.
0
 

Author Comment

by:mingchih
ID: 17793976
mm, actually, my question is hard to explain.... do you mind take a look at file ? :)
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 17793986
upload it to the free space offered by ee. will download and have a look.
0
 
LVL 13

Accepted Solution

by:
FLAASHER earned 500 total points
ID: 17799688
First of all flash dosnt support nasted rollover (thats why ur button will not recieve any mouse events coz evnts of the movielip stop the evnts of the buuton)

u must stop the frist rollover event from inside its function like this :


test.onRollOver = function() {
     trace("this is test 1");
     delete this.onRollOver;
     //test._visible = true;
     //test_menu = "show2";
};
test.test2.onRollOver = function() {
     trace("this is test 2");
};
stop();



FLAASHER
0
 
LVL 7

Expert Comment

by:muxxter
ID: 17799710
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
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add 'birds singing' to homepage 5 91
File drag and drop 6 127
System Center Configuration Manager 2012R2 7 67
flash in chrome 4 66
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now