A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: function ..() and onEnterFrame = function ()

  1. #1
    the naked eye waynenort's Avatar
    Join Date
    Jan 2002
    Location
    Melbourne, Australia
    Posts
    334

    function ..() and onEnterFrame = function ()

    I want to call on a function at a give point and invoke it repeatedly at the frame rate of the SWF file. At the moment a function() and onEnterFrame = function () is used to acheive this.
    Is there an easier way of doing it?

    code:
    myCalculations ();

    ....................................then at a different point

    function myCalulations ()
    {
    this.onEnterFrame = function ()
    {
    //calculation go here until it reach a result
    //Then plays another frame
    };
    }


  2. #2
    Junior Member
    Join Date
    Feb 2005
    Location
    NORWAY
    Posts
    19
    Edit: I think I misunderstood your problem, so removed my answer
    Last edited by LarPed; 02-19-2009 at 06:43 AM.

  3. #3
    Member
    Join Date
    Feb 2006
    Location
    Johannesburg, South Africa
    Posts
    41
    If I understand the problem correctly this should solve your problem. MyCalculation function will be run at 1 second intervals, you can increase this number to whatever you want.

    PHP Code:
    intervalID setInterval(myCalculations,1000);

    function 
    myCalulations (){
    //calculations go here

    Let me know if this helps.

  4. #4
    the naked eye waynenort's Avatar
    Join Date
    Jan 2002
    Location
    Melbourne, Australia
    Posts
    334
    yes thanks

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