A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Help! How to make time delay?

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    11

    Help! How to make time delay?

    Do anyone know how to use ActionScript (not using frame)
    to make time delay????? (MX 2004)

    e.g.

    do {
    this.mc._alpha += 1;
    (I want some delay here)
    } while (this.mc._alpha<100);



    Thanks!
    Last edited by garychui; 01-27-2004 at 04:09 PM.

  2. #2
    Senior Member
    Join Date
    Oct 2003
    Posts
    388

    Re: Help! How to make time delay?

    Originally posted by garychui
    Do anyone know how to use ActionScript (not using frame)
    to make time delay????? (MX 2004)

    e.g.

    do {
    this.mc._alpha += 1;
    (I want some delay here)
    } while (this.mc._alpha<100);



    Thanks!

    function Alpha() {
    if(_root.mc._alpha<100){
    _root.mc._alpha++
    }
    }

    setInterval(Alpha, INTERVAL_HERE)
    updateAfterEvent()

  3. #3
    Junior Member
    Join Date
    Oct 2003
    Posts
    11

    Thanks

    Thanks!
    I can do that individually...

    but...
    I cannot use it in this situation...

    on (rollOver) {
    function Alpha() {
    if (mc._alpha<100) {
    mc._alpha++;
    }
    }
    setInterval(Alpha, 1);
    updateAfterEvent();

    }
    on (rollOut) {
    function Alpha() {
    if (mc._alpha>0) {
    mc._alpha--;
    }
    }
    setInterval(Alpha, 1);
    updateAfterEvent();
    }


    These scripts are in an btn (not the MC)
    It can work when I roll over the btn (The MC fade in)
    but when I tried to roll over and out it several times,
    the script didn't work!

    Please help!
    Thanks!

  4. #4
    Junior Member
    Join Date
    May 2002
    Posts
    9
    I wanna know about that as well! Thanks!
    Best Regards,

    GODevil
    =============================
    http://www.gazzone.com

  5. #5
    Senior Member
    Join Date
    Oct 2003
    Posts
    388
    frame action:

    _root.onEnterFrame = function() {
    if(something==1 && mc._alpha<100) {
    mc._alpha++
    }
    if(something==0 && mc._alpha>0) {
    mc._alpha--
    }
    }



    button action:

    on (rollOver) {
    something = 1
    }
    on (rollOut) {
    something = 0
    }

  6. #6
    Junior Member
    Join Date
    Oct 2003
    Posts
    11
    Thanks!

    But I want to put all the scripts into the button...
    Is it possible!?

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