Announcement Announcement Module
Collapse
No announcement yet.
Help: slowing-down a for loop??? Page Title Module
Move Remove Collapse
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    #1
    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.

        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

          Google search Google search Module
          Collapse
          Latest Topics Latest Topics Module
          Collapse
          • kemingMatters's Avatar
            Commented to exhibition poster
            I'm not going to bother saying what's already been said, I agree with it. I would suggest showcasing one area of interest per poster.

            Assuming it's to be displayed in hallways and/or within...
          • PanToshi's Avatar
            Commented to Typographic Art
            It's done by "hand". No plug-ins. No scripts. The designer uses their design skills to create ... um ... designs. Take a look at the video and links on this 2012 thread. All hand done from the...
          • seamas's Avatar
            Commented to exhibition poster
            Yeah, the hierarchy is an issue. The "ITD" and how it is rendered is more feint than the items surrounding it. The illustrations are nice, but unfortunately, not really important. I would not...
          • Shug's Avatar
            Commented to Hello
            Thanks KitchWitch. I have read through most of the FAQ and rules stickeys. I'm going through the inside jokes now.
          • KitchWitch's Avatar
            Commented to Hello
            Hi Shug and welcome to the forum.

            When you get settled, please take a few minutes to read through the sticky threads here. These will explain our rules, expectations for conduct and...
          • KitchWitch's Avatar
            Commented to Hello GDF
            Hi kaboom and welcome to the forum.
            I know you've already read most of them, but I'm a creature of habit... So when you get settled, please take a few minutes to look through the sticky posts...
          • stuckinlimb0's Avatar
            I wasn't planning on uploading to a hosting site, but i guess i had to... I tried putting it into tiny url and it was giving me problems too. Here are the direct links, I don't know why the second one...
          • kemingMatters's Avatar
            Commented to New old bc
            Here's my only suggestion, and I'm only giving it to you because this is probably the piece with the most promise that I've seen you post. However if you pull a 180 from this concept I will not comment...
          All Creative World Network All Creative World Network Module
          Collapse
           
          home | site map | advertising/sponsorships | about us | careers | contact us | help courses | browse jobs | freelancers | events | forums | content | member benefits | reprints & permissions about | terms of use | privacy policy | Copyright © 2013 Mediabistro Inc. Mediabistro Inc. call (212) 389-2000 or email us
          Working...
          X