Using behaviors within Create

I have an app with most of my behavior scripts stored in script-only stacks which are attached as sub-stacks to the main stack. So two questions please:

  1. Are sub-stacks supported (or going to be supported) using Create?

  2. If not, am I right in thinking that all of my behaviors will now need to be stored as button scripts, and if so will this work using the widget button within the Create framework?

  3. Are there any other aspects of Create that will affect how behaviors work?

Thanks.

1 Like

I’m also wondering how to use ā€˜.livecodescript’ in Create. They are essential for using Git, for example.

Yes, substacks will continue to be supported in Create. All behaviors can continue to work the same and you can continue to use .livecodescript files.

Nothing is being taken away in Create, there are new concepts but it is fully compatible with what you have.

Initially you will need to use Native for this though as it is not implemented in Web yet.

Thank you for your reply,
I’ve just managed to integrate a substack into a Create project. I didn’t succeed the last time I tried. In fact, the following code :

on preopenstack
   start using stack (specialfolderpath("Desktop")&"/testlc.livecodescript")
end preopenstack

It works, but the preopenstack doesn’t seem to be executed either when you open the project or when you click on ā€œrunā€.
To make it work, the only solution I’ve found is :

  1. Create a second Layout
  2. Open it using the Project Browser
  3. Open the first layout again

In this case, the preopenstack of the Layout 1 script is executed and the reference to the livecodescript is added to the Project Browser!

I don’t know if this is a bug or simply a minor refinement flaw, but it’s disturbing my old ā€œlivecoderā€ reflexes.

As for Behavior, I suppose it’s possible to integrate them via script. I’ve also come across a setting (similar to the one in the classic IDE) in the Property Inspector, but it doesn’t seem to work…

Can’t wait to see the new documentation :grin:

Thanks for the report! @smunos I can confirm this is a bug. I have filed it and we are working towards a resolution. Check back here for an update on when this is fixed!

Thank you for taking the time to help us improve LiveCode Create.

I appreciate your responsiveness, which bodes well for the future!
Concerning the bug, does it concern the behavior button or the preopenstack ?

Behaviours haven’t changed and will continue to work the same so you will not need to store your behaviours as button scripts or change how they are set up.

The preopenstack behaviour is a bug though. In future it will be executed as soon as the project is opened and you won’t have to switch between layouts to trigger it.

1 Like