Tags

Activity Industry Sector
Arts, Media & Entertainment

Activity Originally Created By: Courtney Curtis

Guided Practice

Part of Lesson Plan: Flash Apps: Building an Embeddable Sound Player Part 2 of 5

Activity Overview / Details

Guided Practice

Intro to XML Worksheet

Prior to introducing the content below, download and extract these three worksheets:

Introduction to XML_partners copy to read.pdf

Introduction to XML_blank.pdf

Introduction to XML_answers_teacher_version.pdf

  1. Gather students into pairs and explain that 2 worksheets will be handed out. One person in the pair will read the worksheet titled "Introduction to XML".
  2. Meanwhile the other person will listen to what their group member is saying and fill in the blanks of the 2ndworksheet
  3. Hand out both worksheets to each group. The worksheet titled "Introduction to XML" and the worksheet titled "Introduction to XML(fill in the blanks)"
  4. Give students ample time to completely fill in all the blanks of their team's worksheet.

 

Explain that we will be making an XML Document today to store our playlist for our music player. Then during our next lesson, our XML playlist file will contain all necessary song details in it.

Before Making Our XML Document, We Will Need to Set Up our Files

 

Preparing External Assets

These are the songs we use in this lesson download them here

song info:

track1    -   Tilte: "Party Rock Anthem"      Artist: LMFAO  
track2    -   Title: "Bust a Move"       Artist: Young MC
track3    -   Title: "I Love College Dance REMIX Instrumental"      Artist: Asher Roth

 

The teacher explains...

"Now, we will all need to have some .mp3 files at hand.

For future reference, just know we can also use any .mp3 file we have on your machine, but make sure that it is in .mp3 format and no other as Flash can only play this format."

  1. Have each student download and extract these 3 .mp3 files.
  2. Once each student has their .mp3 files, have them start off by creating a folder for this project somewhere on their computer. Title this folder "sound_player"
  3. Inside this folder have them create a new folder to host their .mp3 files.
  4. Have students name this folder audio.

AS3 Music Player - Audio Folder Created

  1. Inside the audio folder, have students place their three .mp3 files.
  2. To make this easier and to minimize the risk of typos, make sure all students rename their mp3 files to track1, track2, and track3.

AS3 Music Player - Audio Files Inserted

Their .mp3 files are now ready...

Preparing the XML Playlist file

Teacher explains...

"We will create our XML file now. The XML file will play the role of a playlist as it will have the details of the tracks that we want to play. Again, an XML file is essentially a text file with user-defined structured coding. We may use any simple text editor to create our  XML file, but today, we will use notepad."

  1. Have students open the notepad program and save a blank file as playlist.xml in their project folder along with your audio folder.

AS3 Music Player - XML File Created

Teacher explains...

"In the next lesson, we are going to edit our XML playlist file with the information that we need to run our player. Our XML file will have the details of our songs, specifically:

  • The URL of the song file.
  • The title of the song.
  • The name of the artist singing the song.

These will translate into the XML code shown below:"

Just show the students this code, do not have them type or add the code until the next lesson

<?xml version="1.0" encoding="utf-8"?>
<PLAYLIST>
<SONG URL="audio/track1.mp3" TITLE="Party Rock Anthem" ARTIST="LMFAO" />
<SONG URL="audio/track2.mp3" TITLE="Bust a Move" ARTIST="Young MC"/>
<SONG URL="audio/track3.mp3" TITLE="I Love College Dance REMIX Instrumental" ARTIST="Asher Roth" />
</PLAYLIST>

 

Materials / Resource

  • songs.zip songs.zip [ Download ]
  • Introduction to XML_partners copy to read.pdf Introduction to XML_partners copy to read.pdf [ Download ]
  • Introduction to XML_blank.pdf Introduction to XML_blank.pdf [ Download ]
  • Introduction to XML_answers_teacher_version.pdf Introduction to XML_answers_teacher_version.pdf [ Download ]