This MovieClip shows the list of available songs to play and also customises the application to have a different look from the other view.



The Soft Keys component is customised to have a different look:

softkeys_sks._isBackgroundVisible = true;
softkeys_sks._MSKTextColor = 0x151616;
softkeys_sks._RSKTextColor = 0x151616;
softkeys_sks._LSKType = "empty";
softkeys_sks._MSK = "Play";
softkeys_sks._RSK = "Back";

The List Single-row component (listMP3Files_lst instance) is used to create a playlist with available songs on the user's phone. A song can be played by pressing MSK with this view opened.

Since the content of the list is dynamic (it depends on the existing songs in the phone), the initialisation of the component is done by code with the following method:

listMP3Files_lst.addItems(mp3FileNames);

The mp3FileNames parameter is an array defined and populated by the application with the result of the search of .mp3 files on the memory card in the phone.

The Empty list text, Disabled highlight text color, Highlight color and Scroll slider color properties of the instance are customised via the Parameters panel (Window > Properties > Parameters) with the values:

Property Value
Empty list text "No MP3 files found."
Disabled highlight text color "#87BFE1"
Highlight color "#0090FF"
Scroll slider color "#0090FF"

When the user presses MSK with the list opened, the onSelect event is dispatched. The event handler is associated with the songSelected method, so this method is executed once each time onSelect is dispatched:

listMP3Files_lst.onSelect = songSelected;

The initially highlighted item on the list will be the currently opened media file:

       listMP3Files_lst._highlightPosition = _root.songIndex;