Comunidad de diseño web y desarrollo en internet online

Problemas con Tween en AS3

Citar            
MensajeEscrito el 21 Sep 2007 06:45 am
Hola como estan, bueno tengo un problema que quizas les halla pasado.. bueno en AS2 yo estaba acostumbrado a usar las clases "Movieclip tweening prototypes 1.2.0" http://laco.wz.cz/tween/?page=download
por ejemplo:

Código :

#include "lmc_tween.as"
mi_mc.tween("_y",77.8, 5, "easeoutElastic");

Ahora bien como en AS3 no se pueden usar tengo que usar si o si las que vienen en el Flash :crap:
el problema esta que a veses las animaciones se paran!!! :twisted:
y no existe nincun conflicto miren:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var fondobSX:Tween = new Tween(fondob, "scaleX", Strong.easeOut, fondob.scaleX, 1, 0.5, true);
var fondobSY:Tween = new Tween(fondob, "scaleY", Strong.easeOut, fondob.scaleY, 1, 0.5, true);

donde fondob es mi movieClip.. pero a veses no hace alguna de las dos.. solo a veses.. que puede ser??...
Alguno sabe si ya esta las clases de Zigo para AS3?? ^^ [/url]

Por phoxer

Claber

827 de clabLevel

4 tutoriales

Genero:Masculino  

Ing en Sistemas

firefox
Citar            
MensajeEscrito el 21 Sep 2007 08:17 pm

Código :

import fl.transitions.*;


import fl.transitions.easing.*;
var fondobSX:Tween = new Tween(fondob, "scaleX", Strong.easeOut, fondob.scaleX, 2, 0.5, true);
var fondobSY:Tween = new Tween(fondob, "scaleY", Strong.easeOut, fondob.scaleY, 2, 0.5, true);


te falta

import fl.transitions.*;


y no te funciona por que no hace nada poniendole 1 como escala es como si le dijeras que se moviera a la coordenada x=200 cuando tu fondo esta en x=200 no haria nada cambiaselo por dos u otro.

Por DiegoAzul

376 de clabLevel



 

Mx

firefox
Citar            
MensajeEscrito el 21 Sep 2007 08:31 pm
gracias.. pero el
import fl.transitions.*; me falto porque no lo copie jejeje :P pero si lo tengo.. ya descubri cual es el error.. la cosa que en mi pagina tengo un Tween para agrandar un panel y un boton tambien con un
Tween de alpha.. y hacen conflicto :twisted: .. maldicion no se puede mezclar varios tweens a la ves
porque genera conflicto.. se que no deveria y que podria ser otra cosa pero.. descubri que era eso..
gracias igualmente...

Por phoxer

Claber

827 de clabLevel

4 tutoriales

Genero:Masculino  

Ing en Sistemas

firefox
Citar            
MensajeEscrito el 21 Sep 2007 08:45 pm
Ojala ya salgan las clases de Tween de robert penner.. :cry: con el manejo simple.. porque a las de Flash le faltan muchas cosas como
-tiempo para esperar y comenzar
-funcion para llamar cuando termina
-colorTo y esas cosas.. que hacian mas faciles a las animaciones..

pero bueno.. a esperar nomas..

Por phoxer

Claber

827 de clabLevel

4 tutoriales

Genero:Masculino  

Ing en Sistemas

firefox
Citar            
MensajeEscrito el 21 Sep 2007 09:58 pm
en la referencia esta todo eso, muchas personas no saben que existe la referencia.(en la version AS2 tambien estaba)

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html?fl/transitions/Tween.html&fl/transitions/class-list.html


begin : Number = NaN
The initial value of the target object's designated property before the tween starts. Tween
constructor : Object
A reference to the class object or constructor function for a given object instance. Object
duration : Number
The duration of the tweened animation in frames or seconds. Tween
finish : Number
A number indicating the ending value of the target object property that is to be tweened. Tween
FPS : Number
The number of frames per second calculated into the tweened animation. Tween
func : Function
The easing function which is used with the tween. Tween
isPlaying : Boolean = false
Indicates whether the tween is currently playing. Tween
looping : Boolean = false
Indicates whether the tween will loop. Tween
obj : Object = null
The target object that is being tweened. Tween
position : Number
The current value of the target object property being tweened. Tween
prop : String = ""
The name of the property affected by the tween of the target object. Tween
prototype : Object
[static] A reference to the prototype object of a class or function object. Object
time : Number
The current time within the duration of the animation. Tween
useSeconds : Boolean = false
Indicates whether the tween plays over a period of frames or seconds.

