* Melchior FRANZ -- Sunday 12 October 2008:
> The usage of cmdarg() in listener callback functions was deprecated
> since a while. Now it's no longer supported and will cause an error
> message.

Correction: it won't cause an error, but (still) return the last
cmdarg() property. This just won't be the listened-to property
anymore, but whatever the last legitimate cmdarg() user set. Most
of the time it will be the property root of a joystick binding.
So, don't make any assumptions and use cmdarg() only in one of
these cases:

 binding: returns root of this binding's property branch. Needed
          for accessing an axis' value:
          cmdarg().getNode("setting").getValue()

 dialog xml files: returns root of that file's property branch
          in memory. This can be used to let embedded Nasal change
          the dialog (e.g. clear and build lists) before the
          final layout is decided

 animation xml files: returns root of this model's place in
          /ai/models/ when used as AI/MP model. Examples:
          /ai/models/multiplayer[3], /ai/models/tanker[1], etc.

In all cases the cmdarg() call must not be delayed until later
using settimer() or setlistener(). Because later it'll again
return some unrelated property.

m.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to