Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/07/2007, 11:19
Rizzo
 
Fecha de Ingreso: septiembre-2006
Mensajes: 1.193
Antigüedad: 17 años, 6 meses
Puntos: 30
Re: Palabras deslizantes

se puede haz esto:
1.- crea un escenario con las medidas 300 px X 300 px
2.- crea un mc de 50 ancho "W" X 100 alto "H".
3.- ahora dentro de el en una capa nueva (capa 2) pones un campo de texto dinamico y lo nombras texto como nombre de instancia.
4.- estando ahi dentro de ese mc que creaste , crea una capa nueva (capa 3)y pones esto:


Código:
this.onRelease=function(){
	// set scale target for the movie
	if (scaledUp ne 1) {
		scaleTarget = this._xscale*3;
		scaledUp = 1;
	} else if (scaledUp == 1) {
		scaleTarget = initialScale;
		scaledUp = 0;
	}
	for (var i = 0; i<_root.numberOfOptions; i++) {
		if (_root["option"+i] ne this) { 
			_root["option"+i].scaledUp = 0;
			_root["option"+i].scaleTarget = _root["option"+i].initialScale;
		}
	}
}
ok ahora ve al escenario principal y selecciona ese mc que creaste ve a la ventana de acciones y escribe esto:

Código:
onClipEvent (load) {
	this.texto.text="holamundo"
	// first assign an initial scale value
	initialScale = int(Math.random()*50)+75;
	this._xscale = initialScale;
	this._yscale = initialScale;
	scaleInterval = 3;
}

onClipEvent (enterFrame) {

	// the movement modifier for the scale
	modifier = this._xscale/100;

	// then the option is moved
	this._x+=(_root.distance/50)*modifier;

	// check to make sure the movie clip doesn't go on forever
	if (this._x > 375) {
		this._x = -75;
	} else if (this._x <-75) {
		this._x = 375;
	}

	// check for scale target
	if (scaledUp == 1 && this._xscale<=scaleTarget) {
		this._xscale += scaleInterval;
		this._yscale += scaleInterval;
	} else if (scaledUp == 0 && this._xscale>=scaleTarget) {
		this._xscale -= scaleInterval;
		this._yscale -= scaleInterval;
	}

}
ok ahora en la parte que esta azul en el codigo que te acabo de poner ahi pones el texto que quieras de tu boton.

por ultimo en el escenario principal en una capa nueva pones esto:


Código:
this.onEnterFrame=function() {
	// calculate distance for whole movie (offset from center of movie)
	_root.distance = 150-_root._xmouse;
}
y ya solo duplica los botones del escenario y cambia el texto que te puse en azul.

Última edición por Rizzo; 06/07/2007 a las 11:20 Razón: error sintaxis