Comunidad de diseño web y desarrollo en internet online

convertir un mc fijo a seguidor de puntero

Citar            
MensajeEscrito el 28 Ene 2009 01:45 am
tengo un mc puesto en la pelicula con attachMovie, y quiero que al activar un boton se desplace siguiendo al puntero, casi todo lo he puesto con attachMovie, y este mc esta dentro de otro mc y finalmente dentro de un tercero, este mc son unos ojos que voltean a ver el puntero y ahora quiero que lo sigan, este es el codigo del primer mc que contiene las instancias OJOD Y OJOI:

this.attachMovie("SOMBRA","SOMBRAD",1);
SOMBRAD._x=346.2
SOMBRAD._y=185
this.attachMovie("SOMBRA","SOMBRAI",2);
SOMBRAI._x=603.8
SOMBRAI._y=185
SOMBRAI._xscale=-100
this.attachMovie("BOCÓN","BOCÓN",3);
BOCÓN._x=475
BOCÓN._y=479
BOCÓN._xscale=133
BOCÓN._yscale=133
this.attachMovie("OJOS","OJOD",4);
OJOD._x=350
OJOD._y=250
this.attachMovie("OJOS","OJOI",5);
OJOI._x=600
OJOI._y=250
this.attachMovie("PARPADEO","PARPADEOD",6);
PARPADEOD._x=350
PARPADEOD._y=250
PARPADEOD._rotation=9
this.attachMovie("PARPADEO","PARPADEOI",7);
PARPADEOI._x=600
PARPADEOI._y=250
PARPADEOI._rotation=-9
PARPADEOI._xscale=-100
this.attachMovie("NARIZ","NARIZ",8);
NARIZ._x=475
NARIZ._y=345

Por JIMMYTHECLOWN

25 de clabLevel



 

MÉXICO

msie
Citar            
MensajeEscrito el 28 Ene 2009 11:20 am
podrias hacer algo asi...

Código :

this.onEnterFrame = function(){
   OJOD._x = _xmouse;
   OJOD._y = _ymouse;
}

onEnterFrame lo ke hace es repetir ( segun la velocidad de la linea de tiempo ) las acciones ke has puesto adentro de esa funcion. para ke el seguimiento kede un poco mas agradable, podrias usar algo asi...

Código :

this.onEnterFrame = function(){
   OJOD._x += (_xmouse-OJOD._x) * 0.08;
   OJOD._y += (_ymouse-OJOD._y) * 0.08;
}

espero te haya servido :wink:

Por fabri_bit

36 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 Ene 2009 07:51 pm
este codigo lo copio y lopongo donde?, lo puse en el boton que quiero que loactive pero no funciono, el codigo donde tego el boton, que se llama AZUL5 esta aqui:

