Hi all,
I ask you to bear with me, i have been getting really frustrated following a MVC pattern and the vast majority is coming down to how flash handles events.
I cannot grasp and fully understand this section of the flash player.
I know there is searches on this, google and theres books not to mention flex’s own help but perhaps most of my problem is due to reading too much about it by using this method.
Ok i know flash has Event Dispatchers which dispatch events, there is many built in.
I know Event Dispatchers fire an event object which has its own propertys
Listeners listen for event objects.
Thats all i know.
Data.color = 0xffffff;
//change color
Data.color = 0x444444;
Visual.addEventListener(“listen for Data.color to change somehow”, changeColor);
Id try to understand how to do this but the MVC pattern says that the Data class cannot access the Visual class. The Data class has to broadcast events and not care who is listening.
So how can i get Data to broadcast a change in Data.color so Visual can pick up this event and redraw itself?
Any help would be great, but ill probably have more questions about it!
Thanks.