Working with behaviour scripts
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Working with behaviour scripts
Kia ora,
Due to all the random problems with respect to my previous question about building standalone applications with script only stacks and behaviours, I'm just going to try building` it up bit by bit.
My first question is why does this sample application sometimes work when run in livecode (not as standalone) and sometimes not?
Sometimes it has an error when I click the button, when it calls the handler in the stack behaviour script.
So my guess is that sometimes the stack script is not loaded somehow?
Due to all the random problems with respect to my previous question about building standalone applications with script only stacks and behaviours, I'm just going to try building` it up bit by bit.
My first question is why does this sample application sometimes work when run in livecode (not as standalone) and sometimes not?
Sometimes it has an error when I click the button, when it calls the handler in the stack behaviour script.
So my guess is that sometimes the stack script is not loaded somehow?
- Attachments
-
- ScriptOnly.zip
- two files, a livecode file and a livecodescript file
- (1.88 KiB) Downloaded 177 times
Re: Working with behaviour scripts
Just tried your sample out.
On first try the script only file was not found, the Stack Files tab in the main stack properties shows this,
Creating and moving the script only file to the Scripts folder had everything working as expected and I could not get it fail.
On first try the script only file was not found, the Stack Files tab in the main stack properties shows this,
Creating and moving the script only file to the Scripts folder had everything working as expected and I could not get it fail.
Andy .... LC CLASSIC ROCKS!
Re: Working with behaviour scripts
Thanks for trying it out.
I originally had that file in the scripts folder but moved it out to produce an even simpler version for testing. However it didn't work for me consistently when it was in the Scripts folder either.
I just cannot get this whole script only thing to work with any degree of reliability no matter what I do and can find very little information about it.
I originally had that file in the scripts folder but moved it out to produce an even simpler version for testing. However it didn't work for me consistently when it was in the Scripts folder either.
I just cannot get this whole script only thing to work with any degree of reliability no matter what I do and can find very little information about it.
Re: Working with behaviour scripts
Good to check that the paths are correct in the stack files tab of the stack inspector though. That's something to remember to look at.
Re: Working with behaviour scripts
Moving on from the previous example, I tried adding a script-only stack behaviour for the card.
When I try to create a standalone application however it has an error message
When I try to create a standalone application however it has an error message
- Attachments
-
- ScriptOnlyTest4.zip
- (2.08 KiB) Downloaded 168 times
Re: Working with behaviour scripts
Ok so I used this page to understand the error codes
Because then it did build ok (although then livecode got stuck in a continuous loop telling me that the stack was already open and did I want to cancel/save/purge like it usually does when I try to build a standalone, and eventually I had to use task manager to kill it. I still don't know what causes that problem. )
and then changed the line it was having a problem with to refer to the card and stack
Although the line worked fine without that level of reference within livecode itself, it seems to be what was stopping it from building the standalone?set the visible of button "btnOne" of card "cardFront" of stack "ScriptOnlyTests" to true
Because then it did build ok (although then livecode got stuck in a continuous loop telling me that the stack was already open and did I want to cancel/save/purge like it usually does when I try to build a standalone, and eventually I had to use task manager to kill it. I still don't know what causes that problem. )