Multiple Interfaces
as3 interfaces are easy and fun once you get used to them but what would you think if I told you you can use multiple interfaces at the same time. I know might sound a bit confusing but we've been through so much already that we should be just fine. In this video we continue with our fire example and now create a new interface that will be in charge of playable elements. The idea behind here is that we want an interface that would define what elements are playable(Aka can start and stop in the control of external elements). In other words what objects/classes will have public play/stop functions. By the end of this video we will add this new interface and implement it on the Dog and our new Fire. We then will add new functionality to our Main class where we will randomly animate playable content when the user is not interacting with elements. One of the main things we are learning here is the capability of one item to have more then one interface(there is no real limit to how many) contrary to inheritance that can only have one element in the inheritance line in as3.
Ready to Level Up Your Skills?
Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!
Enroll Now for Free!