accessing stage item succeeds in simulator, fails on device

2 replies [Last post]
Rozek
User offline. Last seen 1 year 3 weeks ago. Offline
Joined: 25 Dec 2009

Hello!

I am currently prepairing a series of animations which can be replayed after having finished. For the animation series to start again, I have to reset the animated display objects to their initial state. I tried to achieve this using the following code:

    local Container = display.getCurrentStage()
    for i = 1,Container.numChildren do
      Container[i].x      = Container[i].x_Start      or Container[i].x
      Container[i].y      = Container[i].y_Start      or Container[i].y
      Container[i].alpha  = Container[i].alpha_Start  or Container[i].alpha
      Container[i].xScale = Container[i].xScale_Start or Container[i].xScale
      Container[i].yScale = Container[i].yScale_Start or Container[i].yScale
    end;

which works fine on the simulator, but fails on the device!

I am now resetting my display objects in a different way (using far more code and less elegantly), but in a bigger project, having to modify the foreseen approach would be quite annoying!

Kind regards,

Andreas Rozek

Replies

seanh
User offline. Last seen 21 hours 2 min ago. Offline
Ansca Staff
Joined: 3 Jun 2009

(Logged as bug #141)

seanh
User offline. Last seen 21 hours 2 min ago. Offline
Ansca Staff
Joined: 3 Jun 2009

This should be fixed in beta 8

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.