|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I'm having some diffculty and hopefully some one here can help. What I would like to do is this (using MX/MX2004): - I have a mask layer (which is a movie clip) "mask1" - I have a button(s) on my menu "b1","b2", ... - I have programmed actions into the mask movie clip, but need to have the movie clip detect when the/a button is on a RollOver state to trigger the appropriate behaviour. Nothing I have tried so far seems to work. Can anyone help? Many thanks! |
|
#2
|
|||
|
|||
|
Hi,
Code:
on(rollOver)
{
_parent.mask1.buttonCaller = this;
}
then in mask1 you can use buttonCaller to reference the button i.e. Code:
if(buttonCaller._name == "b1")
{
//get up, get out, do something!
}
|
|
#3
|
|||
|
|||
|
It's still not working, and I can't understand why , did I do something wrong in my code?:
b1: on(rollOver){ _parent.mask1.buttonCaller = this; } mask1: onClipEvent (load) { _y = getProperty(_root.mask1._y, _y); speed = 5; menuOffy = -7.0; menuOny = 129.0; } onClipEvent (enterFrame) { if (buttonCaller._name == "b1") { _y = getProperty(_root.mask1._y, _y); endY = menoOny; _y += (endY-_y)/speed; } else { _y = getProperty(_root.mask1._y, _y); endY = _y; _y += (menuOffy-_y)/speed; } } Also attached is a test fla file. Thanks for your help. |
|
#4
|
|||
|
|||
|
Hi, ok time to do some checking
I assumed you had something like: _root -------- mask1 | b1 | b2 | b3 is that right? basically with everything directly under _root. Code:
on(rollOver)
{
_parent.mask1.buttonCaller = this;
trace(_parent.mask1.buttonCaller);
trace(this);
trace(this._name);
}
You could try: Code:
on(rollOver)
{
_root.mask1.buttonCaller = this;
}
or: Code:
on(rollOver)
{
_root.buttonCaller = this;
}
and then: if(_root.buttonCaller._name == "b1"){} or: if(_root.buttonCaller == _root.b1){} |
|
#5
|
|||
|
|||
|
Still not working, but receiving...
Hey,
It's not working, but when I added the trace I receive this message when I roll over the button: undefined _level0 Any ideas? Thanks. |
|
#6
|
|||
|
|||
|
Hi, can you back save to MX format so I can take a look. I'll check it out tomorrow as I'll be a bit busy tonight ;¬)
|
|
#7
|
|||
|
|||
|
Here is the test Movie in MX format...
See attached...
|
|
#8
|
|||
|
|||
|
Hi, ok looked it over:
on the button Code:
on (rollOver) {
mask1.buttonCaller = "b1";
}
on (rollOut) {
mask1.buttonCaller = "none";
}
on the moving movie Code:
onClipEvent (load) {
speed = 5;
menuOffy = -7.0;
menuOny = 129.0;
}
onClipEvent (enterFrame) {
if (buttonCaller == "b1") {
endY = menuOny;
_y += (endY-_y)/speed;
} else {
endY = _y;
_y += (menuOffy-_y)/speed;
}
}
|
|
#9
|
|||
|
|||
|
Tann: Thank you SO MUCH!
Works great, I haven't implemented it yet, but I am really happy! Please chack out one of the sites that will use a variation of this code (this is not a finished site, and I cheated on the code, it looks like it works, but I used coordinates as opposed to an event listener): http://lanny.xistential.com/yolande ![]() |
|
#10
|
|||
|
|||
|
Hi, thats a nice site, sharp :¬)
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Need help with MC detecting mouse event on button... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|