A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: setInterval and onEnterFrame in mx

  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    87

    setInterval and onEnterFrame in mx

    Hi guys
    I have 3 mcs on stage and this script in frame 1 that draws a line between them.
    code:

    stop();
    function draw() {
    mc.clear();
    mc.lineStyle(0, 0x000000, 60);
    mc.moveTo(h1._x, h1._y);
    mc.lineTo(h2._x, h2._y);
    mc.lineTo(h3._x, h3._y);
    }
    setInterval(draw, 2);


    the setInterval is allways on.
    After the animation plays on button i have the next script that plays the scene back
    code:

    on (release) {
    _root.onEnterFrame = function() {
    _root.prevFrame();
    if (_root._currentframe == 1) {
    delete _root.onEnterFrame;
    }
    };
    }



    The problem is that when the scene plays back the lines remain behind


    If anyone have anyideas how 2 make this one work please help.

    Thank You
    Last edited by maydays; 06-27-2005 at 08:45 PM.

  2. #2
    Member
    Join Date
    Jan 2004
    Posts
    87
    Anyone any ideas?
    Thanks

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Ony thing i see is do not use an onEnterFrame as it does not seem to cope well with the interval. Copy your first frames further on the timeline, reverse them to get the backward effect, and have the button ask the timeline to keep going forward.

    gparis

  4. #4
    Member
    Join Date
    Jan 2004
    Posts
    87
    Hi
    I have made my site with many line(made with shape tween) that move ..etc, and there i use onEnterFrame.
    So i learned a easy way 2 draw lines, but i better use shape tween on lines then to remove onEnterFrame in all my mcs.

    I know what u r saying but i cant do that.

    Thanks for the replay

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