Stopping function (rule) problem

Hi, I'm trying to solve this problem for a long time, but with no success :(

I'm using director class..
I've got piece of code :

1
2
3
4
5
6
7
8
9
10
local function wrap (event)
                if  cloud01.x < -10 then
                        cloud01.x = 520
                end
                
                if cloud01.x > 520 then
                        cloud01.x = -10
                end
end
Runtime:addEventListener( "enterFrame", wrap )
views:1447 update:2011/10/5 21:23:48
corona forums © 2003-2011