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
[import]uid: 94579 topic_id: 22689 reply_id: 322689[/import]