vibrating display objects

Hey
How do i vibrate a display object like it has got a shock…it should vibrate when it collides
And anyone having sprite sheet in which ball disperses…i have a ball and when the ball collides, it should disperse into small pieces.
Thanks

Perhaps something like this:

local r = display.newRect( display.contentCenterX, display.contentCenterY, 50, 50 ) local origX = r.x local origY = r.y for i = 1, 10 do      transition.to( r, { delay = ( i - 1 ) \* 50, time = 50, delta = true, x = math.random(-5, 5), y = math.random(-5, 5), onComplete=function(target) target.x = origX; target.y = origY; end } ) end

Thank you much rob sir

Helping me in every aspect :D 

https://forums.coronalabs.com/topic/62078-best-way-to-detect-an-object-being-shake-while-touched/

Perhaps something like this:

local r = display.newRect( display.contentCenterX, display.contentCenterY, 50, 50 ) local origX = r.x local origY = r.y for i = 1, 10 do      transition.to( r, { delay = ( i - 1 ) \* 50, time = 50, delta = true, x = math.random(-5, 5), y = math.random(-5, 5), onComplete=function(target) target.x = origX; target.y = origY; end } ) end

Thank you much rob sir

Helping me in every aspect :D 

https://forums.coronalabs.com/topic/62078-best-way-to-detect-an-object-being-shake-while-touched/