I have a stack with several nested objects that use behaviours, since group of them share the same scripts.
Now, I was able to mess things up and found that, here and there, there are objects that don't link anymore to an existing behaviour (red on the project browser).
Is there a way to obtain a list of these unlinked objects, so that I can fix them? (that is, put the correct path for the behaviour)
Thanks
Find broken behaviours
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Find broken behaviours
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Find broken behaviours
Hi,
One way i use to find broken behaviors path for one card
Best regards
Jean-Marc
One way i use to find broken behaviors path for one card
Code: Select all
function getListControlsBadBEH
put empty into rListControlsBadBEH
repeat with i = 1 to the num of controls
put the short name of control i into tName
put the behavior of control i into tBEH
if tBEH = empty then next repeat
if there is a tBEH then
next repeat
else
put the short name of this cd &"," & tName & "," & tBEH & cr after rListControlsBadBEH
end if
end repeat
return rListControlsBadBEH
end getListControlsBadBEH
Jean-Marc
https://alternatic.ch
Re: Find broken behaviours
You can also look in the project browser.
Objects with a behaviour script have an extra icon over on the right hand side, which will let you edit the script if you double click it.
If it doesn't have the icon and it should, you can go into the property inspector and link it back up.
Good Luck
Kelly
Objects with a behaviour script have an extra icon over on the right hand side, which will let you edit the script if you double click it.
If it doesn't have the icon and it should, you can go into the property inspector and link it back up.
Good Luck
Kelly
Re: Find broken behaviours
Thanks Kelly, I knew about that.
But when they are deeply nested it is a pain to find them, particularly because the project browser is so crude
But when they are deeply nested it is a pain to find them, particularly because the project browser is so crude
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: Find broken behaviours
Then a script would be the route to go. The script could check if the control is on a list of objects that need behaviour 1 or 2 and then set the behaviour accordingly in the script. If you don't want to make a list of objects, you could use a custom property in each object with the name of the behaviour it should have. The script could then loop through every object, and if it had the magic property it would be reconnected to it's behaviour automagically.
An "automated" repair button if you will.
An "automated" repair button if you will.