Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
Kevvy
- Posts: 20
- Joined: Fri Jan 10, 2014 7:06 am
Post
by Kevvy » Thu Oct 02, 2014 8:21 am
Hi there,
I originally wrote a small app in the community 6.6.3 version and deployed it with no issues. I now recently moved to the commercial version 6.6.3 and without any code changes saved to stand alone. I found that my dynamically generated buttons in a group wont do anything when tapped on now surely this must be a bug in the commercial version ?
The code works in the live testing environment of the IDE but not on the iPad, although the Community version compiled code works in both.
Details:
iPad iOS 8.0.2
Livecode Commercial 6.6.3
Mac OSX Mavericks
Code Snippet:
Code: Select all
on openCard
if there is not a group "jobs_buttons" then
create group "jobs_buttons"
set visible of group "jobs_buttons" to false
else
delete group "jobs_buttons"
create group jobs_buttons
set visible of group "jobs_buttons" to false
end if
create button temp in group "jobs_buttons"
create field temp_call_number in group "jobs_buttons"
set the opaque of it to false
set the showborder of of it to false
set the disabled of it to false
create field temp_comp_name in group "jobs_buttons"
set the opaque of it to false
set the showborder of of it to false
set the disabled of it to false
put "255,255,255" into priority_colour
set the loc of btn temp to 10,10+40
set the borderWidth of btn temp to 0
set the width of btn temp to 330
set the height of btn temp to 80
set the showname of btn temp to false
set the opaque of btn temp to false
set the threeD of btn temp to false
set the showBorder of btn temp to false
set the hiliteborder of btn temp to false
set the script of btn temp to "on mouseUp"\
& cr & "answer 1"\
& cr & "end mouseUp"\
end openCard
-
Simon
- VIP Livecode Opensource Backer

- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
Post
by Simon » Thu Oct 02, 2014 4:40 pm
Hi Kevvy,
Not that this is the problem but watch out when setting scripts.
I believe in Community it's as many as you like but in Commercial it's 10 lines still.
I see that you posted only 3 lines, so that should work.
I could be wrong... so many things have changed.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Thu Oct 02, 2014 5:03 pm
Simon wrote:Hi Kevvy,
Not that this is the problem but watch out when setting scripts.
I believe in Community it's as many as you like but in Commercial it's 10 lines still.
I see that you posted only 3 lines, so that should work.
I could be wrong... so many things have changed.
Thankfully this is one of those things:
Starting with v6.7 and later, scriptLimits has been deprecated - this is from the Dictionary entry for that property:
Deprecated in LiveCode 6.7.
Value:
The scriptLimits function now always returns 0,0,0,0.
Comments:
The scriptLimits function is deprecated and should not be used. It previously described the limits on dynamic scripting in standalone applications.
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Thu Oct 02, 2014 5:20 pm
I should note that while you can set the script of any object to a script of any length at runtime in both the Community and Commercial versions with v6.7 and later, there are two other considerations here:
1. The script you were inserting is only three lines, so that shouldn't come into play. We should explore this in more depth to determine the root cause.
2. Rather than setting the script, you might consider using a behavior script instead, setting the behavior property of newly-created buttons to the long ID of the button that holds the behavior script. Not only is it simpler to do to, but it keeps all the code used across all of those buttons in one place, so if you ever need to fix or enhance what those buttons do you only need to work on the behavior script, and everything using it will automatically benefit from the changes.
-
Kevvy
- Posts: 20
- Joined: Fri Jan 10, 2014 7:06 am
Post
by Kevvy » Fri Oct 03, 2014 7:15 am
Thanks for the response guys, that explains it. Ok great, let me try and change the code to use a behaviour script

Appreciate the help.