Jump to content


  • Posts

  • Joined

  • Last visited


0 Newbie
  1. Hi, I am writing pretty simple game that utilizes MVC pattern. Model is calculating data stored in Array and dispatches events to View that tries to reproduce and visualize it. I wanted to implement View in the way that TimelineMax is handling the tweens by queing it up and play it at the certain point of time. Here is the mainLoop from Model public function mainLoop():void { applyBonus(bonuses); fall(); applyBonus(bonuses); dispatchEvent(new Event(BoardModel.PLAY)); } the function applyBonus or fall just dispatches appropriate events to View. The listeners to this methods just create Tweens and are adding them to the TimelineMax using the append method. The problem is that each on this tweens has a its onComplete method. I want to make sure that not only twees are executed in correct order but also onComplete. Currently I have: applyBonus tween fall tween applyBonus onComplete fall onComplete I wish to have: applyBonus tween applyBonus onComplete fall tween fall onComplete etc. How can I achieve something like this?
  2. Hi there, I've been writing flash gallery for a while and almost finished it, but encounter some problems in the end. This is nearly that same gallery like : http://www.simpleviewer.net/simpleviewe ... les/hires/ You can watch it at http://www.karolina-art.pl/gallery/bin The problem is that I can't handle tweening the thumbnail menu properly if click rapidly two or more times next arrow button. I've managed to solve this by using TweenMax.isTweening() method, so that I have: public function next():void { var startingThumbnailMenu:int = ThumbnailMenu.getInstance().startingThumbnailMenu; var currentThumbnailMenu:int = ThumbnailMenu.getInstance().x; var difference:int = currentThumbnailMenu-startingThumbnailMenu; if (!TweenMax.isTweening(ThumbnailMenu.getInstance())) { TweenMax.to(ThumbnailMenu.getInstance(), 0.3, { x:"-216" } ); screenNumber++; updateArrows(); } } And nearly the same prev() method differing only by x":+216" in TweenMax.to() method. It works but it not as good as it could be since the delay is visible and user sees that I'm actually preventing her/his from clicking to fast in the arrow buttons. In SimpleViewer everything works better because users actions are queued and no action is prevented. How to achieve this effect using TweenMax? I hope you can help me handle it.