leoj3n/Capstone — Issue #3: Communication between Avatar.js and Video.js
Author: leoj3n
Created: 2012-03-05 09:47:56+00:00
State: open

Currently Video.js sets and uses a variable called `parentScript` which points to the parent Avatar.js script. This variable is then used to call getter member functions of Avatar.js. So, at the moment, Video.js asks Avatar.js if the avatar is jumping, firing, etc... and then plays the appropriate video.

Another way to accomplish the same functionality would be for Avatar.js to have reference to Video.js via a variable called `childScript` and then to call `childScript.SetTexture( ... )`.

So the two options are:
1) The child asks the parent what to do.
2) The parent tells the child what to do.

Currently it isn't clear which option is best or if there's another better solution altogether.

This issue will remind us of our options and be a place for discussion if we start running into problems with the current "child asks parent" method.