Problem with images after compiling

Sorry, I did not write in english correctly.

I have an alpha version. It works well on the Corona’s simulator, but game shows this runtime error in smartphone:

RUNTIME ERROR

E:\Corona Projects\Bolas2\main.lua:370:attempt to index global ‘volus’ (a nil value)

I do not know because it show error with the location of the folder.

Here there is an example of my code related to the images:

sat1 = display.newImage (“images/base_blue.png”, cen1.x+size2,cen1.y+size2)

As you can see, the direction of the images are relative.

¡Thank you!

What is line 370 of your code in main.lua?  Can you copy/paste the code around line 370?  Please use the blue <> button and paste your code in the popup window.

Rob

Yes, this line is in main.lua.

Code:

function Main () if (LEVEL=="MAIN") then bg = display.newRect (SX/2,SY/2,600,500) bg:setFillColor (1,1,1) volus = display.newImage ("images/volus.png",SX/2,-150) volus:scale (0.7,0.7) --(line 370) start = display.newCircle (SX/2,-150,30) start:setFillColor (0,0,0) start.name = "start" start.touch = TouchManager start:addEventListener ("touch") transition.to (volus,{y=SY/2-50,time=2500,transition=easing.outBounce}) transition.to (start,{y=SY/2+100,time=3500,transition=easing.outBounce}) end end

Observation: I build compilate with extern usb in my netbook.

¡Thank you!

It will probably work if you move volus:scale() to a new line. 

Really? Why need I move this element to a new line?

¡Thank you! :slight_smile:

YES, RUN!

Nice  :smiley:

Why need I move this element to a new line?

Not sure exactly, but I guess when compiling to native code it doesn’t handle it as lua would. 

Okey! Thank you again!

Lua requires a semi-color separator when you put two different statements on one line:

i = 10 j = 20 --<-------- Error.

i = 10; j = 20 --<------- works.

There are some cases, like “end” statements that can go on one line without a semi-colon, but I still use them just because.

Rob

What is line 370 of your code in main.lua?  Can you copy/paste the code around line 370?  Please use the blue <> button and paste your code in the popup window.

Rob

Yes, this line is in main.lua.

Code:

function Main () if (LEVEL=="MAIN") then bg = display.newRect (SX/2,SY/2,600,500) bg:setFillColor (1,1,1) volus = display.newImage ("images/volus.png",SX/2,-150) volus:scale (0.7,0.7) --(line 370) start = display.newCircle (SX/2,-150,30) start:setFillColor (0,0,0) start.name = "start" start.touch = TouchManager start:addEventListener ("touch") transition.to (volus,{y=SY/2-50,time=2500,transition=easing.outBounce}) transition.to (start,{y=SY/2+100,time=3500,transition=easing.outBounce}) end end

Observation: I build compilate with extern usb in my netbook.

¡Thank you!

It will probably work if you move volus:scale() to a new line. 

Really? Why need I move this element to a new line?

¡Thank you! :slight_smile:

YES, RUN!

Nice  :smiley:

Why need I move this element to a new line?

Not sure exactly, but I guess when compiling to native code it doesn’t handle it as lua would. 

Okey! Thank you again!

Lua requires a semi-color separator when you put two different statements on one line:

i = 10 j = 20 --<-------- Error.

i = 10; j = 20 --<------- works.

There are some cases, like “end” statements that can go on one line without a semi-colon, but I still use them just because.

Rob