PDA

View Full Version : Xscalefunction AS3



Azimut
February 14th, 2008, 02:56 PM
Hi!

Im getting started with AS3 and id like to tween a scale property from a Movieclip called "bluebar"

This is my code


import fl.transitions.*;
import fl.transitions.easing.*;
var largeur:uint = stage.stageWidth;
var hauteur:uint = stage.stageHeight;
var barrebleu:bluebar = new bluebar();
barrebleu.y = hauteur/2;
barrebleu.x = -500;
barrebleu.scaleX = 1;
barrebleu.scaleY = 1;
addChild(barrebleu)

new Tween(barrebleu, "_yscale", Strong.easeOut, barrebleu._yscale, 400,25);

This code doesnt work... seems to be in AS2


But this code work but it is not fluid

new Tween(barrebleu, "height", Strong.easeOut, barrebleu.height, 400,25);

someone would have the answer please! :)

Thanks

excogitator
February 15th, 2008, 11:03 AM
In AS3 you would have a movieclip in library exported for actionscript with name bluebar and then use the following code. You will have to play around with the tween variables to match your requirements. _yscale has been substituted by scaleY in AS3.

import fl.transitions.*;
import fl.transitions.easing.*;
var largeur:uint = stage.stageWidth;
var hauteur:uint = stage.stageHeight;
var barrebleu:bluebar = new bluebar();
barrebleu.y = 100;
barrebleu.x = 100;
barrebleu.scaleX = 1;
barrebleu.scaleY = 1;
addChild(barrebleu)

new Tween(barrebleu, "scaleY", Strong.easeOut, 1, 5,45);

====================
Hope this helps