1 person found this helpful
Anything that extends UIComponent can have children added to it. If you were to add for example a sprite , a sprite being a DisplayObject but without the mx wrappers around it would have it's enterframe event exposed. You could simply add a listener for this event to the object that calls some sort of global time keeping function. Then just base the xml "cue point" time off the elapsed time from when you added the sprite to the stage and entered frame. Alternatively you could just create a timer utility that starts on creation complete , or application complete of the component, assuming the xml has already been loaded and parsed at this point you could easily set up a differed list of events that will occur in some factor of elapsed time.
Message was edited by: adam york , for clarity
1 person found this helpful
If you only have a handful of these events in your XML file, you could simply create a separate Timer for each individual XML item. An event listener for each Timer's timerComplete event could then trigger an action.
If you need to display the overall progress of these events to the user, you could use a HSlider which updates its thumb position in response to the individual Timer events, or to a "master" Timer running just for this purpose.
These responses have helped me move towards a first attempt at modeling this. I'll lay it out here and ask that you critique it. Here goes:
What I'm really trying to do is develop a system for archiving a presentation (virtual meeting). At first glance it seems to me that an archive is simply an xml file containing the commands that were executed during the original meeting. Maybe it goes something like this:
At the press of a "record" button, begin recording commands to an xml file. Then, at the press of a "stop recording" button, stop recording commands to the file.
Some sample commands would be things like:
0.05 Display view state #1 (large slide show, small video)
0.08 Advance slide show to slide #2
0.15 Start video
0.36 Advance slide show to slide #3
0.52 Stop video
0.52 Change display to view state #2 (Hide video, shrink slide show, and display polling widget)
And so on...
After the archive is created, viewing it might go something like this:
The viewing application must ingest the xml file containing the events, create an array of events, and compare the times for each to the current time. Where current time matches an event time, events get dispatched and handled.
1. On starting the program that plays the archive, ingest the xml event file and create an array of events
2. Create a clock (or stopwatch) class
This is probably not the best way to handle this. But it's a jumping off point. Critiques welcome.