This content has been marked as final. Show 2 replies
I can take a stab at it but it’s hard to say without seeing more code.
attachedObj.display = displayStar;
I assume the variable name “attachedObj” represents an Object (datatype) that is attached/created perhaps by an event (a userclick, enter frame, etc.). The “.display” is a property/attribute of that object. attachedObj can have several of these properties. And you mentioned that “displayStar” is a function. It sounds like that there is a function and variable named “displayStar”. The reason why is that if that was a function it would need to be like this;
attachedObj.display = displayStar();
…and in that function it would have to return a value. However it is not like this. So I am assuming that it’s a variable that perhaps could reside inside displayStar function. Does that help?
Hi and welcome.
When 'displayStar' is a function, the 'display' thing should also be a function type, so I guess it's some event defined in that object's class. It should be a custom class, because Flash's Object class has no 'display' event.
It assigns the function displayStar to the 'display' member, so when this member is triggered, it will execute the displayStar function. It's like a delegate in other languages, or maybe pointers in C++, that way you can connect actions bound to different objects. The 'attachedObj' should be an object of some class and have a 'display' method or event. You should search the class for the places where this is called to see what it's good for (hm, displaying something probably).
Note that the functions don't execute in that line, without the brackets () it's just the name (adress) of the function and no actual call.