hi away3d community,
i hope this question isn’t too low level. i’ve got two objects, A and B. A has data that needs to be delivered to B. my friend thinks its okay to use events to pass the data, since C and D also need it. shouldn’t i just use some sort of data passing function? like:
B.setFoo(A.bar);
C.setFoo(A.bar);
D.setFoo(A.bar);
rather than
B.addEventListener(BarEvent.CONSTANT, onBar);
C.addEventListener(BarEvent.CONSTANT, onBar);
D.addEventListener(BarEvent.CONSTANT, onBar);
A.dispatch(new BarEvent(BarEvent.CONSTANT, foo));
??
i ask it here because in Camera3D, LensEvent appears to be doing the latter and my friend is using this as a justification for what i suspect is incorrect programming practice.