Por DiegoAzul

376 de clabLevel



 

Mx

firefox
Citar            
MensajeEscrito el 22 Sep 2007 09:51 pm
Mmmmm no encuentro la parte donde le das por ejemplo 2.5 segundos para comenzar ademas tiene un error GRAVISIMO
que es que se pisan y se detienen las animaciones!!! por ejemplo:

Código :

import fl.transitions.Tween;
import fl.transitions.easing.*;
var tweenSX:Tween=new Tween(this,"scaleX",Back.easeOut,this.scaleX,1,2,true);
var tweenSY:Tween=new Tween(this,"scaleY",Back.easeOut,this.scaleY,1,2,true);
var tweenAlpha:Tween=new Tween(this,"alpha",Back.easeOut,0,1,1,true);


La cosa es que se traba :twisted: si mezclas propiedades!!!! algien sabe porque?? es una lastima!!
:cry:

Por phoxer

Claber

827 de clabLevel

4 tutoriales

Genero:Masculino  

Ing en Sistemas

firefox
Citar            
MensajeEscrito el 23 Sep 2007 02:40 am
haaa ya esta me canseeee ahunque me lleve semanas las voy a pasar a AS3 yo!!! ^^ por las dudas vallan recervandome un cerebro!!!! :P

Por phoxer

Claber

827 de clabLevel

4 tutoriales

Genero:Masculino  

Ing en Sistemas

firefox
Citar            
MensajeEscrito el 10 Ene 2008 12:59 am
Hola Phoxer, yo me he vuelto loco también por que se me paraban las animaciones utilizando Tween, incluso cuando comenzaba a moverse otro objeto en la línea de tiempo de cualquier clip. La solución es que cada vez que hagas un tween le des un nombre aleatorio diferente, aquí te pongo el ejemplo, me ha costado horas dar con esto pero al final el resultado es simple (q rabia da cuando no pulen bien las cosas):

Código :

import fl.transitions.*;
import fl.transitions.easing.*;
//------------------ Esto creará cada Tween con un nombre diferente que será un numero aleatorio entre 10000
this[Math.round(Math.random()*10000)]=new Tween(this,"scaleX",Back.easeOut,this.scaleX,1,2,true);
this[Math.round(Math.random()*10000)]=new Tween(this,"scaleY",Back.easeOut,this.scaleY,1,2,true);
this[Math.round(Math.random()*10000)]=new Tween(this,"alpha",Back.easeOut,0,1,1,true);

Espero que te funcione.

Un saludo. Atentamente: Rubén García Mateo.
By Pekao Graphics - www.pekao.es

Por Dj_Pekao

10 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 21 Ene 2008 12:25 pm

Por Whitefeet

42 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 13 Nov 2008 02:14 pm
Coincido, es mas, los tweening de laco se basan en un antiguo prototipo de Zeh, el creador de tweener.

Por xleo77

0 de clabLevel



 

firefox
Citar            
MensajeEscrito el 13 Nov 2008 02:54 pm
y... ¿por qué no inventamos la rueda? :sueno:

Por Eliseo2

710 de clabLevel



 

firefox
Citar            
MensajeEscrito el 12 Oct 2010 02:53 am
Se que ya paso mucho tiempo pero tenia el mismo problema... lo resolví declarando las variables Tween aparte...

Código ActionScript :

var sX:Tween;
var sY:Tween;
var alfa:Tween;
function desaparece(e:MouseEvent):void {
   sX = new Tween(programa_mc, "scaleX", Back.easeIn, 1, 0.1, 20, false);
   sY = new Tween(programa_mc, "scaleY", Back.easeIn, 1, 0.1, 20, false);
   alfa = new Tween(programa_mc, "alpha", None.easeNone, 1, 0, 25, false);
}

Espero le sirva a alguien ;) Saludos

Por nasho

Claber

908 de clabLevel

1 tutorial

Genero:Masculino  

Web Developer

firefox
Citar            
MensajeEscrito el 05 Nov 2010 09:18 am
Un millón de gracias!!
Llevaba un mes comiéndome el coco y probando de todo...
Ahora funciona perfectamente.
¡¡Es fantástico!! :D

Por Olga

19 de clabLevel



 

safari
Citar            
MensajeEscrito el 05 Nov 2010 07:30 pm
checa esto
http://foros.cristalab.com/base-de-datos-en-flash-sql-t91736/

Por CLAnonimo

Claber

600 de clabLevel

5 tutoriales
1 articulo

 

Este es un usuario anónimo genérico para las cuentas borradas o perdidas.

firefox

 

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