Hello,
I have added a bunch of objects to a group and when I inserted the objects I kicked off a transition for each object.
Now I am looping through all the objects in the group and would like to access their current transition so that I can cancel them.
This is how I add objects to a group and start transition
[lua]local catGroup = display.newGroup()
local function addCats(e)
– ADD CAT TO GROUP
local cat = display.newImage(“images/cat.png”)
cat.x = math.random(0, display.contentWidth)
cat.y = 0
catGroup:insert(bat, false )
transition.to( cat, { time=3500, x=cx, y=cy } )
end[/lua]
This is how I loop through them all
[lua]-------------------------------------------------
– LOOP THROUGH CATS
for i=1, catGroup.numChildren do
if (hitTestObjects(light, catGroup[i])) then
– HOW DO I CANCEL TRANSITION? e.g. transition.cancel(transition.catGroup[i])?
end
end[/lua]
Many thanks.
G [import]uid: 2395 topic_id: 10660 reply_id: 310660[/import]