2 Replies Latest reply on Aug 7, 2006 6:43 AM by DigiJohn

    Object class

    DigiJohn
      I have a question about the use of the Object class in regards to some actionscript used in a template from Dan Carr. A new variabel called "videoEvents" is declared as an Object (var videoEvents:Object = new Object();"). The object "videoEvents" is used with the methods/properties "target" and "cuePoints" (videoEvents.target = this). In the description of the Object class there is no property called "target" and "cuePoints". Is it possible to declare new methodes/properties like this in ActionScript or is there something I'm missing?

      Outprint from Dan Carr Flash Article "Flash Video Template: Video Presentation with Navigation"

      //-----------------
      // Event handling
      //-----------------
      // Create a listener object to catch the cue event
      // from the FLVPlayback instance
      var videoEvents:Object = new Object();
      videoEvents.target = this;
      videoEvents.cuePoint = function( evt:Object ):Void
      {
      // On cuePoint, look for a button named with the cue name
      // plus "_btn". If it exists, then call its select method...
      var button = this.target[ evt.info.name+"_btn" ];
      if( button != undefined )
      button.select();
      }
      display.addEventListener("cuePoint",videoEvents);

      Thx, DigiJohn
      - Not a ActionScript magician, as you may have noticed :)
        • 1. Re: Object class
          Level 7
          DigitalJohnny,

          > In the description of the Object class there is no
          > property called "target" and "cuePoints".

          You have no idea how satisfying it is to me that you looked up the
          Object class before posting. That doesn't happen often. :)

          > Is it possible to declare new methodes/properties
          > like this in ActionScript or is there something I'm
          > missing?

          You betcha. In fact, that's usually what Object instances are for. Dan
          Carr is doing so right there ...

          videoEvents.target = this;
          videoEvents.cuePoint = function( evt:Object ):Void


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Object class
            DigiJohn Level 1
            David Stiller,

            Thank you for your reply! You answered my question.

            Had no doubt that Dan Carr was doing the right thing, but wanted to understand what was happening in the code :)

            DigiJohn