Comunidad de diseño web y desarrollo en internet online

Easing

Citar            
MensajeEscrito el 24 Oct 2008 06:16 pm
Hola estoy utilizando este código y no me funciona.
creo que es porque en actionscript 3 no es compatible con actionscript 2...
Ayudadme porfavor!
:shock:
Creo que necesito un código para el easing en actionscript 3


/* Screen Resolution Detector */
/* Coded by Carloz.Yanez on Aug 6 2008 */

/* Warning clip variable and black screen */

var warning:Warning;
var bs:Sprite = new Sprite();

/* Ignore button */

var ignore:Ignore;

/* Blur Filter */

var blurFilter:BitmapFilter = new BlurFilter(6, 6);
var filterArray:Array = new Array();
filterArray.push(blurFilter);
var noFilter:Array = new Array();

/* Added variable (Bool) to check if warning was already shown */

var added:Boolean = false;

/* Stage Scale Mode, resize handler */

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, main);

/* Scale to current size on open, center desired clips */

bg.width = stage.stageWidth;
bg.height = stage.stageHeight;

bg.x = (stage.stageWidth / 2);
bg.y = (stage.stageHeight / 2);

clab.x = (stage.stageWidth / 2);
clab.y = (stage.stageHeight / 2)

/* Main function */

function main(event:Event):void
{
/* Center Cristalab Text */

clab.x = (stage.stageWidth / 2);// - (clab.width / 2); if its registration its on the up-left
clab.y = (stage.stageHeight / 2);// - (clab.height / 2); if its registration its on the up-left

/* Center Background clip */

bg.x = (stage.stageWidth / 2);
bg.y = (stage.stageHeight / 2);

/* Scale background */

bg.width = stage.stageWidth;
bg.height = stage.stageHeight;

/* Show Warning on change, place centered */

if(!added)
{
/* Black screen */

addChild(bs);

/* Warning sign */

warning = new Warning();

warning.x = stage.stageWidth / 2;
warning.y = stage.stageHeight / 2;

addChild(warning);


/* Add Blur filter to desired elements */

clab.filters = filterArray;

/* Ignore button */

ignore = new Ignore();

ignore.x = stage.stageWidth / 2;
ignore.y = stage.stageWidth / 2 + warning.height;

addChild(ignore);

ignore.addEventListener(MouseEvent.MOUSE_DOWN, removeWarnings);

added = true;
}

/* Center on change*/

warning.x = stage.stageWidth / 2;
warning.y = stage.stageHeight / 2;

ignore.x = stage.stageWidth / 2;
ignore.y = stage.stageHeight / 2 + warning.height;

/* Scale on change */

bs.width = stage.stageWidth;
bs.height = stage.stageHeight;

/* Remove warning if stageWidth and stageHeight >= 640x480 (wanted resolution) */

if(stage.stageWidth >= 707 && stage.stageHeight >= 500 && added)
{
removeChild(warning);
removeChild(bs);
removeChild(ignore);

/* Remove Blur filter from elements */

clab.filters = noFilter;

added = false;
}
}

/* Create Black Screen */

function createBS()
{
bs.graphics.beginFill(0x000000, 0.7);
bs.graphics.drawRect(0, 0, 1, 1);
bs.graphics.endFill();
}

createBS();

/* Remove warnings function, called by Ignore button */

function removeWarnings(e:MouseEvent):void
{
removeChild(warning);
removeChild(bs);

clab.filters = noFilter;

added = false;

removeChild(ignore);
}

//Easing_introducción:

var aceleracion:Number=0.2;

//foto derecha
var posXFinal1:Number=0;

//posición inicial del MOVIECLIP derecho
clab.mc_derecho_mc._x=175;
clab.mc_derecho_mc._y=-250;


//para que la foto1 salga con easing directamente sin llamarla
fotosMueve=function(){
clab.mc_derecho_mc._x+=(posXFinal1 - clab.mc_derecho_mc._x)*aceleracion;
if(clab.mc_derecho_mc._x<=790){
clearInterval(idfotosMueve);
clab.mc_derecho_mc._x=790;
}
}
idfotosMueve= setInterval(fotosMueve,83);





//clab es un movieclip que contiene otro movieclip que es mc_derecho_mc.

Por tacteltwin

0 de clabLevel



 

safari
Citar            
MensajeEscrito el 24 Oct 2008 06:51 pm
Primero que todo, debes postear los códigos entre tags de ActionScript para que se puedan leer:

Código :

[as]
//---Códigos aquí
[/as]

Ahora veo en tu código AS3 y AS2 mezclados, esto no se puede hacer, puedes mezclar AS1 y AS2 pero con AS3 no hay mezcla posible, explica mejor donde está tu problema.

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox
Citar            
MensajeEscrito el 03 Nov 2008 05:46 pm
Yo creo que le debe saltar una gran lista de errores... jaja

Por tomasdev

220 de clabLevel

1 tutorial

 

Argentina por ahora...

firefox
Citar            
MensajeEscrito el 20 Sep 2010 10:52 pm
alguna forma de hacer esto en action 2?

Por Hamlet

40 de clabLevel



 

firefox

 

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