I’ve then tried both day1WeatherIcon:scale(.5, .5) as well as day1WeatherIcon.xScale = .5 and get an error each time.
[text]
Runtime error
…Corona Projects/My Projects/Redneck Weather/main.lua:212: attempt to index global ‘day1WeatherIcon’ (a nil value)
stack traceback:
[C]: ?
…Corona Projects/My Projects/Redneck Weather/main.lua:212: in function <…corona projects weather> [/text] Using build 767, but don’t think it’s build specific. Any ideas?
I think your 1st statement is not working. Can you set any other property (like x, y, alpha etc.)? [import]uid: 19297 topic_id: 23593 reply_id: 94606[/import]
No, I cannot. The image does display for me at (25, screenHeight-50) per my first statement. Am I doing something wrong in the first statement? [import]uid: 64538 topic_id: 23593 reply_id: 94608[/import]
According to the API docs, it’s the listener. However, I’m already inside a listener, so I called self instead. That said, I’ve tried using the example found in the API docs and adding scale, and I get the same error. Their example is as follows:
[lua]local function networkListener( event )
if ( event.isError ) then
print ( “Network error - download failed” )
else
event.target.alpha = 0
transition.to( event.target, { alpha = 1.0 } )
end
So I tried assigning it to an object such as myImage = display.loadRemoteImage … and then using myImage.Scale but it fails too.
[import]uid: 64538 topic_id: 23593 reply_id: 94626[/import]
If you need to do some work in the listener, just create another function with a different name (e.g listnerLoadImage or something). Otherwise just put false instead of self. [import]uid: 19297 topic_id: 23593 reply_id: 94629[/import]
Yes, that does work. So there must be a bug in my logic someplace that I’ll have to figure out. Thanks! [import]uid: 64538 topic_id: 23593 reply_id: 94801[/import]
What I have to do is call a function and put the scaling/effects in that function similar to your example above. Bottom line from my testing is that you MUST call a function to use effects!
Solved, and thanks again!! [import]uid: 64538 topic_id: 23593 reply_id: 94804[/import]