Announcement

Collapse
No announcement yet.

Help: slowing-down a for loop???

Collapse
X
  • 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

          Search

          Collapse

          Advertisement

          Collapse

          Latest Topics

          Collapse

          • kemingMatters
            Comment on Questions about your graphic design CV
            kemingMatters
            Why does it have to be converted to PDF from word? you can get much more reasonable PDF file sizes when exporting from inDesign. Most of those max file size limits are 2mb, you should be able create a...
            Today, 01:01 PM
          • joshnx
            Reply to Questions about your graphic design CV
            joshnx
            .
            It's really helpful to know you have been on both sides i.e applying as well as hiring, so I will stick to your advice about keeping it plain. Thanks.



            That might...
            Today, 12:48 PM
          • Cosmo
            Reply to How to achieve this business card look on the text? On CS6
            Cosmo
            It looks like it's supposed to be a spot glass coating on a matte card. No great way to simulate that in InDesign. Best way to make it happen is call the printer that is printing it and ask them, but...
            Today, 12:43 PM
          • salsa
            Reply to Questions about your graphic design CV
            salsa
            ​1.Which is a better format for your resume? .doc or .pdf?
            The one that gets you an interview.

            ​2.Do you go plain or creative?
            I go with the version that will get...
            Today, 12:14 PM
          • HotButton
            Comment on Transform Palette in Illustrator CS
            HotButton
            Good god, the Illustrator user forum has an unending flow of posts complaining about the ill effects of Align to Pixel Grid on ... print-destined files.

            ''Parts of my book cover artwork keep...
            Today, 11:55 AM

          GDF A division of Mediabistro Holdings Adweek | Mediabistro | Clio | Film Expo Group Contact Us | Terms of Use | Privacy Policy Copyright © 2016 Mediabistro Holdings
          Working...
          X