this.attachMovie("FONDO","FONDO",1);
FONDO._x=475
FONDO._y=900
FONDO._xscale=2850
FONDO._yscale=1800
this.attachMovie("IZQUIERDOSRESERVADOS","IZQUIERDOSRESERVADOS",2);
IZQUIERDOSRESERVADOS._x=5
IZQUIERDOSRESERVADOS._y=585
IZQUIERDOSRESERVADOS._xscale=50
IZQUIERDOSRESERVADOS._yscale=50
this.attachMovie("LENZCOPYLEFTS","LENZCOPYLEFTS",3);
LENZCOPYLEFTS._x=870
LENZCOPYLEFTS._y=585
LENZCOPYLEFTS._xscale=50
LENZCOPYLEFTS._yscale=50
this.attachMovie("MAQULLAJE","MAQULLAJE",4);
this.attachMovie("MANOD","MANOD",5);
MANOD._x=403
MANOD._y=600
MANOD._xscale=68
MANOD._yscale=68
MANOD.onPress=function(){
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(MAQULLAJE,"_x",Elastic.easeOut,0,200,9,true);
new Tween(MANOI,"_x",Elastic.easeOut,547,747,9,true);
this._parent.attachMovie("BIENVENIDA","BIENVENIDA",106);
BIENVENIDA._x=9
BIENVENIDA._y=9
new Tween(BIENVENIDA,"_alpha",Strong.easeOut,0,100,9,true);
}
MANOD.onRelease=function(){
new Tween(MAQULLAJE,"_x",Elastic.easeOut,200,0,9,true);
new Tween(MANOI,"_x",Elastic.easeOut,747,547,9,true);
removeMovieClip(BIENVENIDA);

}
MANOD.onReleaseOutside=function(){
new Tween(MAQULLAJE,"_x",Elastic.easeOut,200,0,9,true);
new Tween(MANOI,"_x",Elastic.easeOut,747,547,9,true);
removeMovieClip(BIENVENIDA);
}
this.attachMovie("MANOI","MANOI",6);
MANOI._x=547
MANOI._y=600
MANOI._xscale=68
MANOI._yscale=68
MANOI.onPress=function(){
new Tween(MAQULLAJE,"_x",Elastic.easeOut,0,-200,9,true);
new Tween(MANOD,"_x",Elastic.easeOut,403,203,9,true);
this._parent.attachMovie("WELCOME","WELCOME",107);
WELCOME._x=540
WELCOME._y=9
new Tween(WELCOME,"_alpha",Strong.easeOut,0,100,9,true);
}
MANOI.onRelease=function(){
new Tween(MAQULLAJE,"_x",Elastic.easeOut,-200,0,9,true);
new Tween(MANOD,"_x",Elastic.easeOut,203,403,9,true);
removeMovieClip(WELCOME);
}
MANOI.onReleaseOutside=function(){
new Tween(MAQULLAJE,"_x",Elastic.easeOut,-200,0,9,true);
new Tween(MANOD,"_x",Elastic.easeOut,203,403,9,true);
removeMovieClip(WELCOME);
}
this.attachMovie("FONDO","FONDO1",7);
FONDO1._x=-900
FONDO1._y=50
this.attachMovie("FONDO","FONDO2",8);
FONDO2._x=475
FONDO2._y=50
this.attachMovie("FONDO","FONDO3",9);
FONDO3._x=1849
FONDO3._y=50
this.attachMovie("FONDO","FONDO4",10);
FONDO4._x=-900
FONDO4._y=900
this.attachMovie("FONDO","FONDO5",11);
FONDO5._x=475
FONDO5._y=650
this.attachMovie("FONDO","FONDO6",12);
FONDO6._x=1849
FONDO6._y=900
this.attachMovie("FONDO","FONDO7",13);
FONDO7._x=-900
FONDO7._y=1749
this.attachMovie("FONDO","FONDO8",14);
FONDO8._x=475
FONDO8._y=1749
this.attachMovie("FONDO","FONDO9",15);
FONDO9._x=1849
FONDO9._y=1749
this.attachMovie("ROJO","ROJO1",16);
ROJO1._x=-933
ROJO1._y=17
ROJO1._xscale=13
ROJO1._yscale=13
ROJO1.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,1045,950,9,true);
}
this.attachMovie("AZUL","AZUL1",17);
AZUL1._x=-900
AZUL1._y=17
AZUL1._xscale=13
AZUL1._yscale=13
AZUL1.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
}
this.attachMovie("ROJO","ROJO2",18);
ROJO2._x=-866.5
ROJO2._y=17
ROJO2._xscale=13
ROJO2._yscale=13
ROJO2.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
}
this.attachMovie("AZUL","AZUL2",19);
AZUL2._x=-933
AZUL2._y=50
AZUL2._xscale=13
AZUL2._yscale=13
AZUL2.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("ROJO","ROJO3",20);
ROJO3._x=-900
ROJO3._y=50
ROJO3._xscale=13
ROJO3._yscale=13
ROJO3.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("AZUL","AZUL3",21);
AZUL3._x=-866.5
AZUL3._y=50
AZUL3._xscale=13
AZUL3._yscale=13
AZUL3.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("ROJO","ROJO4",22);
ROJO4._x=-933
ROJO4._y=83.5
ROJO4._xscale=13
ROJO4._yscale=13
ROJO4.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("AZUL","AZUL4",23);
AZUL4._x=-900
AZUL4._y=83.5
AZUL4._xscale=13
AZUL4._yscale=13
AZUL4.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("ROJO","ROJO5",24);
ROJO5._x=-866.5
ROJO5._y=83.5
ROJO5._xscale=13
ROJO5._yscale=13
ROJO5.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("AZUL","AZUL5",25);
AZUL5._x=442
AZUL5._y=17
AZUL5._xscale=13
AZUL5._yscale=13
AZUL5.onRollOver=function(){
this._parent.attachMovie("CONTACTAME","CONTACTAME",97);
CONTACTAME._x=670
CONTACTAME._y=390
new Tween(CONTACTAME,"_xscale",Elastic.easeOut,0,100,9,true);
new Tween(CONTACTAME,"_yscale",Elastic.easeOut,0,100,9,true);
}
AZUL5.onRollOut=function(){
new Tween(CONTACTAME,"_xscale",Strong.easeOut,100,0,1,true);
var aux:Tween=new Tween(CONTACTAME,"_yscale",Strong.easeOut,100,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
AZUL5.onReleaseOutside=function(){
removeMovieClip(this._parent.CONTACTAME);
}
AZUL5.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
this.onEnterFrame = function(){
OJOD._x += (_xmouse-OJOD._x) * 0.08;
OJOD._y += (_ymouse-OJOD._y) * 0.08;
}

}
this.attachMovie("ROJO","ROJO6",26);
ROJO6._x=475
ROJO6._y=17
ROJO6._xscale=13
ROJO6._yscale=13
ROJO6.onRollOver=function(){
this._parent.attachMovie("JIMMYTHECLOWN","JIMMYTHECLOWN",98);
JIMMYTHECLOWN._x=475
JIMMYTHECLOWN._y=265
new Tween(JIMMYTHECLOWN,"_xscale",Elastic.easeOut,0,95,9,true);
new Tween(JIMMYTHECLOWN,"_yscale",Elastic.easeOut,0,95,9,true);
}
ROJO6.onRollOut=function(){
new Tween(JIMMYTHECLOWN,"_xscale",Strong.easeOut,95,0,1,true);
var aux:Tween=new Tween(JIMMYTHECLOWN,"_yscale",Strong.easeOut,95,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
ROJO6.onReleaseOutside=function(){
removeMovieClip(this._parent.JIMMYTHECLOWN);
}
ROJO6.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,95,0,9,true);
}
this.attachMovie("AZUL","AZUL6",27);
AZUL6._x=508.5
AZUL6._y=17
AZUL6._xscale=13
AZUL6._yscale=13
AZUL6.onRollOver=function(){
this._parent.attachMovie("SOY","SOY",99);
SOY._x=280
SOY._y=390
new Tween(SOY,"_xscale",Elastic.easeOut,0,100,9,true);
new Tween(SOY,"_yscale",Elastic.easeOut,0,100,9,true);
}
AZUL6.onRollOut=function(){
new Tween(SOY,"_xscale",Strong.easeOut,100,0,1,true);
var aux:Tween=new Tween(SOY,"_yscale",Strong.easeOut,100,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
AZUL6.onReleaseOutside=function(){
removeMovieClip(this._parent.SOY);
}
AZUL6.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
}
this.attachMovie("ROJO","ROJO7",28);
ROJO7._x=442
ROJO7._y=50
ROJO7._xscale=13
ROJO7._yscale=13
ROJO7.onRollOver=function(){
this._parent.attachMovie("NIBELUNGO","NIBELUNGO",100);
NIBELUNGO._x=658
NIBELUNGO._y=150
new Tween(NIBELUNGO,"_xscale",Elastic.easeOut,0,100,9,true);
new Tween(NIBELUNGO,"_yscale",Elastic.easeOut,0,100,9,true);
}
ROJO7.onRollOut=function(){
new Tween(NIBELUNGO,"_xscale",Strong.easeOut,100,0,1,true);
var aux:Tween=new Tween(NIBELUNGO,"_yscale",Strong.easeOut,100,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
ROJO7.onReleaseOutside=function(){
removeMovieClip(this._parent.NIBELUNGO);
}
ROJO7.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("AZUL","AZUL7",29);
AZUL7._x=475
AZUL7._y=50
AZUL7._xscale=13
AZUL7._yscale=13
AZUL7.onRollOver=function(){
this._parent.attachMovie("FOTOGRAFIAS","FOTOGRAFIAS",101);
FOTOGRAFIAS._x=475
FOTOGRAFIAS._y=250
new Tween(FOTOGRAFIAS,"_xscale",Elastic.easeOut,0,100,9,true);
new Tween(FOTOGRAFIAS,"_yscale",Elastic.easeOut,0,100,9,true);
}
AZUL7.onRollOut=function(){
new Tween(FOTOGRAFIAS,"_xscale",Strong.easeOut,100,0,1,true);
var aux:Tween=new Tween(FOTOGRAFIAS,"_yscale",Strong.easeOut,100,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
AZUL7.onReleaseOutside=function(){
removeMovieClip(this._parent.FOTOGRAFIAS);
}
AZUL7.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("ROJO","ROJO8",30);
ROJO8._x=508.5
ROJO8._y=50
ROJO8._xscale=13
ROJO8._yscale=13
ROJO8.onRollOver=function(){
this._parent.attachMovie("SHOW","SHOW",102);
SHOW._x=292
SHOW._y=150
new Tween(SHOW,"_xscale",Elastic.easeOut,0,100,9,true);
new Tween(SHOW,"_yscale",Elastic.easeOut,0,100,9,true);
}
ROJO8.onRollOut=function(){
new Tween(SHOW,"_xscale",Strong.easeOut,100,0,1,true);
var aux:Tween=new Tween(SHOW,"_yscale",Strong.easeOut,100,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
ROJO8.onReleaseOutside=function(){
removeMovieClip(this._parent.SHOW);
}
ROJO8.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("AZUL","AZUL8",31);
AZUL8._x=442
AZUL8._y=83.5
AZUL8._xscale=13
AZUL8._yscale=13
AZUL8.onRollOver=function(){
this._parent.attachMovie("FAMILIA","FAMILIA",103);
FAMILIA._x=720
FAMILIA._y=300
new Tween(FAMILIA,"_xscale",Elastic.easeOut,0,100,9,true);
new Tween(FAMILIA,"_yscale",Elastic.easeOut,0,100,9,true);
}
AZUL8.onRollOut=function(){
new Tween(FAMILIA,"_xscale",Strong.easeOut,100,0,1,true);
var aux:Tween=new Tween(FAMILIA,"_yscale",Strong.easeOut,100,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
AZUL8.onReleaseOutside=function(){
removeMovieClip(this._parent.FAMILIA);
}
AZUL8.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("ROJO","ROJO9",32);
ROJO9._x=475
ROJO9._y=83.5
ROJO9._xscale=13
ROJO9._yscale=13
ROJO9.onRollOver=function(){
this._parent.attachMovie("FE","FE",104);
FE._x=475
FE._y=265
new Tween(FE,"_xscale",Elastic.easeOut,0,95,9,true);
new Tween(FE,"_yscale",Elastic.easeOut,0,95,9,true);
}
ROJO9.onRollOut=function(){
new Tween(FE,"_xscale",Strong.easeOut,95,0,1,true);
var aux:Tween=new Tween(FE,"_yscale",Strong.easeOut,95,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
ROJO9.onReleaseOutside=function(){
removeMovieClip(this._parent.FE);
}
ROJO9.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("AZUL","AZUL9",33);
AZUL9._x=508.5
AZUL9._y=83.5
AZUL9._xscale=13
AZUL9._yscale=13
AZUL9.onRollOver=function(){
this._parent.attachMovie("CAPACIDADES","CAPACIDADES",105);
CAPACIDADES._x=230
CAPACIDADES._y=300
new Tween(CAPACIDADES,"_xscale",Elastic.easeOut,0,100,9,true);
new Tween(CAPACIDADES,"_yscale",Elastic.easeOut,0,100,9,true);
}
AZUL9.onRollOut=function(){
new Tween(CAPACIDADES,"_xscale",Strong.easeOut,100,0,1,true);
var aux:Tween=new Tween(CAPACIDADES,"_yscale",Strong.easeOut,100,0,1,true);
aux.onMotionFinished=function(Void):Void{
this.obj.removeMovieClip();
}
}
AZUL9.onReleaseOutside=function(){
removeMovieClip(this._parent.CAPACIDADES);
}
AZUL9.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("ROJO","ROJO10",34);
ROJO10._x=1816
ROJO10._y=17
ROJO10._xscale=13
ROJO10._yscale=13
ROJO10.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
}
this.attachMovie("AZUL","AZUL10",35);
AZUL10._x=1849
AZUL10._y=17
AZUL10._xscale=13
AZUL10._yscale=13
AZUL10.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
}
this.attachMovie("ROJO","ROJO11",36);
ROJO11._x=1882.5
ROJO11._y=17
ROJO11._xscale=13
ROJO11._yscale=13
ROJO11.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-1045,-950,9,true);
}
this.attachMovie("AZUL","AZUL11",37);
AZUL11._x=1816
AZUL11._y=50
AZUL11._xscale=13
AZUL11._yscale=13
AZUL11.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("ROJO","ROJO12",38);
ROJO12._x=1849
ROJO12._y=50
ROJO12._xscale=13
ROJO12._yscale=13
ROJO12.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("AZUL","AZUL12",39);
AZUL12._x=1882.5
AZUL12._y=50
AZUL12._xscale=13
AZUL12._yscale=13
AZUL12.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,0,-600,9,true);
}
this.attachMovie("ROJO","ROJO13",40);
ROJO13._x=1816
ROJO13._y=83.5
ROJO13._xscale=13
ROJO13._yscale=13
ROJO13.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("AZUL","AZUL13",41);
AZUL13._x=1849
AZUL13._y=83.5
AZUL13._xscale=13
AZUL13._yscale=13
AZUL13.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("ROJO","ROJO14",42);
ROJO14._x=1882.5
ROJO14._y=83.5
ROJO14._xscale=13
ROJO14._yscale=13
ROJO14.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,0,-1200,9,true);
}
this.attachMovie("AZUL","AZUL14",43);
AZUL14._x=-933
AZUL14._y=867
AZUL14._xscale=13
AZUL14._yscale=13
AZUL14.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("ROJO","ROJO15",44);
ROJO15._x=-900
ROJO15._y=867
ROJO15._xscale=13
ROJO15._yscale=13
ROJO15.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("AZUL","AZUL15",45);
AZUL15._x=-866.5
AZUL15._y=867
AZUL15._xscale=13
AZUL15._yscale=13
AZUL15.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("ROJO","ROJO16",46);
ROJO16._x=-933
ROJO16._y=900
ROJO16._xscale=13
ROJO16._yscale=13
ROJO16.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,1045,950,9,true);
}
this.attachMovie("AZUL","AZUL16",47);
AZUL16._x=-900
AZUL16._y=900
AZUL16._xscale=13
AZUL16._yscale=13
AZUL16.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
}
this.attachMovie("ROJO","ROJO17",48);
ROJO17._x=-866.5
ROJO17._y=900
ROJO17._xscale=13
ROJO17._yscale=13
ROJO17.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
}
this.attachMovie("AZUL","AZUL17",49);
AZUL17._x=-933
AZUL17._y=933.5
AZUL17._xscale=13
AZUL17._yscale=13
AZUL17.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("ROJO","ROJO18",50);
ROJO18._x=-900
ROJO18._y=933.5
ROJO18._xscale=13
ROJO18._yscale=13
ROJO18.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("AZUL","AZUL18",51);
AZUL18._x=-866.5
AZUL18._y=933.5
AZUL18._xscale=13
AZUL18._yscale=13
AZUL18.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("ROJO","ROJO19",52);
ROJO19._x=442
ROJO19._y=617
ROJO19._xscale=13
ROJO19._yscale=13
ROJO19.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("AZUL","AZUL19",53);
AZUL19._x=475
AZUL19._y=617
AZUL19._xscale=13
AZUL19._yscale=13
AZUL19.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("ROJO","ROJO20",54);
ROJO20._x=508.5
ROJO20._y=617
ROJO20._xscale=13
ROJO20._yscale=13
ROJO20.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("AZUL","AZUL20",55);
AZUL20._x=442
AZUL20._y=650
AZUL20._xscale=13
AZUL20._yscale=13
AZUL20.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
}
this.attachMovie("ROJO","ROJO21",56);
ROJO21._x=475
ROJO21._y=650
ROJO21._xscale=13
ROJO21._yscale=13
ROJO21.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-505,-600,9,true);
}
this.attachMovie("AZUL","AZUL21",57);
AZUL21._x=508.5
AZUL21._y=650
AZUL21._xscale=13
AZUL21._yscale=13
AZUL21.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
}
this.attachMovie("ROJO","ROJO22",58);
ROJO22._x=442
ROJO22._y=683.5
ROJO22._xscale=13
ROJO22._yscale=13
ROJO22.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("AZUL","AZUL22",59);
AZUL22._x=475
AZUL22._y=683.5
AZUL22._xscale=13
AZUL22._yscale=13
AZUL22.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("ROJO","ROJO23",60);
ROJO23._x=508.5
ROJO23._y=683.5
ROJO23._xscale=13
ROJO23._yscale=13
ROJO23.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("AZUL","AZUL23",61);
AZUL23._x=1816
AZUL23._y=867
AZUL23._xscale=13
AZUL23._yscale=13
AZUL23.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("ROJO","ROJO24",62);
ROJO24._x=1849
ROJO24._y=867
ROJO24._xscale=13
ROJO24._yscale=13
ROJO24.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("AZUL","AZUL24",63);
AZUL24._x=1882.5
AZUL24._y=867
AZUL24._xscale=13
AZUL24._yscale=13
AZUL24.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-600,0,9,true);
}
this.attachMovie("ROJO","ROJO25",64);
ROJO25._x=1816
ROJO25._y=900
ROJO25._xscale=13
ROJO25._yscale=13
ROJO25.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
}
this.attachMovie("AZUL","AZUL25",65);
AZUL25._x=1849
AZUL25._y=900
AZUL25._xscale=13
AZUL25._yscale=13
AZUL25.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
}
this.attachMovie("ROJO","ROJO26",66);
ROJO26._x=1882.5
ROJO26._y=900
ROJO26._xscale=13
ROJO26._yscale=13
ROJO26.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-1045,-950,9,true);
}
this.attachMovie("AZUL","AZUL26",67);
AZUL26._x=1816
AZUL26._y=933.5
AZUL26._xscale=13
AZUL26._yscale=13
AZUL26.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("ROJO","ROJO27",68);
ROJO27._x=1849
ROJO27._y=933.5
ROJO27._xscale=13
ROJO27._yscale=13
ROJO27.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("AZUL","AZUL27",69);
AZUL27._x=1882.5
AZUL27._y=933.5
AZUL27._xscale=13
AZUL27._yscale=13
AZUL27.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-600,-1200,9,true);
}
this.attachMovie("ROJO","ROJO28",70);
ROJO28._x=-933
ROJO28._y=1716
ROJO28._xscale=13
ROJO28._yscale=13
ROJO28.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("AZUL","AZUL28",71);
AZUL28._x=-900
AZUL28._y=1716
AZUL28._xscale=13
AZUL28._yscale=13
AZUL28.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("ROJO","ROJO29",72);
ROJO29._x=-866.5
ROJO29._y=1716
ROJO29._xscale=13
ROJO29._yscale=13
ROJO29.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("AZUL","AZUL29",73);
AZUL29._x=-933
AZUL29._y=1749
AZUL29._xscale=13
AZUL29._yscale=13
AZUL29.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("ROJO","ROJO30",74);
ROJO30._x=-900
ROJO30._y=1749
ROJO30._xscale=13
ROJO30._yscale=13
ROJO30.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("AZUL","AZUL30",75);
AZUL30._x=-866.5
AZUL30._y=1749
AZUL30._xscale=13
AZUL30._yscale=13
AZUL30.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("ROJO","ROJO31",76);
ROJO31._x=-933
ROJO31._y=1782.5
ROJO31._xscale=13
ROJO31._yscale=13
ROJO31.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,1045,950,9,true);
}
this.attachMovie("AZUL","AZUL31",77);
AZUL31._x=-900
AZUL31._y=1782.5
AZUL31._xscale=13
AZUL31._yscale=13
AZUL31.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,0,9,true);
}
this.attachMovie("ROJO","ROJO32",78);
ROJO32._x=-866.5
ROJO32._y=1782.5
ROJO32._xscale=13
ROJO32._yscale=13
ROJO32.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,950,-950,9,true);
}
this.attachMovie("AZUL","AZUL32",79);
AZUL32._x=442
AZUL32._y=1716
AZUL32._xscale=13
AZUL32._yscale=13
AZUL32.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("ROJO","ROJO33",80);
ROJO33._x=475
ROJO33._y=1716
ROJO33._xscale=13
ROJO33._yscale=13
ROJO33.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("AZUL","AZUL33",81);
AZUL33._x=508.5
AZUL33._y=1716
AZUL33._xscale=13
AZUL33._yscale=13
AZUL33.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("ROJO","ROJO34",82);
ROJO34._x=442
ROJO34._y=1749
ROJO34._xscale=13
ROJO34._yscale=13
ROJO34.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("AZUL","AZUL34",83);
AZUL34._x=475
AZUL34._y=1749
AZUL34._xscale=13
AZUL34._yscale=13
AZUL34.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("ROJO","ROJO35",84);
ROJO35._x=508.5
ROJO35._y=1749
ROJO35._xscale=13
ROJO35._yscale=13
ROJO35.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("AZUL","AZUL35",85);
AZUL35._x=442
AZUL35._y=1782.5
AZUL35._xscale=13
AZUL35._yscale=13
AZUL35.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,950,9,true);
}
this.attachMovie("ROJO","ROJO36",86);
ROJO36._x=475
ROJO36._y=1782.5
ROJO36._xscale=13
ROJO36._yscale=13
ROJO36.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-1295,-1200,9,true);
}
this.attachMovie("AZUL","AZUL36",87);
AZUL36._x=508.5
AZUL36._y=1782.5
AZUL36._xscale=13
AZUL36._yscale=13
AZUL36.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,0,-950,9,true);
}
this.attachMovie("ROJO","ROJO37",88);
ROJO37._x=1816
ROJO37._y=1716
ROJO37._xscale=13
ROJO37._yscale=13
ROJO37.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("AZUL","AZUL37",89);
AZUL37._x=1849
AZUL37._y=1716
AZUL37._xscale=13
AZUL37._yscale=13
AZUL37.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("ROJO","ROJO38",90);
ROJO38._x=1882.5
ROJO38._y=1716
ROJO38._xscale=13
ROJO38._yscale=13
ROJO38.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-1200,0,9,true);
}
this.attachMovie("AZUL","AZUL38",91);
AZUL38._x=1816
AZUL38._y=1749
AZUL38._xscale=13
AZUL38._yscale=13
AZUL38.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("ROJO","ROJO39",92);
ROJO39._x=1849
ROJO39._y=1749
ROJO39._xscale=13
ROJO39._yscale=13
ROJO39.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("AZUL","AZUL39",93);
AZUL39._x=1882.5
AZUL39._y=1749
AZUL39._xscale=13
AZUL39._yscale=13
AZUL39.onRelease=function(){
new Tween(_root,"_y",Elastic.easeOut,-1200,-600,9,true);
}
this.attachMovie("ROJO","ROJO40",94);
ROJO40._x=1816
ROJO40._y=1782.5
ROJO40._xscale=13
ROJO40._yscale=13
ROJO40.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,950,9,true);
}
this.attachMovie("AZUL","AZUL40",95);
AZUL40._x=1849
AZUL40._y=1782.5
AZUL40._xscale=13
AZUL40._yscale=13
AZUL40.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-950,0,9,true);
}
this.attachMovie("ROJO","ROJO41",96);
ROJO41._x=1882.5
ROJO41._y=1782.5
ROJO41._xscale=13
ROJO41._yscale=13
ROJO41.onRelease=function(){
new Tween(_root,"_x",Elastic.easeOut,-1045,-950,9,true);
}

