Re: Setting script in object not working...

2012-03-22 Thread Ken Corey

On 21/03/2012 22:01, Glen Bojsza wrote:

I have a stack where I generate a series of images.

I then set the script of each image to a script that is stored in a custom
property.


I'm *very* new to all of this but...isn't this when the 'behavior' field 
would come in handy?


Put the script into a button, and then for each image you create set the 
behavior field to the button.


-Ken

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Glen Bojsza
Thanks Alex, I will try the behavior path...

The funny thing is I swear that this was working in earlier versions. I
even created a new simple stack with two buttons and a field.

the stack has a customproperty call mymessage

mymessage is

on mouseUp
put hello into fld tOut
end mouseUp

button start has the following script

on mouseUp
set the script of btn test to the mymessage of stack tmirror
end mouseUp

Pressing button start sets the script of button test with the
customproperty.

Pressing button test puts hello into fld tOut

It works for both ide and the application.

So some how my main project stack has something that changes when made into
an application... I confirmed this with adding a test button to output the
images' scripts... they were all empty?

It is hard to trouble shoot an app if it works in the ide.

The behavior path is a good idea as it might point to where the issue lies.

thanks,

Glen


On Wed, Mar 21, 2012 at 4:11 PM, Alex Tweedly a...@tweedly.net wrote:

 Sounds like you're running into something to do with scriptlimits (though
 I don't see why when you have a very simple short script).

 It's not clear from your description whether the script you want to set is
 known ahead of time and simply stored in custom property, or whether it is
 genuinely dynamic. Would you be able to, rather than set the script of each
 image, simply set the behaviour of the image to some (pre-created) button
 with the appropriate script already in place?

 -- Alex.


 On 21/03/2012 22:01, Glen Bojsza wrote:

 Hello,

 I have a stack where I generate a series of images.

 I then set the script of each image to a script that is stored in a custom
 property.

 In the ide the script works when you click an image and when you inspect
 the image's script in the script editor it is there.

 But when I take the stack and make it into an application it looks as if
 the images contain no script because when an image is clicked nothing
 happens.

 I have tried making the script very simple ie

 on mouseUp
 answer Success with OK
 end mouseUp

 Again this works in the ide but not in the final application?

 I have tried several other methods such as adding a button that I can
 manually test in the application to copy a script to an image but this
 fails?

 Has anybody experienced this before or have any suggestions?

 thanks,

 Glen
 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode



 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Pete
Is this another manifestation of not being able to save anything in a stack
in a standalone program?
Pete

On Wed, Mar 21, 2012 at 3:01 PM, Glen Bojsza gboj...@gmail.com wrote:

 Hello,

 I have a stack where I generate a series of images.

 I then set the script of each image to a script that is stored in a custom
 property.

 In the ide the script works when you click an image and when you inspect
 the image's script in the script editor it is there.

 But when I take the stack and make it into an application it looks as if
 the images contain no script because when an image is clicked nothing
 happens.

 I have tried making the script very simple ie

 on mouseUp
 answer Success with OK
 end mouseUp

 Again this works in the ide but not in the final application?

 I have tried several other methods such as adding a button that I can
 manually test in the application to copy a script to an image but this
 fails?

 Has anybody experienced this before or have any suggestions?

 thanks,

 Glen
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
Pete
Molly's Revenge http://www.mollysrevenge.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Glen Bojsza
Hi Pete,

I am not trying to save the new images in the standalone but only show
them. If the user wants to save the images they are exported as png's.

But I am now certain that there is something amiss... I can set the tooltip
for the images and it works fine in both ide and the application.

I have also tried adding a couple of test buttons, one that cycles through
the images of the group and sets their script and one that reads the list
of image ids that I store and then set the scripts with direct
references... both fail in the application but work in the ide.

This looks like it will come down to massive trial and error to solve the
problem... so any ideas on tackling the issue?

By the way the behavior idea failed.

thanks,

Glen

