Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript (http://www.flasher.ru/forum/forumdisplay.php?f=5)
-   -   Pull down menu, working with paths (http://www.flasher.ru/forum/showthread.php?t=49879)

SchneiH2 03.10.2003 16:01

Pull down menu, working with paths
 
First of all: Sorry for writing in English, however, please answer in Russian, it's ok.

I use the below code to generate a pull down menu. In advance I'd like to say that it works as I want except one thing:

The menu consists of two MC:
btn_hm1 (i.e. main menu) and Submenu1.
In the least are embedded some buttons with rollover effect (change o font color).

The point ist that the all pull down/up effects work properly, however, the embedded buttons of the Submenu1 are inoperational (rollover effect does not function).

I found out that it is obviously to do with the path definitions (if I change from _root to _parent or other the pull down effect does not work any more)

What is wrong?

Her comes the code:

targetOben = 140
targetUnten = 180
speed = 4


btn_hm1.onrollover = function(){

_root.onEnterFrame = function() {

Submenu1._y += (targetUnten-Submenu1._y)/speed;

}//onEnterFrame

} //function btn_hm1.onrollover => works properly!!!


btn_hm1.onRollout = function(){

if (!(Submenu1.hitTest(_root._xmouse, _root._ymouse,false))) {

_root.onEnterFrame = function() {

Submenu1._y += (targetOben-Submenu1._y)/speed;

}//onEnterFrame

}//if

}//function btn_hm1.onrollout => works properly!!!


Submenu1.onRollout = function(){

_root.onEnterFrame = function() {

Submenu1._y += (targetOben-Submenu1._y)/speed;

}//onEnterFrame

} //function Submenu1.onrollout => works for "pull up", buttons inoperational

I have also noticed, that without the least function (Submenu1.onRollout) the buttons work whereas the "pull up"of Submenu does not work when "rollout" the Submenu1-area.


Thank you in advance for the help.

Regards

SHJ

sergwizard 03.10.2003 22:43

Насколько я тебя понял, “Submenu1” – это MovieClip с кнопками.
Но, как только ты пишешь: Submenu1.onRollout, ты тем самым превращаешь его в кнопку. А это значит, что кнопки в НЕМ становятся недоступными. Чтобы такой конфликт не происходил, не используй onRollOut для Submenu1. Вместо этого используй hitTest (точнее, его отсутствие).

SchneiH2 06.10.2003 13:20

Thank you for the answer! The reasons seems to be clear now.

However, I don't know how to trigger then this event.
I wrote some kind of function like this but I don'tknow how to trigger:

function HideSubmenu1 () {

if (!(Submenu1.hitTest(_root._xmouse, _root._ymouse, false))){

_root.onEnterFrame = function() {

Submenu1._y += (targetOben-Submenu1._y)/speed;

}//onEnterFrame

}//if


}

Answer in Russian is ok. Thanks in advance.

SHJ

sergwizard 07.10.2003 00:01

Could you show me your fla file? I hope I’ll be able to fix it up. If you don’t want to show it up here, you can send it to my email.
trunaev@lermus.ru

SchneiH2 07.10.2003 11:21

Вложений: 1
Please find the file as attachment (no problem to publish it).
Meanwhile, I think to have solved the problem partly by using the following code for the function under question:

Submenu1.Blind.onrollout = function() {

_root.onEnterFrame = function() {
Submenu1._y += (targetOben-Submenu1._y)/speed;
};
};

With "Submenu1.Blind.onrollout" I call either one of the buttons embedded in the Submenu1 or, as shown currently, I try to access a hotspot to cover the whole area of the Submenu1.
The problem now is how to use this hotspot correctly. If it is put in a layer above the Submenu1-buttons, the least are inoperational. The opposite case (hotspot layer below button layer) leads into the problem that the whole Submenu is flashing or even disappearing when rolling over to another button within it. (in this case the hotspot is inoperational)
Sorry, if this sounds a bit unclear but I think looking into attached file makes the situation clear.

Thanks in advance for the efforts and help.

Regards

SHJ

SchneiH2 07.10.2003 17:23

Вложений: 1
Hurra! Now it works!

For those who are interested in the result see attached ZIP.

Bolshoe spasibo to all who helped me!

Do sleduyushevo voprosa!

SHJ


Часовой пояс GMT +4, время: 21:44.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.