As Ingemar suggests, a lot of the ad “handling” stuff can be moved out of the scene module and over to “main.lua”. So I would suggest doing these tasks in that file (“main.lua”):
[lua]
local appodeal = require( “plugin.appodeal” )
local function adListener( event )
– your code from above (or similar)
end
appodeal.init( adListener, { appKey="" } )
[/lua]
Now back in the Composer scene, it’s usually best to show an add during the “did” phase of the “show:create()” function block. This is because you’ll almost always want the ad to display once the scene is entirely on screen.
Hope this gets you on the right track. Any other questions, please ask.
Brent