Por JIMMYTHECLOWN

25 de clabLevel



 

MÉXICO

msie
Citar            
MensajeEscrito el 28 Ene 2009 10:04 pm
:shock: ke lisssstaaaaaa.. jaja, no se como lo haras, pero puede hacer algo asi...

Código :

function mueve_ojo(){
   this.onEnterFrame = function(){
      OJOD._x += (_xmouse-OJOD._x) * 0.08;
      OJOD._y += (_ymouse-OJOD._y) * 0.08;
   }
}

ese codigo lo pones afuera del boton, y luego en el boton ke kieres ke ejecute esta funcion pones lo siguinte..

Código :

tu_boton.onRelease=function(){
   mueve_ojo();
}

de esa manera deberia funcionar.
Saludos!!

Por fabri_bit

36 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 Ene 2009 11:35 pm
oh wow!
eso se llama paciencia! :D
solo una cosita, para hacer tu codigo mas pequenio podes usar en vez de:

Código :

this.attachMovie("BOCÓN","BOCÓN",3);
BOCÓN._x=475
BOCÓN._y=479
BOCÓN._xscale=133
BOCÓN._yscale=133

algo como:

Código :

this.attachMovie("BOCÓN", "BOCÓN", 3, {_x:475, _y:479, _xscale:133, _yscale:133});


