Page 1 of 1

Handler Error

Posted: Thu May 19, 2011 5:55 pm
by Tester2
In trying to make a browser window display a URL, I get:

"card 'Card3': execution error at line 19 (Handler: can't find handler) near "iphoneControlDestroy", char 1"

error on my Card's script....it is stopping at iphoneControlCreate "browser" and iphoneControlDestroy sBrowserId.

Please help a new beginner out!! :cry:

Thanks bunches!

Re: Handler Error

Posted: Thu May 19, 2011 6:00 pm
by Klaus
Hi Tester2,

see my reply in this thread, seems to be the same problem:
http://forums.runrev.com/phpBB2/viewtop ... =49&t=7542


Best

Klaus

Re: Handler Error

Posted: Thu May 19, 2011 6:54 pm
by Tester2
Hey Klaus,

Thanks so much...I actually found that thread after posting this one, and the error has now gone away. :D

However, a new problem I have is that once the URL (PDF or YouTube video) loads in my browser...it seems my card is stuck and I cannot interact with anything besides the browser (ie: I cannot click on my "Back" button that I have on the bottom of the screen)

Do I need to somehow close the browser or something before I can click on a button?

Thanks bunches!

-Tester2

Re: Handler Error

Posted: Fri May 20, 2011 12:21 pm
by Klaus
Hi Tester2,

hmmm, if your browser overlaps other important parts of your stack,
what options do you have except closing the browser? 8)

No, you will need to close the browser, or, if applicable, you could make
the browser invisible temporarily? Probably not...

The "browser" is a kind of overlay, like the browser object in the desktop vesion
and is always "on top".


Best

Klaus

Re: Handler Error

Posted: Fri May 20, 2011 9:42 pm
by Tester2
My browser doesn't overlap my buttons as far as I know unless the "overlay" takes over the whole screen...

What code would I use to close the browser though?

Here is my card's code:

Code: Select all

[
# declare the local id of the browser we are creating 
Local sBrowserId

# when the card is opened make sure that default settings are configured

on preOpenCard
    # quit if we are not on a mobile device
    
   if the environment is not "mobile" then
        
      exit preOpenCard
    
      end if
    # create the browser
   iphoneControlCreate "browser"
   put the result into sBrowserId


    # set up the basic defaults
   iphoneControlSet sBrowserId, "rect" , the rect of group "Browser"
   iphoneControlSet sBrowserId, "visible" , "true"
   iphoneControlSet sBrowserId, "url" , "MyPDF.pdf"
   iphoneControlDestroy sBrowserId
end preOpenCard

on closeCard
    
   if the environment is not "mobile" then
        
      exit closeCard
    
      end if

   # destroy the browser we created 
      iphoneControlDestroy sBrowserId
end closeCard]

Thanks.