Handler Error

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

Handler Error

Post by Tester2 » Thu May 19, 2011 5:55 pm

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!

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Handler Error

Post by Klaus » Thu May 19, 2011 6:00 pm

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

Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

Re: Handler Error

Post by Tester2 » Thu May 19, 2011 6:54 pm

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

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Handler Error

Post by Klaus » Fri May 20, 2011 12:21 pm

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

Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

Re: Handler Error

Post by Tester2 » Fri May 20, 2011 9:42 pm

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.
Attachments
Screen shot 2011-05-20 at 1.32.16 PM.png
Screenshot of my Card on Simulator
Screen shot 2011-05-20 at 1.32.16 PM.png (170.03 KiB) Viewed 4575 times

Post Reply