salut!

Por Acreonte

Claber

1543 de clabLevel

5 tutoriales
6 articulos

Genero:Masculino  

Digital Scientist

firefox
Citar            
MensajeEscrito el 28 Ene 2009 11:42 pm
y si el boton lo puse con attachMovie como lo muestro en el codigo?

Por JIMMYTHECLOWN

25 de clabLevel



 

MÉXICO

msie
Citar            
MensajeEscrito el 28 Ene 2009 11:53 pm
cuando pones algo con attachMovie la instancia se crea, despues de eso ya podes darle acciones a dicha instancia.
Entonces seria algo como:

Código :

function mueve_ojo() : Void
{
   this.onEnterFrame = function() : Void
   {
      OJOD._x += (_xmouse - OJOD._x) * 0.08;
      OJOD._y += (_ymouse - OJOD._y) * 0.08;
   }
}

AZUL5.onRelease = function() : Void
{
   new Tween(_parent, "_x", Elastic.easeOut, 0, 950, 9, true);
   _parent.mueve_ojo();
}

trata de no usar _root, es mejor usar _parent (tantas veces como sea necesario hasta llegar al nivel que necesitas).
por cierto, un par de for loops le harian mucho bien a tu codigo (para simplificarlo)

Por Acreonte

Claber

1543 de clabLevel

