dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How do you set the speed when using myText.scroll--;

Hybrid View

  1. #1
    Senior Member flipsideguy's Avatar
    Join Date
    Dec 2000
    Location
    Sweden
    Posts
    834

    How do you set the speed when using myText.scroll--;

    Hi All,

    I am using the following method of scrolling dynamic text. However the scrolling-speed is too fast (because of the main FPS is set to 30. How do I control the speed of the scroller when using:
    Code:
    onClipEvent (enterFrame){
     if( scrolling == "up"){
     type.scroll = type.scroll - 1;
     }
     if( scrolling == "down"){
     type.scroll = type.scroll + 1;
     }
    }
    Anyone?

    Thanks,

    Flip.
    Flipsideguy

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    Try this:
    Action on the first frame
    code:

    function txtUp(){
    if(txt.scroll>0){
    txt.scroll--;
    }
    }
    function txtDwn(){
    if(txt.scroll<txt.maxscroll){
    txt.scroll++;
    }
    }


    Actions on the buttons:
    code:

    on(press){
    ups = setInterval(txtUp,300);
    }
    on(release){
    clearInterval(ups);
    }
    //================and===========
    on(press){
    dwn = setInterval(txtDwn,300);
    }
    on(release){
    clearInterval(dwn);
    }


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