0 Replies Latest reply on Jan 10, 2007 3:48 PM by Newsgroup_User

    trying to get prototype function to fire in a class

    Level 7
      I am trying to write an actionscript file to take the place of a series of
      movie clips.

      the specific line that I am trying to find the right call for is :
      this.onEnterFrame = this.fly;

      I haved tried this which is recomented by livedocs but the finction does not
      fire.
      ScrollMsg.fly();

      I can't use onEnterFrame because that frame is not available.


      function ScrollMsg() {
      trace("NS--Loaded Scroller");
      this._x = 30;
      this._y = 0;
      trace("this._y"+this._y)
      this.createTextField("Msg", 0, 0, 0, this.msgwidth, 10);
      trace("ScrollMsg-initialization.msgtext:"+initialization.msgtext);
      with(initialization.msgtext) {
      //setNewTextFormat(_global.MsgFormat);
      autoSize = "left";
      wordWrap = true;
      multiline = true;
      embedFonts = true;
      selectable = false;
      text = initialization.msgtext;
      trace("text-initialization.msgtext:"+initialization.msgtext);
      }
      // set continual function to fly
      //this.onEnterFrame = this.fly; //--- This does not work in actionscript
      class
      ScrollMsg.fly();


      }
      ScrollMsg.prototype.fly = function() {
      trace("ScrollMsg.prototype.fly");
      //if(!_global.MSG_ON_HOLD&&!_global.SYSTEM_ON_HOLD) {
      trace("this._y"+this._y)
      if (this._y > -800) {
      this._y -=_global.MSG_SPEED;
      trace("this._y"+this._y)
      } else {
      this.removeMovieClip();
      trace("this.removeMovieClip");
      }
      //this._alpha = 100 - Math.abs(this._y - this.distance/2)*.3;
      // }

      };