5 tutoriales
6 articulos

Genero:Masculino  

Digital Scientist

firefox
Citar            
MensajeEscrito el 29 Ene 2009 12:08 am
disculpa, para que sirve el void, quisiera q alguien revisara mi sitio

Por JIMMYTHECLOWN

25 de clabLevel



 

MÉXICO

msie
Citar            
MensajeEscrito el 29 Ene 2009 10:27 am
el void es parte de AS2 y especifica lo que la funcion "regresa".
Es un poco confuso al principio y la verdad a mi no me gusta la teoria asi que te pondre un par de ejemplos:

Código :

function obtenerNombre() : String
{
return "Jimmy";
}

en este caso la funcion "regresa" un string.
veamos otro ejemplo:

Código :

function obtenerSumatoria( a : Number, b : Number ) : Number
{
return a + b;
}

// Llamando a la funcion
trace(obtenerSumatoria( 3 + 5 ));
// la ventana de salida nos muestra 8.

En este caso la function regresa un numero.

El void:

Código :

function trazarMensaje( mensaje : String ) : Void
{
trace( "Este es mi mensaje: " + mensaje );
}

como no estamos utilizando la palabra "return" entonces esta funcion no regresa nada, simplemente ejecuta una accion, en este caso en ActionScript 2 agregamos la palabra Void que nos dice (y le dice a flash) que la funcion no regresa nada.

espero se entienda :)

Por Acreonte

Claber

1543 de clabLevel

5 tutoriales
6 articulos

Genero:Masculino  

Digital Scientist

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.