Parental Gate for Apple - Math problem

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Parental Gate for Apple - Math problem

Post by jmburnod » Fri Nov 14, 2014 11:16 pm

Hi Al,
I like this way to have a Parents portal.
Why not a function getPressedBtns which check the hilite of each btn of and return a result like "3,6,9" ?
Each concerned button have a name like "myBtn_1"," myBtn_2" ...
Best regards
Jean-Marc
https://alternatic.ch

stephenelkins
Posts: 11
Joined: Wed Nov 12, 2014 6:28 pm

Re: Parental Gate for Apple - Math problem

Post by stephenelkins » Sat Nov 15, 2014 6:27 pm

Grrrr ... so frustrated. I have tried so many things now. Can't get it working. So, I'm trying something different and I am wondering why this won't work. On one of the button scripts I put this ...

on mouseUp
if (me + button "button6" + button "button9") is true then
go to card "ParentMenu"
end if
end mouseUp

So, I guess I'm not getting how "+" works? I guess I'm extra frustrated because this is the only thing that caused my app to be rejected from App Store. Thanks!

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 157
Joined: Thu Jun 29, 2006 4:16 pm

Re: Parental Gate for Apple - Math problem

Post by Randy Hengst » Sat Nov 15, 2014 6:29 pm

Hi All,

Interesting ideas. I'll offer another one. I've attached a demo stack. But, in short… I'd wrote two handlers that would then be placed in the nine number buttons… one for mouseDown and one for mouseUp. In mouseDown I send the labels of the buttons 3, 6, and 9 to a "results" field… when I first began coding I really needed to "see something happen" when I had the script "do something." I still do this a lot (even though it's a bit slower and I've learned how to use custom properties). I also separted out the "hold for three seconds" part of the code into a button that shows when the correct number buttons have been pressed.

Anyway, just another thought to share with the conversation.

be well,
randy
Attachments
Divisible_by_Three.livecode.zip
(2.04 KiB) Downloaded 233 times

stephenelkins
Posts: 11
Joined: Wed Nov 12, 2014 6:28 pm

Re: Parental Gate for Apple - Math problem

Post by stephenelkins » Sat Nov 15, 2014 6:36 pm

Hey Randy! Thanks for adding to the convo. When I go to check out your stack it says it's corrupted. I'm using LiveCode 6.7. Do I need to get a newer version? Thank you!
Steve

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 157
Joined: Thu Jun 29, 2006 4:16 pm

Re: Parental Gate for Apple - Math problem

Post by Randy Hengst » Sat Nov 15, 2014 6:41 pm

Oh yeah, sorry I used 7.0 Here's one saved in the earlier format….
Attachments
Divisible By Three.livecode.zip
This stack saved in pre-LC7.0 format
(2.03 KiB) Downloaded 225 times

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Parental Gate for Apple - Math problem

Post by jmburnod » Sat Nov 15, 2014 7:29 pm

hi Steve,
This stack uses the way I described in my post
All scripts are in the cd script
Best regards
Jean-Marc
Attachments
parentPortal001.livecode.zip
(1.72 KiB) Downloaded 219 times
https://alternatic.ch

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

Re: Parental Gate for Apple - Math problem

Post by Klaus » Sat Nov 15, 2014 7:33 pm

Hi Stepehen,

well, the PLUS sign is meant to ADD something to another thing, so this not works! 8)
Remember that LC is very "english" like, so you need to check each condition separately with AND like this:

Code: Select all

on mouseUp
   ## Parens not really neccessary, but will show how the engine will parse this line: evaluating one condition after another!
  if (the hilite of me) AND (the hilite of btn 3) AND (the hilite of btn 9) THEN
     go to card "ParentMenu"
   end if
end mouseUp
If you are checking for TRUE like in my example, you can omit the -> = TRUE part, lazy moi :D

Hint: If the user will check ALL of your 9 buttons, he will get access, too 8)
OK, that's one for the next update.


Best

Klaus

stephenelkins
Posts: 11
Joined: Wed Nov 12, 2014 6:28 pm

Re: Parental Gate for Apple - Math problem

Post by stephenelkins » Tue Nov 18, 2014 7:38 am

Hey everybody! I'm in between a few different major life developments (all good stuff, I hope!:D), so I haven't checked the code/advice/encouragement y'all shared with me yet. Hoping to have time to check everything out tomorrow. I just want to say to all of you, from the bottom of my heart, thank you for your help. I'll keep ya posted. Have a great night (or day if you live across the pond:)

Post Reply