HZGN.COM
welcome to my space
X
Welcome to:hzgn.com
Search:  
NAVIGATION - HOME
onEnterFrame vs setInterval
Published by: jane 2009-01-08

  • Hello everyone...

    I dont know if this has been discussed here before...

    i was having a conversation with a flash developer and he was going on about how using setInterval is much better than using onEnterFrame for actionscripted animations as the latter suffers from platform dependance (muc slower on Macs and slow processors) and also because once killed (delete onEnterFrame) can't be reinstated.

    Yesterday i received some help in this forum and the person who helped me pointed that i should use onEnterFrame as opposite as setInterval as is easier to use and less buggy...

    :sigh:

    Anybody willing to shed some light on the subject?

    Cheers in advance for your advice!!
    David Stillers blog Blog Archive How to Determine the Completion ::
    want to test for the time vs. duration comparison under circumstances other than (with MovieClip.onEnterFrame, say, or setInterval()) to repeatedly check the
    http://www.quip.net/blog/2007/flash/actionscript-20/how-to-determine-completion-of-flv
    HOME
    ActionScript.org Forums - setInterval() vs. onEnterFrame()::
    setInterval() vs. onEnterFrame() (http://www.actionscript.org/forums/showthread.php3?t=32511) setInterval() vs. onEnterFrame() Hi! I have some questins
    http://www.actionscript.org/forums/printthread.php3?t=32511
    HOME

    D


  • this article http://www.13dots.com/forum/index.php?showtopic=2353 (http://www.13dots.com/forum/index.php?showtopic=2353)

    approaches the same issues...with an eye on cpu usage

    D


  • I dont' really have an opinion, but I do have to say this:
    and also because once killed (delete onEnterFrame) can't be reinstated.
    That is SO WRONG!

    You can really easily reinstate an onEnterFarme:


    function moveMe()
    {
    //move the movieclip
    this._x += 10;
    }
    //assign onEnterFrame
    myMovieClip.onEnterFrame = moveMe;
    //delete onEnterFrame
    delete myMovieClip.onEnterFrame;
    //reinstate oEF:
    myMovieClip.onEnterFrame = moveMe;


  • At one time i used setInterval for all movement etc but one of the problems is that if you reload a movieclip, then the intervals do not clear on their own.So unless you keep track of all intervals to clear, can mess everthing up.
    Now reverted back to onEnterFrame and only use setInterval when necessary.


  • At one time i used setInterval for all movement etc but one of the problems is that if you reload a movieclip, then the intervals do not clear on their own.So unless you keep track of all intervals to clear, can mess everthing up.
    Now reverted back to onEnterFrame and only use setInterval when necessary.Why not write a custom class that keeps track of all the intervals ?


  • I use onEnterFrame unless i need like a timed event of a such a sort, i rarely ever use setInterval though


  • Why not write a custom class that keeps track of all the intervals ?
    because i cannot (-:


  • I just made this one. (It seems to be working, though I havent tested it much)

    class IntervalManager
    {
    var intervals:Array = new Array();

    public function addInterval(p_id:String, p_timeLine:Object, p_functionName:String, p_interval:Number):Void
    {
    var myArgs:Array = arguments;
    myArgs.shift();
    var myInterval:Number = setInterval.apply(null, arguments);
    intervals.push({interval:myInterval, id:p_id, args:myArgs});
    }

    public function removeInterval(p_id:String):Void
    {
    for(var i in intervals)
    {
    if(intervals[i].id == p_id)
    {
    clearInterval(intervals[i].interval);
    intervals.splice(i, 1);
    break;

    }
    }
    }

    public function pauseIntervals():Void
    {
    for(var i in intervals)
    {
    clearInterval(intervals[i].interval);
    }

    }
    public function removeAllIntervals():Void
    {
    for(var i in intervals)
    {
    clearInterval(intervals[i].interval);
    }
    intervals = new Array();
    }

    public function unPauseIntervals():Void
    {
    for(var i in intervals)
    {
    intervals[i].interval = setInterval.apply(null, intervals[i].args);
    }
    }

    public function unPauseSingleInterval(p_id:String)
    {
    for(var i in intervals)
    {
    if(intervals[i].id == p_id)
    {
    intervals[i].interval = setInterval.apply(null, intervals[i].args);
    break;
    }
    }
    }

    public function pauseSingleInterval(p_id:String)
    {
    for(var i in intervals)
    {
    if(intervals[i] == p_id)
    {
    clearInterval(intervals[i].interval);
    break;
    }
    }
    }

    }





  • Red Hat's Rough Recovery From CFO Exit
    Windows Live Finds a New, Pre-installed Home

    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about onEnterFrame vs setInterval , Please add it free.
  • latin spelling
  • list of large companies in bergen county nj
  • xp i 01 01 01
  • serbian dating
  • casino dealer school in sacramento california
  • vp compensation part 2
  • merchant epayment etc
  • list of leading business to business franchisers
  • how can i create a manmade lake
  • out of print movie
  • hog map
  • swedish art
  • link submissions to engineering sites
  • measuring the force required to chew food
  • removing laptop dvd region code change restrictions
  • cost of equipping and leasing a large commercial test kitchen
  • profitable data sales on ebay
  • vhs tapes of tv shows
  • finding an educational consultant
  • html code backends
  • strategic planning and financial performance in charitable organizations
  • i want to locate where i can buy commercial fantasy artwork for use on website
  • testing hearing range
  • poems
  • is my titan ii agp video card useful
  • how do i get back my instant messenger conversations
  • global inequality growng difference between rich and poor people
  • About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008hzgn.com All Rights Reserved