Results 1 to 3 of 3
Thread: A Tweener working wrong
-
May 8th, 2012, 02:33 PM #1115Registered User
postsA Tweener working wrong
I am doing a image gallery in as3 and i want to when i load the full_image through xml it creates a small animation that comes small from the center of the screen to full screen, but it always pop-up in the upper corner of the screen. Is there anything wrong i'm doing in the code?
Code:function fullLoaded(e:Event):void{ var my_loader:Loader = Loader(e.target.loader); addChild(my_loader); my_loader.x = (stage.stageWidth - my_loader.width)/2; my_loader.y =(stage.stageHeight - my_loader.height)/2; my_loader.width = my_loader.width/2; my_loader.height = my_loader.height/2; Tweener.addTween(my_loader,{width: my_loader.width*2, height: my_loader.height*2, time:1,transition:"easeOutSine"}); my_loader.addEventListener(MouseEvent.CLICK,removeFull); }
-
May 8th, 2012, 02:57 PM #2218Carebear
postsi think you should w8 the loader to finish loading before positioning it on the stage
and why:
imo it is better to use scaleX and scaleY insteadCode:my_loader.width = my_loader.width/2; my_loader.height = my_loader.height/2;
Code:my_loader.scaleX = 0.5; my_loader.scaleY = 0.5;
-
May 9th, 2012, 12:12 PM #3115Registered User
posts

Reply With Quote


Bookmarks