On Wed, Mar 21, 2012 at 4:27 PM, Pete p...@mollysrevenge.com wrote:

 Is this another manifestation of not being able to save anything in a stack
 in a standalone program?
 Pete

 On Wed, Mar 21, 2012 at 3:01 PM, Glen Bojsza gboj...@gmail.com wrote:

  Hello,
 
  I have a stack where I generate a series of images.
 
  I then set the script of each image to a script that is stored in a
 custom
  property.
 
  In the ide the script works when you click an image and when you inspect
  the image's script in the script editor it is there.
 
  But when I take the stack and make it into an application it looks as if
  the images contain no script because when an image is clicked nothing
  happens.
 
  I have tried making the script very simple ie
 
  on mouseUp
  answer Success with OK
  end mouseUp
 
  Again this works in the ide but not in the final application?
 
  I have tried several other methods such as adding a button that I can
  manually test in the application to copy a script to an image but this
  fails?
 
  Has anybody experienced this before or have any suggestions?
 
  thanks,
 
  Glen
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 


 --
 Pete
 Molly's Revenge http://www.mollysrevenge.com
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Alex Tweedly
I'd try adding your 'start' and 'test' buttons to the real stack, and 
see if they work there.
If they do, add an image 'test1' and have the 'start' button set its 
script as well.
If that works, try doing that *after* you have created all the other 
images (in case its an issue with total number of script lines set).


No other ideas yet 
-- Alex.

On 21/03/2012 22:52, Glen Bojsza wrote:

Hi Pete,

I am not trying to save the new images in the standalone but only show
them. If the user wants to save the images they are exported as png's.

But I am now certain that there is something amiss... I can set the tooltip
for the images and it works fine in both ide and the application.

I have also tried adding a couple of test buttons, one that cycles through
the images of the group and sets their script and one that reads the list
of image ids that I store and then set the scripts with direct
references... both fail in the application but work in the ide.

This looks like it will come down to massive trial and error to solve the
problem... so any ideas on tackling the issue?

By the way the behavior idea failed.

thanks,

Glen

On Wed, Mar 21, 2012 at 4:27 PM, Petep...@mollysrevenge.com  wrote:


Is this another manifestation of not being able to save anything in a stack
in a standalone program?
Pete

On Wed, Mar 21, 2012 at 3:01 PM, Glen Bojszagboj...@gmail.com  wrote:


Hello,

I have a stack where I generate a series of images.

I then set the script of each image to a script that is stored in a

custom

property.

In the ide the script works when you click an image and when you inspect
the image's script in the script editor it is there.

But when I take the stack and make it into an application it looks as if
the images contain no script because when an image is clicked nothing
happens.

I have tried making the script very simple ie

on mouseUp
answer Success with OK
end mouseUp

Again this works in the ide but not in the final application?

I have tried several other methods such as adding a button that I can
manually test in the application to copy a script to an image but this
fails?

Has anybody experienced this before or have any suggestions?

thanks,

Glen
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




--
Pete
Molly's Revengehttp://www.mollysrevenge.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Glen Bojsza
Here is where it gets interesting...

I created a couple of fields and test buttons

one field I add what I want as a script and the button beside it sets the
script of the image (just doing one for now)

the other button reads what the script is from the image into the field
beside it ; also the field I can use to output any mouseUp info from the
image.

when I try to set the script of the image with the following text in the
field it does nothing (does not set the script of the image at all??)

on mouseUp
   lock screen
if exists(img tempPlot) then delete img tempPlot
   copy me
   paste
   set the name of the last img to tempPlot
   set the width of img tempPlot to 727
   set the height of img tempPlot to 255
   set the loc of img tempPlot to the loc of btn locStripChart
   set the lockloc of img tempPlot to true
set the script of of img tempPlot to the plotZoom of stack NM V1
set the tooltip of of img tempPlot to the tempPlotTooltip of stack NM V1
   unlock screen
end mouseUp

When I remove the
lock screen
if exists(img tempPlot) then delete img tempPlot
unlock screen

from the field leaving the following in the field it then sets the image
script AND when I click the image it generates the image expected? But the
new image's script is missing (which is probably the same problem we are
trying to solve currently)

on mouseUP
   copy me
   paste
   set the name of the last img to tempPlot
   set the width of img tempPlot to 727
   set the height of img tempPlot to 255
   set the loc of img tempPlot to the loc of btn locStripChart
   set the lockloc of img tempPlot to true
set the script of of img tempPlot to the plotZoom of stack NM V1
set the tooltip of of img tempPlot to the tempPlotTooltip of stack NM V1
end mouseUP

Remember that all of this works in the ide without any problems??
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Glen Bojsza
Further testing points to my main project stack has the problem... I
rebuilt a smaller stack that creates an image, and derives it's script in
the same fashion as my main stack and it works without any issues.

It's going to be a long night... thanks for the ideas and help but I have
something that is specific to this stack and I don't want to bother anyone
since it won't be reproducible else where.



