A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Timer - PLEASE help... i just dont get it

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    6

    Timer - PLEASE help... i just dont get it

    Hi there, i am hoping someone can help me with this....
    i have created a timer, when that timer expires it should go to and play a different frame, as well as resetting the timer. in the movie i created i was able to do either 1 or the other. ( i uploaded a dummy file because it would have otherwise been too large to upload... unfortunately it didn’t do either{ for reasons i do not understand}), anyway... any help here would be realllyyyyyyy appreciated

    yours
    Attached Files Attached Files

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Hi,

    Delete the piece of code you have in the last frame. You have a gotoAndStop() and then a gotoAndPlay()... a gotoAndPlay() is enough!

    Change the order of the code in the else statement:
    code:

    else {
    _root.count = 0;
    _root.gotoAndPlay(45);
    }



    There are things that you can improve in your code:
    code:

    _root.count = _root.count + 1;
    //is the same as
    _root.count ++;
    // or
    _root.count += 1;


    code:

    //setProperty is deprecated, use dot notation instead:
    setProperty(this, _rotation, _root.count*"36");
    // can be
    this._rotation = _root.count*36;


    And as you are using MX (according to my properties panel), there are many other things you can improve:
    - attaching code just to the main timeline and using methods
    - using setInterval() in this particular case (or the onEnterFrame() method)
    ... this are some good practices you can use, but they also require some more knowledge of AS. So, for now be aware that other things exist and take a look at them when you have the time in case you want.

  3. #3
    Junior Member
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    6

    Thank you

    Thanks so much.... u know i had tried that in my main movie, and it didnt work.... i have been having this problem continuously with this project that sometimes flash appears to be buggy... i told it to go to frame what ever of scene 9.... ( which was the scene where th counter was), but instead it went back to frame 1 of the movie. its referenced correctly... just wouldnt go to the correct scene. so when i tested the movie i took down the actual frame number ( which was like 827 or something), and it worked

    THANK YOUUUUUUUUUU

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