Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 3.0 (http://www.flasher.ru/forum/forumdisplay.php?f=83)
-   -   влияние одних процессов на другие (tween, подгрузка картинок, listeners\timers) (http://www.flasher.ru/forum/showthread.php?t=113904)

koresh& 13.07.2008 00:04

влияние одних процессов на другие (tween, подгрузка картинок, listeners\timers)
 
Что думаете по поводу вляния одних процессов на другие.

По клику на кнопке вызывается tween изображения, но по каким-то причинам, изображение может вместо движения по заданной траектории, просто дёрнуться и всё.

С чем это связано?
со стабильностью tween? подгрузкой и отображением в это время других изображений? событиями по таймеру?

какие есть подходы к решению данной проблемы?

fljot 13.07.2008 00:32

телепаты всё ещё в отпуске. нужны примеры

если вы пользуетесь родным флешевым твином - может его просто собирает GC?

koresh& 13.07.2008 17:25

fljot, да, родной tween.
А почему он его собирает, действие то ещё выполняется?

да, спасибо, хорошая мысль.

http://maohao.wordpress.com/category/flash/
------------------------------------------------
Garbage collection in FP(AS3)

1. To remove an object (to authorize Flash Player to garbage collect it in the next GC cycle), simply remove the references to the object by doing so:

var fruit:Fruit= new Apple();
fruit = null;

or reuse the reference and stuff it with another object, like so:

fruit = new Orange();

2. Since garbage collection of a large amount of objects will be a big performance hit, rule of thumb is, you should strive to reuse rather than to delete an object for GC whenever possible.

3. When the programmer authorizes FP to garbage collect an object, he should always remember the followings:

* Remove all the event listeners of the target before removing it;
* Remove all the intervals, timers (Timer/timeout) that are associated with the object;
* Remove all the timeline functions within the instances of DisplayObject that are associated with the object;
* Remove all the tween instances and onEnterFrame handlers that are associated with it.
* URLLoader is also on the blacklist as some people noticed.
---------------------------------------------------------------------------

Alex Lexcuk 13.07.2008 22:12

Попробуйте класс Animator

fljot 13.07.2008 23:02

koresh&, когда создаешь твин, то присвой этот созданный твиновый объект свойству класса. тогда не убьётся


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

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