transition.moveBy not working

I have the need to use transition.moveBy on my app when I press a button, but when I call it I get

Attempt to call field ‘moveBy’ (a nil value)

I have even tried to copy the sample code from the documentation, which is inside the function randomFunction :

 

local function randomFunction( ... ) square = display.newRect( 0, 0, 100, 100 ) transition.moveBy( square, { x=100, y=100, time=2000 } ) end randomBtn = widget.newButton{ labelColor = { default={255}, over={128} }, width=57, height=55, onRelease = randomFunction }  

 

 

any suggestions? thx

 

p.s.: I already posted this on other cause I didn’t know where it’d fit, but I saw some transition questions here so I thought I’d post it here.

Are you sure you have not defined a local variable with the name “transition”? Or overwritten the global transition variable?

Yes. I searched transition with cmd+f and got nothing but that transition.moveBy line :frowning:

What version of Corona SDK are you running?

I ran a small test:

local c = display.newCircle(50,50,50) transition.moveBy(c,{ x=100, y=100, time=2000 } )

And it seems to work fine.  Perhaps a library you are using is writing over it.  Do you have a lua file called transitions that you are running?

I’m running Version 2013.1137 (2013.6.7), and the only “requires” I’m using are storyboard, physics, widget and json.

Hi @fabio.gelbcke,

The version you’re using is too old and does not support those transition “convenience” functions. I urge you to upgrade to a newer version of Corona, as #1137 is extremely old now.

Best regards,

Brent

Brent beat me too it, but I wanted to add that 1137 is a very old build.  It’s so old that you are not going to be able to deploy to Apple with it and I’m 99% sure you will run into problems with Google Play (there are fixes in 1210 that are needed for Google Play).  We put out a special version of 1262 to deal with Apple’s new iOS 7 submission requirements (read about it here: http://coronalabs.com/blog/2014/01/29/apples-ios-7-submission-requirements/).

But since then Apple has also started rejecting apps that use the Ad Identifiefer that don’t show ads.  So if your app isn’t using ads, you will need to move to the latest public build (2187) to get past that requirement.   Going to any build with a number > 2000 means moving to the new Graphics 2.0 standards, but you can usually quickly adapt your app using just a couple of things.

There is a quick migration tutorial here:  http://coronalabs.com/blog/2013/11/20/tutorial-fast-migration-of-graphics-1-0-based-projects-to-graphics-2-0/

Rob

Are you sure you have not defined a local variable with the name “transition”? Or overwritten the global transition variable?

Yes. I searched transition with cmd+f and got nothing but that transition.moveBy line :frowning:

What version of Corona SDK are you running?

I ran a small test:

local c = display.newCircle(50,50,50) transition.moveBy(c,{ x=100, y=100, time=2000 } )

And it seems to work fine.  Perhaps a library you are using is writing over it.  Do you have a lua file called transitions that you are running?

I’m running Version 2013.1137 (2013.6.7), and the only “requires” I’m using are storyboard, physics, widget and json.

Hi @fabio.gelbcke,

The version you’re using is too old and does not support those transition “convenience” functions. I urge you to upgrade to a newer version of Corona, as #1137 is extremely old now.

Best regards,

Brent

Brent beat me too it, but I wanted to add that 1137 is a very old build.  It’s so old that you are not going to be able to deploy to Apple with it and I’m 99% sure you will run into problems with Google Play (there are fixes in 1210 that are needed for Google Play).  We put out a special version of 1262 to deal with Apple’s new iOS 7 submission requirements (read about it here: http://coronalabs.com/blog/2014/01/29/apples-ios-7-submission-requirements/).

But since then Apple has also started rejecting apps that use the Ad Identifiefer that don’t show ads.  So if your app isn’t using ads, you will need to move to the latest public build (2187) to get past that requirement.   Going to any build with a number > 2000 means moving to the new Graphics 2.0 standards, but you can usually quickly adapt your app using just a couple of things.

There is a quick migration tutorial here:  http://coronalabs.com/blog/2013/11/20/tutorial-fast-migration-of-graphics-1-0-based-projects-to-graphics-2-0/

Rob