168 сообщений
#15 лет назад
Привет всем.Появился вопрос.
Вот сделал меню на ActionScript3.
package {
import flash.text.*;
import flash.display.*;
import flash.events.*;
import gs.*;
import gs.ui.context.*;
public class menu extends MovieClip {
function menu () {
icon.visible = true;
studio.htmlText = '<a href="../2/">О студии</a>';
studio.selectable = false;
addChild(studio);
price.htmlText = '<a href="../3/">Услуги и цены</a>';
price.selectable = false;
addChild(price);
portfolio.htmlText = '<a href="../4/">Портфолио</a>';
portfolio.selectable = false;
addChild(portfolio);
contact.htmlText = '<a href="../5/">Контакты</a>';
contact.selectable = false
addChild(contact);
contact.addEventListener(MouseEvent.CLICK, ss);
portfolio.addEventListener(MouseEvent.CLICK, sss);
price.addEventListener(MouseEvent.CLICK, ssss);
studio.addEventListener(MouseEvent.CLICK, sssss);
var txt:*;
txt = new gs.ui.context.SnoopikTxt();
this.contextMenu = txt.returnMenu();
}
function ss(e:Event):void{
TweenLite.to(icon, 1, {y:147});
}
function sss(e:Event):void{
TweenLite.to(icon, 1, {y:105});
}
function ssss(e:Event):void{
TweenLite.to(icon, 1, {y:61});
}
function sssss(e:Event):void{
TweenLite.to(icon, 1, {y:20});
}
}
}
Всё прекрасно работает, но, когда нажимаешь на ссылку, то он переходит.
Хотя иконка не дошла до этого пункта меню.
Как можно сделать задержку для
studio.htmlText = '<a href="../2/">О студии</a>';
price.htmlText = '<a href="../3/">Услуги и цены</a>';
portfolio.htmlText = '<a href="../4/">Портфолио</a>';
contact.htmlText = '<a href="../5/">Контакты</a>';
Не знаю, как, но смысл таков. Нажимаешь на пункт меню. Он докатывается потом переходит только.
Сама работа : ссылка