Part of Lesson Plan: Flash Apps: Building an Embeddable Sound Player Part 2 of 5
Activity Overview / Details
Overview
Explain to students that throughout the next few days, they will learn how to create an XML music player using AS3.
Because our music player uses a markup language called XML, today, we will need to learn a little bit about XML.
Teacher explains...
"The songs to be played in our player will be specified in an external file so that the player loads each song as required. The songs in the player can be updated by simply updating the external playlist file so that you do not have to go back to the FLA each time to update your music player when you want to change your songs around."
In this lesson, we will learn and make use of a few types of classes. .. the XML Class and the Sound Class .
We will also learn more about event handling, conditionals and functions.
Vocabulary
Teacher should hand out this vocabulary sheet which explains not only the key terms listed below, but also ones used in the prior lesson
Lets first learn a few of these terms...
Flash Movie
An animation in the Flash format that uses the .SWF extension. This doesn't actually mean it plays a movie or movie files.
Runtime
When a program is running, or executing, it is said to be in runtime.
XML
Extensible Markup Language ( XML) is a set of rules for encoding document. XML was designed to transport and store data. Dont get it confused with HTML. HTML was designed to display data.
Loader Class
So again, the songs to be played in our player will be specified in an external file so that the player loads each song as required. We will use the Loader Class to do this...
The Loader Class is an ActionScript class that lets us load external assets (such as images and Flash files) at run time onto a Flash movie. Using such technique makes our Flash song player more efficient as you load specific music files only when needed instead of embedding them regardless of whether the user ends up listening to them or not. Separating our final, embeddable movie into distinct sections loaded at run time makes the website easier to update as you can update the external assets without going back to the main FLA. So we will learn to use the Loader Class to load an external asset, which in our case is our XML file.
Event Handling
Event handling is the process by which any sort of interactivity is created in ActionScript 3.0. You could make your Flash movie jump to life, whether it was by reacting to a mouse click, a keyboard stroke, or any event happening in Flash using the Event Handling system of AS3.
Conditionals
Conditionals are special tools that add logic to an ActionScript program by taking an action only upon the satisfaction of a specified condition. Conditionals are easy to understand and are guaranteed to appear in any ActionScript project you work on. The most commonly used conditionals are the "if" conditional and the "else" and "else if" conditionals.
Function
Functions are a powerful feature in ActionScript that make it possible to reuse blocks of code throughout a flash movie in great flexibility. Using functions saves the programmer a massive amount of time, they can be used to centralize the code so that everything can be controlled, edited and updated from a single point and they also make the code much more easier to read by other people. There are two types of functions in ActionScript: built-in functions and custom functions.
W3C
The World Wide Web Consortium (W3C) is an international community where Member organizations, a full-time staff, and the public work together to develop Web standards. Led by Web inventor Tim Berners-Lee and CEO Jeffrey Jaffe, W3C's mission is to lead the Web to its full potential.
Materials / Resource
Sound Player Vocabulary Sheet 1.pdf
[
Download
]




