A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: setinterval

Hybrid View

  1. #1
    亲爱钰 slingsrat's Avatar
    Join Date
    Mar 2002
    Location
    Middle Earth
    Posts
    229

    setinterval

    I want an MC to move 10 pixels then wait a second then move 10 pixels again ad infinitum. This seemingly simple task has me stumped. I need to leave my frame rate at 24fps. Has anyone achieved this task before?

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    Code:
    var nMover:Number = setInterval(move, 1000);
    
    
    function move():Void{
    
     myMC._x += 10;
    
    }
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    setInterval(move,1000)//1000 miliseconds = 1 second
    function move (){
    myinstance._x = 10;
    }

  4. #4
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    duped by silent weed ! good morning silent~!

  5. #5
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    cheers..good afternoon (here)
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  6. #6
    亲爱钰 slingsrat's Avatar
    Join Date
    Mar 2002
    Location
    Middle Earth
    Posts
    229
    Thanks guys.

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