Mobgui Switch

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Mobgui Switch

Post by marcelloe » Fri Dec 06, 2013 8:34 pm

I want to use the mobgui switch to turn on when an image is place into a graphic. Also, I want to clear the image once the switch is turned off.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Mobgui Switch

Post by LCNeil » Mon Dec 09, 2013 11:27 am

Hi Mark,

The following documentation should help you get up and running with mobGui switches-

http://mobgui.com/doc.php?docId=7

The command that you should look for is the “switchSet” command.

You should be able to set this to set the switch to “On” when there is an Image available

You would then use the “switched” message to do something when the user presses the switch.

Kind Regards

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding

--

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Mobgui Switch

Post by marcelloe » Mon Dec 09, 2013 4:52 pm

This is the Script I am trying to us to put the switch to on. What am I doing wrong?

Code: Select all

On switchSet
   set switch "snooze 1" to "on" when there is an image in graphic "video 1"
end switchSet

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Mobgui Switch

Post by LCNeil » Mon Dec 09, 2013 5:12 pm

Hi Mark,

Graphics cannot contain images and in the examples I have sent, I am only setting the rect of a graphic object (the last image) to the rect of a graphic.

I am using a graphic simply as a visual placeholder for the location that I want the image object to go.

When you import an image (e.g. mobilePickPhoto “library”) it creates a new “image object” on your stack.

Instead of checking if there is an image in the graphic area, it would be easier to use the image object method explained here-

http://forums.runrev.com/viewtopic.php?f=73&t=18287

Kind Regards

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding

--

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Mobgui Switch

Post by marcelloe » Tue Dec 10, 2013 5:28 pm

I have read the documentation on the mobgui website about switches. I am still not clear on how to set the switch to "on" when an image is in the graphic. Also, I want to the graphic from the image when the switch is turned to "off".

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Mobgui Switch

Post by LCNeil » Wed Dec 11, 2013 2:28 pm

Hi Mark,

I will go over this in todays webinar

Kind Regards

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding


Post Reply

Return to “idea2app and Coding School”