Link to Home page
Link to Products page
Link to Articles page
Link to Links page Link to Contact page  
 

 

HOME>ARTICLES>GETTING STARTED WITH SCORM AND FLASH
Page 1 - 2 - 3
 

 

1. Creating a Flash Movie

For the purposes of this tutorial, we shall create a dummy SCO using Macromedia Flash.

Figure 1. There are three key-frames in this timeline, labelled "start", "body" and "finish". The start and finish frames just display text saying "starting" and "finished!", while the body frame contains two buttons, labelled 'Correct' and 'Incorrect' and a dynamic text field - selected in this screenshot - which displays a variable called 'question'.

This SCO will display three questions, with two marks for each question. For each question, giving an incorrect response will lose a mark; giving a correct response first time will score 2/2 for the question; giving a correct response second time round will score 1/2. Giving two incorrect responses will score 0/2 and move the student on to the next question.

This is a simple scoring scheme which will be sufficient for this tutorial; but bear in mind that SCORM will support much richer assessment models if that is what your learning content requires.

Figure 2. Add the ActionScript shown to the first frame which is labelled 'start'. This code creates two variables: question contains the number of the current question (1, 2 or 3) and is displayed in the dynamic text field mentioned above; current_marks contains the number of marks available for the current question. This starts at 2, and is reset to 2 each time the student moves to a new question; but is decremented by 1 each time an incorrect response is given.

The script also contains two functions. The first, mark(), calls the Flash function fscommand. This provides the standard way of passing data out of the Flash movie to the outside world. It takes two parameters: the first, command is set to 'mark' - this is a bit of text chosen by the author to describe what sort of action is occurring; the second, parameters, is used to pass out a list of comma-separated values to tell the outside world, in this case, what marks are being given. This implementation passes three values: the question number, the number of marks scored, and the total marks for the question, which is always 2. So if the student scores 1/2 on the third question, the following call will be made: 'fscommand("mark", "3, 1, 2")'. Having issued the fscommand, the question number is incremented and the number of marks available is reset to 2. Finally, if we have reached the end of the SCO (question is more than 3), the student is sent to the 'finish' frame, else the student is sent back to the 'body' frame.

The second function, assess(isCorrect), is called each time the student presses a button. If the student has pressed the 'Incorrect' button, then the number of marks available for this question is decremented. If the student has clicked the 'Correct' button, or if the number of marks available is now 0, the mark() function is called.

Figure 3. Wire up the two buttons in the body frame. Each button calls the assess(isCorrect) function when pressed; the Correct button calls assess(true) and the 'Incorrect' button calls assess(false).

Remember also to include a stop() command in this frame, so that the first time the movie runs, it stops on this frame to wait for user input.

In the final frame of the movie, add another fscommand call, this time fscommand("finish", ""). This will allow you to get the LMS to close the unit automatically when the animation has terminated.

Figure 4. You are now ready to publish the movie. Publish to Flash and Html, on the HTML page selecting 'Flash with FSCommand' and turning off the Loop checkbox.

See how the dummy SCO behaves here, or download the editable Flash file at the bottom of this (long) page. So far, of course, the SCO is not linked up to any LMS.

Continue to page 2.

 
 
Alpha Learning's logo

infrastructure
for e-learning

 
 
Copyright © Alpha Learning 2008. All Rights Reserved