Problem with xScale

I need to start an image with an xScale of zero before I transition it. According to the App Programing Guide I should be able to do it like this:

imageEven[i].xScale=0

but this doesn’t seem to work. What am I missing? [import]uid: 6397 topic_id: 1089 reply_id: 301089[/import]

Just looking at this one line of code, it seems to be fine. Should be something else why it is not working. My guess is that imageEven[i] does not contain your image. Does the terminal spills out any information? [import]uid: 5712 topic_id: 1089 reply_id: 2749[/import]

Hi Mike, hope you had a great weekend. This is a piece of the page turn project you helped me with last week. Here is my test snippet. It’s a better example of the code I’m trying to implement.

local btnNext = display.newImage(“butterfly.png”, 50, 50, 0, 0)
btnNext:addEventListener(“tap”, btnNext)
btnNext.xScale = 0

The image shows on the screen but is not scaled. [import]uid: 6397 topic_id: 1089 reply_id: 2760[/import]

Hi,

besides display.newImage, it still looks good to me. I use .xScale myself so I can’t see right now where the problem is.

About display.newImage, according to the manual the syntax for beta4 is:

display.newImage( [parentGroup,] filename [, baseDirectory] [, x, y] [,isFullResolution] )

I would delete the ,0,0 part and see if that changes anything.

And if you would like to, you can send me the files and I will have a look it myself tonight when
I am back from work:

mike (at) fantomgl (dot) com

Michael [import]uid: 5712 topic_id: 1089 reply_id: 2761[/import]

Also, we just logged a bug (#230) where xScale=0 apparently doesn’t do anything at all, at least in some cases.

As a workaround, try setting it to a small but nonzero number, like 0.1 or 0.05. [import]uid: 3007 topic_id: 1089 reply_id: 2815[/import]