Very Nice flash Actionscript tip

[ 2006-06-13 18:17:13 | Author: liuhuan ]
Font Size: Large | Medium | Small
You can navigate the site like locate in a map in this basic function in flash .(the parameter can be adjusted.)
Quote
function zoomXY(who, how, wh1, wh2, howRot, vel) {
  i = 0;
  who.onEnterFrame = function() {
      if (Math.round(this._xscale) == how && Math.round(this._y) == wh2 && Math.round(this._x) == wh1) {
        this._xscale = how;
        this._yscale = this._xscale;
        this._y = wh2;
        this._x = wh1;
        this._rotation =howRot
        delete this.onEnterFrame
      } else {
        ++i;
        this._rotation = this._rotation+i*(howRot-this._rotation)/40;
        this._xscale = this._xscale+i*(how-this._xscale)/vel;
        this._yscale = this._xscale;
        this._x = this._x+i*(wh1-this._x)/400;
        this._y = this._y+i*(wh2-this._y)/150;
      }
    // end if
  };
}
usage for example: zoomXY(mcname, 100, -523, -463, 0, 100);
Comments Feed Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=556

There is no comment on this article.

You can't post comment on this article.