Flipbook not removing on scene change...

hello, i am new to corona. found this flipbook code and implemented it into my project. i have a main.lua with a global tabbar and a home.lua and another .lua file that if clicked will take you to the flipbook scene. the problem is i cant insert it into the screen group because my tabbar wont function, and it wont remove itself on button tap…here is the code.

local storyboard = require( “storyboard” )

storyboard.removeAll()

local scene = storyboard.newScene()

local flipbook = require (“flipbook”)

local widget = require( “widget” )

local function handleButtonEvent( event )

    if ( “ended” == event.phase ) then

        print( “Button was pressed and released” )

        storyboard.gotoScene(“home”)

    end

end

  

  

          

function scene:createScene ( event )

local group = self.view

   local my = flipbook:newFlipbook(“images/background_back.png”, “mainshadow.png”, “newshadow.png”, “curlshadow.png” )

 my.alpha = 0

 my:addPage( “images/b.png” )

my:addPage( “images/b1.png” )

my:addPage( “images/b2.png” )

my:addPage( “images/b3.png” )

my:addPage( “images/b4.png” )

my:addPage( “images/b5.png” )

my:addPage( “images/b6.png” )

local button1 = widget.newButton

{

    left = 100,

    top = 200,

    id = “button1”,

    label = “Default”,

    onEvent = handleButtonEvent

}

button1:toFront()

– Function to handle button events

displayGroup:insert(button1)

    displayGroup:insert(my)

      

end

function scene:enterScene( event )

end

function scene:exitScene( event )

local group = self.view

  display.remove(displayGroup)

    storyboard.removeScene(“buddhism”)

addPage:removeSelf()

end

function scene:destroyScene( event )

end

scene:addEventListener( “createScene”, scene )

scene:addEventListener( “enterScene”, scene )

scene:addEventListener( “exitScene”, scene )

scene:addEventListener( “destroyScene”, scene )

return scene

Are you not getting any errors? You have a group called displayGroup but I don’t see you creating the group anywhere.

Sorry this is the updated code…

local storyboard = require( “storyboard” )

storyboard.removeAll()

local scene = storyboard.newScene()

local flipbook = require (“flipbook”)

local widget = require( “widget” )

– Function to handle button events

– Create the widget

local flipbook= flipbook:newFlipbook(“images/background_back.png”, “mainshadow.png”, “newshadow.png”, “curlshadow.png” )

 flipbook:addPage( “images/b.png” )

flipbook:addPage( “images/b1.png” )

flipbook:addPage( “images/b2.png” )

flipbook:addPage( “images/b3.png” )

flipbook:addPage( “images/b4.png” )

flipbook:addPage( “images/b5.png” )

flipbook:addPage( “images/b6.png” )

–and finally, I setup the system event listener for that close event that I handled earlier.

– — system listener for applicationExit

  

          

function scene:createScene ( event )

local group = self.view

– Function to handle button events

– Create the widget

      

end

function scene:enterScene( event )

end

function scene:exitScene( event )

local group = self.view

  flipbook:removeSelf()

    storyboard.purgeScene(buddhism)

end

function scene:destroyScene( event )

end

scene:addEventListener( “createScene”, scene )

scene:addEventListener( “enterScene”, scene )

scene:addEventListener( “exitScene”, scene )

scene:addEventListener( “destroyScene”, scene )

return scene

I have tried everything. i cant get my images to remove. i took the pagecurl from the third parrty downloads here and implemented into my storyboard…there is no documentation on how to remove it…

Are you not getting any errors? You have a group called displayGroup but I don’t see you creating the group anywhere.

Sorry this is the updated code…

local storyboard = require( “storyboard” )

storyboard.removeAll()

local scene = storyboard.newScene()

local flipbook = require (“flipbook”)

local widget = require( “widget” )

– Function to handle button events

– Create the widget

local flipbook= flipbook:newFlipbook(“images/background_back.png”, “mainshadow.png”, “newshadow.png”, “curlshadow.png” )

 flipbook:addPage( “images/b.png” )

flipbook:addPage( “images/b1.png” )

flipbook:addPage( “images/b2.png” )

flipbook:addPage( “images/b3.png” )

flipbook:addPage( “images/b4.png” )

flipbook:addPage( “images/b5.png” )

flipbook:addPage( “images/b6.png” )

–and finally, I setup the system event listener for that close event that I handled earlier.

– — system listener for applicationExit

  

          

function scene:createScene ( event )

local group = self.view

– Function to handle button events

– Create the widget

      

end

function scene:enterScene( event )

end

function scene:exitScene( event )

local group = self.view

  flipbook:removeSelf()

    storyboard.purgeScene(buddhism)

end

function scene:destroyScene( event )

end

scene:addEventListener( “createScene”, scene )

scene:addEventListener( “enterScene”, scene )

scene:addEventListener( “exitScene”, scene )

scene:addEventListener( “destroyScene”, scene )

return scene

I have tried everything. i cant get my images to remove. i took the pagecurl from the third parrty downloads here and implemented into my storyboard…there is no documentation on how to remove it…