On Wed, Mar 21, 2012 at 6:02 PM, Glen Bojsza gboj...@gmail.com wrote:

 Here is where it gets interesting...

 I created a couple of fields and test buttons

 one field I add what I want as a script and the button beside it sets the
 script of the image (just doing one for now)

 the other button reads what the script is from the image into the field
 beside it ; also the field I can use to output any mouseUp info from the
 image.

 when I try to set the script of the image with the following text in the
 field it does nothing (does not set the script of the image at all??)

 on mouseUp
lock screen
 if exists(img tempPlot) then delete img tempPlot
copy me
paste
set the name of the last img to tempPlot
set the width of img tempPlot to 727
set the height of img tempPlot to 255
set the loc of img tempPlot to the loc of btn locStripChart
set the lockloc of img tempPlot to true
 set the script of of img tempPlot to the plotZoom of stack NM V1
 set the tooltip of of img tempPlot to the tempPlotTooltip of stack NM
 V1
unlock screen
 end mouseUp

 When I remove the
 lock screen
 if exists(img tempPlot) then delete img tempPlot
 unlock screen

 from the field leaving the following in the field it then sets the image
 script AND when I click the image it generates the image expected? But the
 new image's script is missing (which is probably the same problem we are
 trying to solve currently)

 on mouseUP
copy me
paste
set the name of the last img to tempPlot
set the width of img tempPlot to 727
set the height of img tempPlot to 255
set the loc of img tempPlot to the loc of btn locStripChart
set the lockloc of img tempPlot to true
 set the script of of img tempPlot to the plotZoom of stack NM V1
 set the tooltip of of img tempPlot to the tempPlotTooltip of stack NM
 V1
 end mouseUP

 Remember that all of this works in the ide without any problems??

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Mike Bonner
Might set up a hidden image object with the script already there and just
clone or copy it. That way you don't have to worry about whether its a
scriptlimits issue if nothing else.

On Wed, Mar 21, 2012 at 5:12 PM, Alex Tweedly a...@tweedly.net wrote:

 I'd try adding your 'start' and 'test' buttons to the real stack, and see
 if they work there.
 If they do, add an image 'test1' and have the 'start' button set its
 script as well.
 If that works, try doing that *after* you have created all the other
 images (in case its an issue with total number of script lines set).

 No other ideas yet 
 -- Alex.


 On 21/03/2012 22:52, Glen Bojsza wrote:

 Hi Pete,

 I am not trying to save the new images in the standalone but only show
 them. If the user wants to save the images they are exported as png's.

 But I am now certain that there is something amiss... I can set the
 tooltip
 for the images and it works fine in both ide and the application.

 I have also tried adding a couple of test buttons, one that cycles through
 the images of the group and sets their script and one that reads the list
 of image ids that I store and then set the scripts with direct
 references... both fail in the application but work in the ide.

 This looks like it will come down to massive trial and error to solve the
 problem... so any ideas on tackling the issue?

 By the way the behavior idea failed.

 thanks,

 Glen

 On Wed, Mar 21, 2012 at 4:27 PM, Petep...@mollysrevenge.com  wrote:

  Is this another manifestation of not being able to save anything in a
 stack
 in a standalone program?
 Pete

 On Wed, Mar 21, 2012 at 3:01 PM, Glen Bojszagboj...@gmail.com  wrote:

  Hello,

 I have a stack where I generate a series of images.

 I then set the script of each image to a script that is stored in a

 custom

 property.

 In the ide the script works when you click an image and when you inspect
 the image's script in the script editor it is there.

 But when I take the stack and make it into an application it looks as if
 the images contain no script because when an image is clicked nothing
 happens.

 I have tried making the script very simple ie

 on mouseUp
 answer Success with OK
 end mouseUp

 Again this works in the ide but not in the final application?

 I have tried several other methods such as adding a button that I can
 manually test in the application to copy a script to an image but this
 fails?

 Has anybody experienced this before or have any suggestions?

 thanks,

 Glen
 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode



 --
 Pete
 Molly's Revengehttp://www.**mollysrevenge.comhttp://www.mollysrevenge.com
 
 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode

  __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode



 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Glen Bojsza
I tried a variation of that but for some reason the images aren't taking
the script consistently?

It's like the images sometimes work when they do get a script and other
times it takes several clicks before the script is executed?

I was thinking if there was a way to determine if the user clicks over an
image that is in a group and possible set a script in the group. This would
eliminate scripts limitations and any other possible issues.

