Hi,
I was wondering how can you remove the slide-view. I want to be able to close it to change screens. It works fine with removing scrollview :s
I use removeSelf() for removing the scroll-view which works great. If i try use it for slide-view it don't work though.
I really need this as trying to make this app for a client so need it working soon if possible.
I have tryed doing this with director aswell but still didn't seem to work.
Thanks :D
I changed the code inside the slide-view to
local p = display.newImage(imageSet[i], system.DocumentsDirectory)
line 53 but doubt would make any difference.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | display.setStatusBar( display.HiddenStatusBar ) function Events() -- Create local file for saving data local path = system.pathForFile("summerfundayoriginal72.jpg", system.DocumentsDirectory ) myFile = io.open( path, "w+b" ) local path2 = system.pathForFile("outdoorworkshopsweb3.jpg", system.DocumentsDirectory ) myFile2 = io.open( path2, "w+b" ) -- Request remote file and save data to local file http.request { url ="http://www.anscamobile.com/images/showcase/CoronaBadge_240x230.png", sink = ltn12.sink.file(myFile), } http.request { url ="http://www.anscamobile.com/images/showcase/CoronaBadge_240x230.png", sink = ltn12.sink.file(myFile2), } local function listener(event) local ontouch = event.target if(ontouch == count) then slideView:removeSelf() count:removeSelf() end return true end local myImages = { "summerfundayoriginal72.jpg", "outdoorworkshopsweb3.jpg" } slideView.new( myImages ) count = display.newText( "Exit", 140, 0, "Arial", 20 ) count:setTextColor( 255, 0, 0, 255 ) count:addEventListener("touch",listener) end |
Hi,
Did you try to equal the slide with a variable, i think it will work. I mean to do like this
change the line 40
slideView.new( myImages )
to be like this
local variable = slideView.new( myImages )
then try to remove the variable ( variable:removeSelf() ).
Regards,
Ali