Need to scale an image on a collision. Please, help!!

Hi

I assume the question is fairly simple but I can’t put all the information available to a working code =\

I have a circle that is moving between two walls. I need it to change it’s direction (just circle.xScale = -1) when it hit’s a wall.
I tried smth like that but doesn’t work =\ - changes the direction without any collisions.
local function onLocalCollisionone( self, event )
self.xScale = -1
end

circle.collision = onLocalCollisionone
circle:addEventListener( “collision”, circle )

thanks [import]uid: 40662 topic_id: 9554 reply_id: 309554[/import]

Sorry for the topic, just made it work. For those who may in future experience the same problem here is the code that worked for me.
local function onLocalCollision( self, event )
circle.xScale = -1
end

rightWall.collision = onLocalCollision;
rightWall:addEventListener(“collision”, rightWall);

local function onLocalCollision_one( self, event )
circle.xScale = 1
end

leftWall.collision = onLocalCollision_one;
leftWall:addEventListener(“collision”, leftWall); [import]uid: 40662 topic_id: 9554 reply_id: 34883[/import]