![]() |
|
||||||||||
|
|
|
|||||
|
Драсти господа..
Есть такой код позиционирования: var ar:Object = new Object();
this.ar.onResize = function() {
if (Stage.width>1050) {
Stage.align = "TL";
cir._x = new mx.transitions.Tween(cir, "_x", mx.transitions.easing.Strong.easeOut, cir._x, Stage.width*.30, 1, true);
rec._x = new mx.transitions.Tween(rec, "_x", mx.transitions.easing.Strong.easeOut, rec._x, Stage.width*.60, 1, true);
}
};
Stage.addListener(ar);
Заранее благодарен. |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Поставь интервал, который запустит второй твин.
Только при новом вызове onResize очищай его. |
|
|||||
|
Вот что вышло:
var ar:Object = new Object();
this.ar.onResize = function() {
if (Stage.width>301) {
Stage.align = "TL";
cir._x = new mx.transitions.Tween(cir, "_x", mx.transitions.easing.Strong.easeOut, cir._x, Stage.width*.30, 1, true);
var ai:Number;
this.ai = setInterval(function () {
rec._x = new mx.transitions.Tween(rec, "_x", mx.transitions.easing.Strong.easeOut, rec._x, Stage.width*.60, 1, true);
clearInterval(ai);
}, 1000);
}
};
Stage.addListener(ar);
|
|
|||||
|
Banned
Регистрация: Oct 2006
Адрес: кагбэ Киеф!!1
Сообщений: 1,473
|
Логичнее и проще просто напиши код, и вообще как-то неправильно
|
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Прочитай второй пост ещё раз и делай так:
var ar:Object = new Object();
this.ar.onResize = function() {
if (Stage.width>301) {
Stage.align = "TL";
clearInterval(this.ai);
cir._x = new mx.transitions.Tween(cir, "_x", mx.transitions.easing.Strong.easeOut, cir._x, Stage.width*.30, 1, true);
this.func = function () {
rec._x = new mx.transitions.Tween(rec, "_x", mx.transitions.easing.Strong.easeOut, rec._x, Stage.width*.60, 1, true);
clearInterval(this.ai);
}
this.ai = setInterval(this,'func', 1000);
}
};
Stage.addListener(ar);
Последний раз редактировалось etc; 09.03.2007 в 01:23. |
|
|||||
|
Цитата:
PS: А в какой части «коряво»? |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
ну вот это объявление функции в функции, а так ничего
![]() |
|
|||||
|
Регистрация: Feb 2006
Сообщений: 588
|
А на фига, в самом onResize каждый раз назначать align - TL?
|
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
А это, видимо, артефакт, не иначе
![]() Или потом планировалось менять LT на T. |
![]() |
![]() |
Часовой пояс GMT +4, время: 03:17. |
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | |
| Опции просмотра | |
|
|