У меня проблема с меню Flash, которое я унаследовал от нашего графического дизайнера. Кажется, это работает в определенной степени, но я не могу выделить ошибку в коде Actionscript 3.0. По сути, нам нужно, чтобы каждая полоса в меню (которую вы можете найти по ссылке) выскочила, когда наведена указатель мыши, а когда мышь отодвинулась от полосы, она должна откатиться назад. Это работает, когда вы делаете это медленно, но когда Вы быстро наводите курсор на каждый пункт меню, он делает некоторые странные вещи.
У меня нет большого опыта работы с Flash, но с точки зрения программирования, моя теория заключается в том, что потоки не используются. Под этим я подразумеваю, что наведение мыши происходит так быстро, что оно игнорирует мышь для одного пункта меню и пропускает мышь для другого. Я надеюсь это имеет смысл. Ниже приведена ссылка на сайт и код в нашем файле Actionscript.
Если я недостаточно объяснил, пожалуйста, дайте мне знать, и я исправлю вопрос.
http://www.thehrdirectory.co.uk/HR_Directory_Flash_Menu.swf
//<item>_bar is the alias given to each menu item.
contracts_bar.stop();
contracts_bar.addEventListener(MouseEvent.ROLL_OVER, animateMC);
function animateMC(evt:MouseEvent):void{
contracts_bar.play();
}
contracts_bar.addEventListener(MouseEvent.ROLL_OUT, animate2MC);
function animate2MC(evt:MouseEvent):void{
contracts_bar.play();
}
dispute_bar.stop();
dispute_bar.addEventListener(MouseEvent.ROLL_OVER, animate3MC);
function animate3MC(evt:MouseEvent):void{
dispute_bar.play();
}
dispute_bar.addEventListener(MouseEvent.ROLL_OUT, animate4MC);
function animate4MC(evt:MouseEvent):void{
dispute_bar.play();
}
resourcing_bar.stop();
resourcing_bar.addEventListener(MouseEvent.ROLL_OVER, animate5MC);
function animate5MC(evt:MouseEvent):void{
resourcing_bar.play();
}
resourcing_bar.addEventListener(MouseEvent.ROLL_OUT, animate6MC);
function animate6MC(evt:MouseEvent):void{
resourcing_bar.play();
}
performance_bar.stop();
performance_bar.addEventListener(MouseEvent.ROLL_OVER, animate7MC);
function animate7MC(evt:MouseEvent):void{
performance_bar.play();
}
performance_bar.addEventListener(MouseEvent.ROLL_OUT, animate8MC);
function animate8MC(evt:MouseEvent):void{
performance_bar.play();
}
training_bar.stop();
training_bar.addEventListener(MouseEvent.ROLL_OVER, animate9MC);
function animate9MC(evt:MouseEvent):void{
training_bar.play();
}
training_bar.addEventListener(MouseEvent.ROLL_OUT, animate10MC);
function animate10MC(evt:MouseEvent):void{
training_bar.play();
}
strategy_bar.stop();
strategy_bar.addEventListener(MouseEvent.ROLL_OVER, animate11MC);
function animate11MC(evt:MouseEvent):void{
strategy_bar.play();
}
strategy_bar.addEventListener(MouseEvent.ROLL_OUT, animate12MC);
function animate12MC(evt:MouseEvent):void{
strategy_bar.play();
}
compensation_bar.stop();
compensation_bar.addEventListener(MouseEvent.ROLL_OVER, animate13MC);
function animate13MC(evt:MouseEvent):void{
compensation_bar.play();
}
compensation_bar.addEventListener(MouseEvent.ROLL_OUT, animate14MC);
function animate14MC(evt:MouseEvent):void{
compensation_bar.play();
}
organisational_bar.stop();
organisational_bar.addEventListener(MouseEvent.ROLL_OVER, animate15MC);
function animate15MC(evt:MouseEvent):void{
organisational_bar.play();
}
organisational_bar.addEventListener(MouseEvent.ROLL_OUT, animate16MC);
function animate16MC(evt:MouseEvent):void{
organisational_bar.play();
}
talent_bar.stop();
talent_bar.addEventListener(MouseEvent.ROLL_OVER, animate17MC);
function animate17MC(evt:MouseEvent):void{
talent_bar.play();
}
talent_bar.addEventListener(MouseEvent.ROLL_OUT, animate18MC);
function animate18MC(evt:MouseEvent):void{
talent_bar.play();
}
employee_bar.stop();
employee_bar.addEventListener(MouseEvent.ROLL_OVER, animate19MC);
function animate19MC(evt:MouseEvent):void{
employee_bar.play();
}
employee_bar.addEventListener(MouseEvent.ROLL_OUT, animate20MC);
function animate20MC(evt:MouseEvent):void{
employee_bar.play();
}