2 Replies Latest reply on Mar 8, 2008 12:54 PM by ChrisFlynn

    onEnterFrame = function within a class

    ChrisFlynn Level 1
      Hi all

      I've created a class that has a method that receives an XML node. Currently, it uses a for loop to go throught the XML, like this:

      for(var i=0; i<=(myXML.childNodes.length-1);i++){
      // Internal Actions

      Now this would work fine if the XML node received by this method has 10 nodes, 20 nodes, and so on. But I'll need this to handle anywhere from 1000 to 2000 nodes.

      If I were writing this code on the timeline, I would use an onEnterFrame action to drill through a 2000 node XML, like this:

      var i=0;
      this.onEnterFrame = function(){
      // Internal Actions
      this.onEnterFrame = null;

      But I want to do something like this within a class. But every attempt to use the above onEnterFrame in a class hasn't worked. Nothing within the onEnterFrame ever gets called.

      I'm still a bit fuzzy how to write classes so any help is appreciated.