Question

I am new to Live code programming. Please help me out.

I want to create two cards, one has two buttons and another one has web view component. So what will be scripts so that one click of button will open one webpage and another button will open another webpage in the another card with web view panel?

As i know "launch" button script will open webpage in default browser, but I don't want that. I want it to open inside the application.

Was it helpful?

Solution

If you are using the revBrowser feature you would do something like this:

Button 1 Script

on mouseUp
   Launch url "http://www.google.com" // Opens in users default browser
end mouseUp

Button 2 Script

on mouseUp
   go to card "browser" // name of your card with the browser on it
end mouseUp

Card "browser" Script

on openCard
   revBrowserNavigate instanceId, "http://www.google.com" // Opens URL in browser instance
end openCard

If you're writing a mobile app and using the native browser object there you'll want a slightly different card script:

on openCard
   mobileControlSet controlID, "url", "http://www.google.com"
end openCard

OTHER TIPS

I am assuming that you want buttons in your program to navigate between the two cards. The syntax for switching the current card is "go card [card]". So, you should create a button on the first card with 'go card [CARD 2'S NAME]' and a button on the second card with 'go card 1' or 'go card [CARD 1'S NAME]'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top