New to Apple- Need help with 2nd Example "Button"

Hi

Here is the code I have “cut & pasted” out of the manual into the text editor.

local textObject = display.newText( “HELLO World!”, 50, 50, nil, 24 )
textObject:setTextColor( 255,255,0 )
local button = display.newImage( “button.png” )
button.x = display.contentWidth / 2
button.y = display.contentHeight - 50

the Hello World works but the button part does not… the first couple of time I ran it … tried to give me to something but it was all broken up all over the simulator … later attempts just gives me the Hello World and nothing new.

In the Terminal I get this error:
WARNING: Cannot create path for resource file ‘button.png’. File does not exist.

WARNING: Failed to find image(button.png)
Runtime error
assertion failed!
stack traceback:
[C]: ?
[C]: in function ‘assert’
?: in function <?:518>
(tail call): ?
/Users/thomas/Desktop/main.lua:3: in main chunk
Runtime error: assertion failed!
stack traceback:
[C]: ?
[C]: in function ‘assert’
?: in function <?:518>
(tail call): ?
/Users/thomas/Desktop/main.lua:3: in main chunk

I thought that maybe the iOS-sdk wasn’t fully loaded so I reinstalled that again thinking the button was coming from there. This did not help!

I’m still boggled as to where iOS-sdk is on the computer as I don’t see it in the Applications Folder.
But yes I not just downloading it…I do install it “successfully” just don’t know were it ends up …So if I have to launch it …best tell me where I mint look to find it … Kindly

Regards
Thomas
[import]uid: 17865 topic_id: 5214 reply_id: 305214[/import]

well have you got button.png on your desktop?
[import]uid: 6645 topic_id: 5214 reply_id: 17351[/import]

That was loaded with the reset of Corona …but after moving it to the desktop were I’m working the button showed up sort of …rerunning …sorry relaunching it and it came up fine.

Thank You
Regards
Thomas

I was typing it in by hand and until this person answered. I hadn’t seen the pre-coded file.

SO THAT BEING THE CASE I GUESS I SHOULD ADD THIS:

– Abstract: Hello World sample app

– Version: 1.0

– Copyright © 2009 ANSCA Inc. All Rights Reserved.

– Permission is hereby granted, free of charge, to any person obtaining a copy of
– this software and associated documentation files (the “Software”), to deal in the
– Software without restriction, including without limitation the rights to use, copy,
– modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
– and to permit persons to whom the Software is furnished to do so, subject to the
– following conditions:

– The above copyright notice and this permission notice shall be included in all copies
– or substantial portions of the Software.

– THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
– INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
– PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
– FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
– OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
– DEALINGS IN THE SOFTWARE. [import]uid: 17865 topic_id: 5214 reply_id: 17360[/import]