Forums > Max For Live

When should a loadbang happen? And should loadbangs happen at the some point?

December 7, 2009 | 8:46 pm

Hello,

M4L … it seems that a loadbang from a ‘loadbang’ object does not happen at the same time as the loadbang within js-object.

imagine the simple js:
function loadbang() { post("this is a js loadbang");}

having this in a M4L device with another native loadbang network that counts up each time a native loadbang happens I see the following.

When I load this loadbangTest-m4l-device (max is running in background) I have a 1 inside the device in Live – no output to the Max console …

if I open the device with the edit button the number stays at 1 and I get a post on the max console from the js …. this happens each time I open the device for editing.

So seems that js loadbangs when the device is opened for editing (according to the stuff I saw in another device I think it will not bang at all when the device is loaded into Live), but it bangs all the time when opening it for editing, which is not that great.

the native loadbang seems to only happen when the device is loaded into Live and not when it is opened for editing …

Is that intended? Why the difference between loadbang and jsLoadbang?

thanks
best


December 7, 2009 | 9:07 pm

I believe that the order for initialization is:

1. parameter enables [M4L objects]
2. pattr
3. objects with a ‘loadbang’ method
4. loadbang objects

I’m sure someone will correct me if I’m wrong.


December 7, 2009 | 9:16 pm

Well,

another interesting question is – at what point we get access to the LiveAPI within a javascript.

for me, trying to access LiveAPI from the setvbalueof-method crashes Live – and that seems to be reproducable. (that would be at point 2 in your list)

Thanks

best


Viewing 3 posts - 1 through 3 (of 3 total)