I am not sure how to approach this... the group scrolls when there are more
images that can be seen on the screen but I don't think a mouseUp script
for the group is trapped on the scroll bar so that should be fine.

The question is how to determine the image below the mouse when the user
does click?



On Wed, Mar 21, 2012 at 6:23 PM, Mike Bonner bonnm...@gmail.com wrote:

 Might set up a hidden image object with the script already there and just
 clone or copy it. That way you don't have to worry about whether its a
 scriptlimits issue if nothing else.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread J. Landman Gay

On 3/21/12 7:02 PM, Glen Bojsza wrote:


when I try to set the script of the image with the following text in the
field it does nothing (does not set the script of the image at all??)

on mouseUp
lock screen
if exists(img tempPlot) then delete img tempPlot
copy me
paste
set the name of the last img to tempPlot
set the width of img tempPlot to 727
set the height of img tempPlot to 255
set the loc of img tempPlot to the loc of btn locStripChart
set the lockloc of img tempPlot to true
set the script of of img tempPlot to the plotZoom of stack NM V1
set the tooltip of of img tempPlot to the tempPlotTooltip of stack NM V1
unlock screen
end mouseUp


Sure looks like script limits to me. The above counts as 12 lines of 
script. There's a limit of 10 lines.




When I remove the
lock screen
if exists(img tempPlot) then delete img tempPlot
unlock screen

from the field leaving the following in the field it then sets the image
script AND when I click the image it generates the image expected?


After removing 3 lines there are 9 lines remaining, which is within the 
limit.


The on and end lines don't count.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Setting script in object not working...

2012-03-21 Thread Ralph DiMola
I create option buttons on the fly for the Android menu button and iOS menus
from a soft menu button. I have no problem putting a script in them. I do
==set the script of bname to (on mouseup  cr  tab  ProcessMenu 
quote  (item 2 of line I of MenuList)  quote  cr  end mouseup)

This 3 line script works for mobile standalone and in the IDE. Although
looking at it again, I don't know what that tab was for. Shouldn't hurt. Is
this an image control only problem?

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode-boun...@lists.runrev.com
[mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Glen Bojsza
Sent: Wednesday, March 21, 2012 8:48 PM
To: How to use LiveCode
Subject: Re: Setting script in object not working...

I tried a variation of that but for some reason the images aren't taking
the script consistently?

It's like the images sometimes work when they do get a script and other
times it takes several clicks before the script is executed?

I was thinking if there was a way to determine if the user clicks over an
image that is in a group and possible set a script in the group. This would
eliminate scripts limitations and any other possible issues.

I am not sure how to approach this... the group scrolls when there are more
images that can be seen on the screen but I don't think a mouseUp script
for the group is trapped on the scroll bar so that should be fine.

The question is how to determine the image below the mouse when the user
does click?



On Wed, Mar 21, 2012 at 6:23 PM, Mike Bonner bonnm...@gmail.com wrote:

 Might set up a hidden image object with the script already there and just
 clone or copy it. That way you don't have to worry about whether its a
 scriptlimits issue if nothing else.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Mike Bonner
With the mouseup handler at the grouplevel, you can look at 'the target' to
determine which image has been clicked.

 The question is how to determine the image below the mouse when the user
does click?


On Wed, Mar 21, 2012 at 6:48 PM, Glen Bojsza gboj...@gmail.com wrote:

 I tried a variation of that but for some reason the images aren't taking
 the script consistently?

 It's like the images sometimes work when they do get a script and other
 times it takes several clicks before the script is executed?

 I was thinking if there was a way to determine if the user clicks over an
 image that is in a group and possible set a script in the group. This would
 eliminate scripts limitations and any other possible issues.

 I am not sure how to approach this... the group scrolls when there are more
 images that can be seen on the screen but I don't think a mouseUp script
 for the group is trapped on the scroll bar so that should be fine.

 The question is how to determine the image below the mouse when the user
 does click?



 On Wed, Mar 21, 2012 at 6:23 PM, Mike Bonner bonnm...@gmail.com wrote:

  Might set up a hidden image object with the script already there and just
  clone or copy it. That way you don't have to worry about whether its a
  scriptlimits issue if nothing else.
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting script in object not working...

2012-03-21 Thread Glen Bojsza
Well it turns out that Jacque is correct it was the script limits...

I have resolved the first half of my problem as Mike was also correct on
the use of target for the group.

So, I am over the first hurdle with everything working the second hurdle on
how to handle a single new image that is not in a group.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode