Corona in 5 Minutes

Im am attempting to follow a coding guide called Corona in 5 minutes but it returns an error when i copy exactly what is in the guide. Im really enjoying the resources available so far (particularly “Programming in Lua” by by Roberto Ierusalimschy) but this has stumped my progress.

local myTextObject = display.newText( “Hello World”, 10, 10, “Arial”, 60 );
myTextObject:setFillColor( 1, 0, 0 )

This code shows this error in the output
Runtime error: \main.lua:8: attempt to call method ‘setFillColor’ <a nil value>

Thanks a lot for any help.

just posted those two lines into a project of mine and no errors - red hello world

actually your placement of 10, 10 i replaced to put in the centre of the screen

local myTextObject = display.newText( “Hello World”, 160, 50, “Arial”, 60 );

myTextObject:setFillColor( 1, 0, 0 )

i would say your error is some other setFillColor

T.

@Grande

If you downloaded Corona SDK yesterday you might have ended up with an old version of the SDK.

CoronaLabs had a server problem where it gave anybody that downloaded the public build a very old version of Corona that didn’t support setFillColor on text objects.

If you’re one of these people I’d suggest that you download the public build again.

Thanks very much for both your replies. In the about section of the simulator it says 2011.704 (2011.12.8) so i guess thats old. I just assumed it was a consequence of me using the starter pack. Ill get back to you on this issue.

Thanks so much ingemar, this was the problem. I am using the updated version now.

Great!

Happy coding! I think you’ll like it  :smiley:

just posted those two lines into a project of mine and no errors - red hello world

actually your placement of 10, 10 i replaced to put in the centre of the screen

local myTextObject = display.newText( “Hello World”, 160, 50, “Arial”, 60 );

myTextObject:setFillColor( 1, 0, 0 )

i would say your error is some other setFillColor

T.

@Grande

If you downloaded Corona SDK yesterday you might have ended up with an old version of the SDK.

CoronaLabs had a server problem where it gave anybody that downloaded the public build a very old version of Corona that didn’t support setFillColor on text objects.

If you’re one of these people I’d suggest that you download the public build again.

Thanks very much for both your replies. In the about section of the simulator it says 2011.704 (2011.12.8) so i guess thats old. I just assumed it was a consequence of me using the starter pack. Ill get back to you on this issue.

Thanks so much ingemar, this was the problem. I am using the updated version now.

Great!

Happy coding! I think you’ll like it  :smiley: