dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Delaying tween class

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Location
    Seoul, South Korea
    Posts
    1,310

    Delaying tween class

    Hi all,
    I'm having trouble delaying the tween. At the moment the myTween is successfully tweening the nav buttons up however it is tweening them all at once. I'm wanting to tween the first nav button first then after a small delay the second one as so on until the last nav button is loaded.
    Hope someone can help me resolve this.
    Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    navText_array = new Array("Home", "About", "Work", "Play", "Contact");
    
    var btnCnt = navText_array.length;
    for (i=0; i<btnCnt; i++) {
      var tab_mc:MovieClip = this.createEmptyMovieClip("tab_mc", this.getNextHighestDepth());
      tab_mc._x = 183;
      tab_mc._y = 100;
      var temp = tab_mc.attachMovie("background_ids", "tab"+i+"_mc", this.getNextHighestDepth());
      temp._x = i*105
      temp._y = 0
      temp.navText.text = navText_array[i];
      temp.begin = temp._y;
      temp.end = temp._y-100;
      temp.time = 8;
    
      myTween = new mx.transitions.Tween(temp, "_y", mx.transitions.easing.Regular.easeInOut, 30, 0, 1, true);
    
    }
    Cheers
    !.....................................COMING SOON

  2. #2
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    Take a look at setInterval, and restructure your code so that setInterval fires a function that will play the next clip in your array. This will let you set the time between when each starts easily.
    If it ain't broke, don't fix it.

  3. #3
    Member
    Join Date
    Jan 2003
    Posts
    85
    Or take a look at Laco's Tweens which have a delay property.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center