Events with Flash CS3 – How to use them to create complex effects (Part 1).
Events are a powerful tool when it comes to programming in actionscript: they’re commonly used to implement a broad range of features, ranging from preloaders to incoming data handling.
However, if you worked a fair bit with them, you probably know that some problems are hard to solve just with events as they are currently implemented. What if you want the event to change the properties of a target different to the one that started it? What if you want a certain action to fire up only after 2 events happened? This is the problem you’ll stumble upon when trying to create a matching images game, where you’ll have to check if the images the player selected are the same after 2 cards have been turned, but it’s just one of several examples.
The solution is rather simple in both cases with some coding, but when you need to manage x different events for y different graphical elements, it’ll be necessary to expand the CS3 event base with a solution like the one I’ll be illustrating now.