PDA

View Full Version : animate callback problem



arvindwill
26 Oct 2012, 3:27 AM
Is there any problem in performing animate inside the callback of animate. In the callback of animate if setAttributes() is coded then its working but animate is not working(thou the alert is working). What mistake im doing in the below code?


var rectangle= Ext.create('Ext.draw.Sprite',{
type:'rect',
x:150,
y:150,
height:50,
width:100,
fill:'#CFA1C5',
listeners:{
click:function(){
rectangle.animate({
to:{
width:300,
height:300,
fill:'#000'
},
duration:2000,
callback:function(){
alert(1);
rectangle.animate({
to:{
height:10,
rotate: {
degrees: 60
}
}
},true);
}
},true);
}
}
});

Tim Toady
26 Oct 2012, 7:22 AM
I usually use sequenceFx when chaining animations.


yourSprite.sequenceFx().animate().animate()


http://docs.sencha.com/ext-js/4-1/#!/api/Ext.util.Animate-method-sequenceFx