Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/07/2005, 02:48
Avatar de LMQA
LMQA
 
Fecha de Ingreso: agosto-2004
Mensajes: 9
Antigüedad: 19 años, 9 meses
Puntos: 0
Así es amigo, me refiero al punto de registro

Con la ayuda que me diera el amigo PRINCE encontré un "codigo" interesante para lograr dicho efecto, por tiempo aun no lo he revisado pero está simpatica la idea.

la verdad he perdido la dirección de donde lo saqué, igual lo pongo no creo que haya problema no?

Código:
var MCP = MovieClip.prototype;
MCP._xreg = MCP._yreg=0;
MCP.setPropRel = function(prop, amount) {
        var a = {x:this._xreg, y:this._yreg};
        this.localToGlobal(a);
        this._parent.globalToLocal(a);
        this[prop] = amount;
        var b = {x:this._xreg, y:this._yreg};
        this.localToGlobal(b);
        this._parent.globalToLocal(b);
        this._x -= b.x-a.x;
        this._y -= b.y-a.y;
};
MCP.set_x2 = function(v) {
        var a = {x:this._xreg, y:this._yreg};
        this.localToGlobal(a);
        this._parent.globalToLocal(a);
        this._x += v-a.x;
};
MCP.get_x2 = function() {
        var a = {x:this._xreg, y:this._yreg};
        this.localToGlobal(a);
        this._parent.globalToLocal(a);
        return a.x;
};
MCP.set_y2 = function(v) {
        var a = {x:this._xreg, y:this._yreg};
        this.localToGlobal(a);
        this._parent.globalToLocal(a);
        this._y += v-a.y;
};
MCP.get_y2 = function() {
        var a = {x:this._xreg, y:this._yreg};
        this.localToGlobal(a);
        this._parent.globalToLocal(a);
        return a.y;
};
MCP.set_xscale2 = function(v) {
        this.setPropRel("_xscale", v);
};
MCP.get_xscale2 = function() {
        return this._xscale;
};
MCP.set_yscale2 = function(v) {
        this.setPropRel("_yscale", v);
};
MCP.get_yscale2 = function() {
        return this._yscale;
};
MCP.set_rotation2 = function(v) {
        this.setPropRel("_rotation", v);
};
MCP.get_rotation2 = function() {
        return this._rotation;
};
MCP.get_xmouse2 = function() {
        return this._xmouse-this._xreg;
};
MCP.get_ymouse2 = function() {
        return this._ymouse-this._yreg;
};
with (MCP) {
        addProperty("_x2", get_x2, set_x2);
        addProperty("_y2", get_y2, set_y2);
        addProperty("_xscale2", get_xscale2, set_xscale2);
        addProperty("_yscale2", get_yscale2, set_yscale2);
        addProperty("_rotation2", get_rotation2, set_rotation2);
        addProperty("_xmouse2", get_xmouse2, null);
        addProperty("_ymouse2", get_ymouse2, null);
}
ASSetPropFlags(MCP, null, 1);
delete MCP;
//mc._xreg = 100;
//mc._yreg = 70;
//mc._rotation2 = 60;
//mc._x2;
//mc._y2 ;
//to position the movie clip according to the new reg point
//mc._xscale2;
//mc._yscale2 ;
Igual al menos despejé mi duda de que no existe una propiedad para modificar el punto de registro dinamicamente. Se tiene que implementar.