Dispatching an event on transition complete

Hi there, having the following code:

local function newTestClass()
 local self = display.newGroup();

 local function onComplete()
 print("internal completed")
 local event = {};
 event.name = "test";
 event.target = self;
 self:dispatchEvent(event);
 end

 function self:testMe()
 local bar = display.newGroup();
 transition.to(bar, {time=1000, onComplete=onComplete});
 end

 return self;
end

local foo = newTestClass();
foo:testMe();

I’m simply dispatching an event on transition complete event. When I run the program it generates the following Runtime error:

Runtime error
 ?:0: attempt to index a nil value
stack traceback:
 [C]: ?
 ?: in function '?'
 ?: in function <?:215>

Does anyone know why this is happening? Thanks a lot :slight_smile: [import]uid: 94579 topic_id: 22689 reply_id: 322689[/import]

You’re not giving transition.to any properties to animate. What’s it transitioning?

What listener is supposed to process your dispatched event, anyway? [import]uid: 44647 topic_id: 22689 reply_id: 90496[/import]

Well - my code is just an example to show the problem (not a real application code) extracted from our application.

It’s not about properties nor event listener. The same Runtime error is generated when you use for example timer.performWithDelay. The point is that I want to dispatch an event on some time-related callback. Eveything works fine but there is this unknown Runtime error. [import]uid: 94579 topic_id: 22689 reply_id: 90499[/import]

Fixed. It works fine with Corona build 2012.757. [import]uid: 94579 topic_id: 22689 reply_id: 90693[/import]