Hi everyone,
I’ve been trying to use a numerical for loop as a simple generator to trigger a few “flashes” to appear randomly on the screen, but the function only triggers the flash once (instead of three times).
Here’s the message I get in the simulator console is…
"2015-04-19 11:27:16.306 Corona Simulator[29208:507] WARNING: Cannot set y-scale property of display object to zero.
2015-04-19 11:27:16.306 Corona Simulator[29208:507] WARNING: Cannot set x-scale property of display object to zero."
I gather that the console warning is referring to something not directly related to the for loop, but I can’t figure out what I’m doing wrong here.
local function randomFlashes() for i = 1, 3 do display.remove(whiteFlash) local randomPosition = (math.random(1200)) whiteFlash = display.newImage("interface-elements/white-flash.png") whiteFlash.x = randomPosition whiteFlash.y = randomPosition whiteFlash:scale(0,0) whiteFlash.alpha = 0 transition.to(whiteFlash, {time=200, xScale=1, yScale=1, alpha=1}) transition.to(whiteFlash, {delay=200, time=200, xScale=0, yScale=0, alpha=0}) end end