A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: onEnterFrame once a second

  1. #1
    Senior Member gordonart's Avatar
    Join Date
    Jun 2003
    Location
    Sweden
    Posts
    267

    onEnterFrame once a second

    I use this:
    this.onEnterFrame = function(){
    if((kropp==2)&&(huvud==4)&&(bg.BGtyp==1)){
    bg.nextFrame();
    trace("good");
    }
    to know when different variabels are right. But I don´t want the check to be once every 2 second and not every frame. I could put the code in a looping mc but could I do that in a code?

    /Mattias
    Mattias Gordon
    illustrator/ animator

  2. #2
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    Actionscript Code:
    function checker() {
        if((kropp==2)&&(huvud==4)&&(bg.BGtyp==1)){
        bg.nextFrame();
        trace("good");
        }
    }
    int1 = setInterval(checker,1000);

  3. #3
    Senior Member gordonart's Avatar
    Join Date
    Jun 2003
    Location
    Sweden
    Posts
    267
    Thanks a lot!
    Mattias Gordon
    illustrator/ animator

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