Announcement Announcement Module
Collapse
No announcement yet.
Help: slowing-down a for loop??? Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Featured Images Featured Images Module
Collapse

Mediabistro Creative Sites Mediabistro Creative Sites Module
Collapse
Latest Topics Latest Topics Module
Collapse

  • fynch
    Reply to Help with logo "fynch"
    fynch
    Hi guys thanks for all the input,

    @Kitchwitch thank you for the welcome Ill go over and check out the rules now, glad to know I wasn't having computer errors in posting this.
    ...
    Today, 04:44 AM
  • Kayekaye
    Reply to From Architect House Plan to Realistic 3D model
    Kayekaye
    Well there are all kinds of 3d architectural software. But how can you download them, learn them, and draw this in 24 hours. Not very realistic. He should be able to do a 3d from his plans on CAD like...
    Today, 04:32 AM
  • Kayekaye
    Comment on InDesign Style Sheets--Numbered bullets
    Kayekaye
    Yes this was killing me recently, all of them being numbered as 1. Did your fix work?
    Today, 04:06 AM
  • Kayekaye
    Reply to Getting logged out
    Kayekaye
    Tonight I've been logged out 4 times! Every time I leave the page and go to my job and then come back I'm logged out. Yikes, next time I give up for today...
    Today, 03:47 AM
  • <b>
    Reply to Logo forum graphic design
    <b>
    A big muscular arm emerging from the top of a head is both weird and creepy. Sorry, but there's no saving this one.
    Today, 03:03 AM
Advertisement Advertisement Module
Collapse

Sponsors Sponsors Module
Collapse

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help: slowing-down a for loop???

    Title: Help: slowing-down a for loop???

    íHola!

    My script:

    [quote]
    //Createstatictextfield:
    this.createTextField('static_txt',3,50,0,50,20);
    this.static_txt.text='ism';
    //
    //Createarray:
    varisms=['Natural','Postmodern','Surreal','Dada','Formal',' Real','Symbol','Expression','Futur','Ambigu'];
    //
    //Createtextfieldtodisplayabovearrayelements:
    this.createTextField('ism_txt',2,0,0,50,20);
    ism_txt.selectable=false;
    ism_txt.type='dynamic';
    ism_txt.text='------';
    //
    //Createmovieclipbutton:
    this.createEmptyMovieClip('ism_btn',1);
    //Addtextfield:
    this.ism_btn.createTextField('submit_txt',1,100,50 ,50,20);
    this.ism_btn.submit_txt.text='Submit';
    //
    //Buttonhandler:
    this.ism_btn.onRelease=function(){
    //Createforlooptocyclethrougharrayanddisplaycontents/elementssequentially:
    for(vari=0;i<isms.length;i++){
    trace('Nowexaminingelement:'+isms[i]);
    ism_txt.text=isms[i];
    }//Endforloop.
    };//Endismbuttonfunction.
    </CODE>

    How do I decrease the speed of the above 'for loop' each time it iterates?

    I would like the array elements to display in the (ism_txt) text box, starting really fast, slow down, and finally stopping/displaying last element of array in text box.

    Is that possible?

    Should I us setInterval?

    Obviously, I am a novice actionscripter... If I am going about this the wrong way, please let me know... maybe I should not be trying to do this all via AS?

    Anyway, any help would be appreciated.

    Cheers!
    Micky

  • #2
    I don't know how to do it in as but if you're familiar at all with flash, you can easily change your looping speed there via the fps (frames per second) box.

    Knowledge speaks but wisdom listens....Jimi Hendrix

    Comment


    • #3
      Or you could easily insert ANOTHER for loop and adjust it for the time. In Flash, is there a WAIT command? I'm not a Flash programmer at all, but the scripting language sounds a lot like C or other compiled languages...

      I'm a computer systems consultant and technician, but my business is very localized.
      However, feel free to check out my site, which always has new and interesting
      articles on using computers:
      CATALYST Techworks Consulting

      Comment


      • #4
        You could probably use a timer, but I don't know how to do that in ActionScript. Case would know, but he has been very busy lately.

        ProudPenguin
        P r o d u c t i o n s


        Comment


        • #5
          Set it up as a function and set a variable to control the interval.

          here's a tutorial on intervals and functions

          http://www.kirupa.com/developer/acti...etinterval.htm.

          alter the variable by whatever at the end of your original script either by adding, subtracting or dividing is a nice way to achieve a 'slowdown' effect

          let me know how you get on




          ----------------------------------------------------------------
          hand : ollie@ollielindsey.co.uk
          eye : www.ollielindsey.co.uk
          mouth : 07966 160983
          ----------------------------------------------------------------

          Post Edited (Ollie Lindsey) : 10/15/2004 11:12:32 AM GMT

          Comment

          Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2014 Mediabistro Inc. call (212) 389-2000 or email us
          Working...
          X