Behaviors not behaving

Scott Rossi scott at tactilemedia.com
Mon Dec 1 13:47:47 EST 2014


From what you describe, there may be a timing thing going on as you suggest (controls opening before their behaviors are available).  You say your plugin “creates an application stack file” so another thing to check is correct behavior references applied to your controls.

If your behaviors need to initialize at all, you should double check your initializing routines are taking place — if not, there may be some script error/failure going on that’s not triggering a standard alert.

Another “trick” you might try is to force the behaviors to resolve after all stacks are open by running a loop through all controls that use behaviors and set the behavior of each control to its behavior.  Kind of goofy but assuming there are no reference issues, it should work.

Regards,

Scott Rossi 
Creative Director 
Tactile Media, UX/UI Design 

On Dec 1, 2014, at 10:31 AM, Peter Haworth <pete at lcsql.com> wrote:

> I'm working on a system that consists of a plugin, a library stack file and
> a stack file containing buttons with behavior scripts.
> 
> The plugin creates an application stack file plus various controls within
> it that have their behaviors set to the buttons in the behavior stack file.
> 
> Since the behaviors are not in the application stack file, I set the
> stackFiles property of the application stack to have an entry referencing
> the behaviors stack file.
> 
> That setup all works fine most of the time, behaviors are resolved as they
> should be. However, on any subsequent runs of LC, if I open the plugin
> first then open the application file, none of the behavior scripts fire.
> All works fine if I open the application stack file first followed by the
> plugin.
> 
> There are no references to the behaviors stack file in any of the plugin
> scripts or the library stack scripts and the plugin's stackFiles entry is
> empty as is the library stack's.
> 
> I tried opening the behaviors stack file in the plugin so that it would be
> open when I opened the application stack but the behaviors still did not
> fire.
> 
> What could there be in the plugin stack that would interfere with the
> resolution of behaviors in the application stack?
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list