12/29/2009 11:37:20 PM
Title:
zoom effect
hi.. i have problem in zoom effect... i m having lot of buttons for menu like flower means rose lily etc and i was load varieties in rose using xml... i followed above concept for all flowers loading... and i was applied zoom effect for xml loaded panel..the panel was moved each clicking of button while its zooming...if i continuously click all the button means the panel gone somewhere..how to solve this problem...
var zoom_eff:Zoom=newZoom();
zoom_eff.zoomHeightFrom=0;
zoom_eff.zoomWidthFrom=0;
zoom_eff.zoomHeightTo=1;
zoom_eff.zoomWidthTo=1;
zoom_eff.target=itemView;
zoom_eff.duration=500;
zoom_eff.play();
i used this code for zoom panel of items...
12/29/2009 11:58:43 PM
use
zoom_eff.stop();
before you play the effect. So that it does not play in multiple instances.
12/30/2009 12:31:27 AM
where ever i add stop when i click button its moved position and went somewhere can u please give some sample code.......
12/30/2009 1:35:33 AM
Like this just add before you play
var zoom_eff:Zoom=newZoom();
zoom_eff.zoomHeightFrom=0;
zoom_eff.zoomWidthFrom=0;
zoom_eff.zoomHeightTo=1;
zoom_eff.zoomWidthTo=1;
zoom_eff.target=itemView;
zoom_eff.duration=500;
zoom_eff.stop();
zoom_eff.play();
12/30/2009 1:40:40 AM
one more thing , declare the var zoom_eff out side the function like this so that the when clicking fast the previous zoom can be referred and stopped before playing the new one
//Declare this var outside function
private var zoom_eff:Zoom= new Zoom();
private function addZoomOutEffect():void{
zoom_eff.zoomHeightFrom=0;
zoom_eff.zoomWidthFrom=0;
zoom_eff.zoomHeightTo=1;
zoom_eff.zoomWidthTo=1;
zoom_eff.target=itemView;
zoom_eff.duration=500;
zoom_eff.stop();
zoom_eff.play();
}
12/30/2009 1:57:16 AM
thanks Chirloki ...its working....