Flash 8 provides a set of components that make it easy to create interactivity in an e-learning course (the newer set of components in Flash are the version 2 or V2 components). One of the things you will need to know to use V2 components is the way Flash loads components and when ActionScript is called from listeners and frames. Here is a scenario that will give you an insight on the use of components in a course:
Scenario: Your course provides “next” and “previous” buttons that let the learner move forward and backward in the course. In Flash, you would have listener functions that process the click events for the ”next” and “previous” buttons. In the listener function for the “next” button you may want to load another part of the user interface in the course (for example, you may want to load a multiple choice question). A good way to load the user interface is to call gotoAndStop(name-of-frame). This frame would contain the components that present a multiple choice question to the learner.
To make sure your course works correctly you should NOT set or get any of the properties of the components immediately after your call to the gotoAndStop() function. However, your components are not fully loaded until the frame with those components is loaded. So, if you need to get or set properties on those components you should do so in code executed from the loaded frame. You should not get or set the properties inside the listener of your “next” button.