I need a simple digital clock, but did not find any such standard component. Then using Timer and Date class I tried to create a Digital Clock in ActionScript.
Solution
I used Timer and Date class to implement this clock. The clock also has the functionality to dispatch events for (every second, every minute, every hour). This clock can be extended to add other functionality as well.
Working with events in AS3 isn't as easy as it used to be in the past. While you need to monitor every event in your application there is no real easy way to do it without manually remembering all of your events and remembering to remove them on a one by one bases(ohi so much work...).
With all the new features and powers of AS3 came a lot of leg work. So many classes out there tried to tackle this issue from many interesting and different directions. But most of them demand a large learning curve and a big shift in the way you would interact with your code, some through a framework that locks you into a development style, some changed the way flash handles events.
Solution
Essentially Event Controller is an easier way to keep track of events in actionscript 3. Event Controller is a simple extension to your normal workflow that allows you to easily tag, group and remove any and all events, pause events and restore them when you want them back and more.
We know that there are many great solutions out there from very talented people. But we wanted to bring out another option the most simple one we could think about and we are with our ears to the community(so far in our 3rd revision) to making it even easier. The goal is to create the most simple yet feature rich event hub. Let unknown leaks be a thing of the past by taking our library out for a spin.
We know how to do it with functions how to set a default value when nothing comes through but what about variables such as in scenarios of flash vars where we just don't know until run time if we are going to get the variables or not.
Solution
Like anything cool in the world of programing there are a few options. The first is a traditional if statement asking our variable if its empty or not but then that wouldn't be such a cool trick if that was the full solution. come join in this is really cool...
Sometimes we need to be noticed when something such as a click on a button or when a new contact is added to our electronic schedule, for example. In these cases, Events are very useful and creating our custom ones we can listen to specific operations.
Solution
Building custom events we can verify specific operations that are happening in our app and make our code reusable for others.
When you develop applications inside the Flash IDE you can see all the trace output inside Trace panel of IDE. However, there are lots of cases when you need to test your applications in browser and not as a standalone application. This makes impossible reading trace output and makes debugging your applications hard.
Solution
To see trace output outside the Flash IDE you need external application. In this article we will use applications called Vizzy.
You can see trace statements in the output window within Flash. You can also use a debugger for this however what if you can't install them or have no access to get them?
Solution
Here's an option... tracing on stage. Create a text field and trace to the stage. I hope this is a good alternative to people who wouldn't want to install anything else.
This site is produced in partnership with O'Reilly.