I have an URGENT problem with the following code. All help appreciated.
public function initializePlugin(vie:AbstractView):void {
view = vie;
view.addControllerListener(ControllerEvent.ITEM, itemHandler);
};
/** Function stores playlist item in variable **/
private function itemHandler(evt:ControllerEvent):void {
curPlayItm = evt.data.index;
//Populate Text Field
var main = view.playlist[curPlayItm]['title'];
var sub = view.playlist[curPlayItm]['tags'];
}
I'm storing the index in a variable and then attempting to access properties of the playlist. 'title' always returns perfectly but attempting to retrieve any ofther playlist property fails (null).
Here;'s my playlist xml;
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<tracklist>
<track>
<title>FINEOS, A Platform for Business Growth</title>
<location>./content/FINEOS_Paddy_Flynn.flv</location>
<image>./content/FINEOS_Paddy_Flynn.jpg</image>
<duration>4:50</duration>
<tags>Paddy Flynn CIO, Friends First</tags>
</track>
<track>
<title>Helping CommInsure go from Good to Great</title>
<location>./content/FINEOS_Julie_Vincent.flv</location>
<image>./content/FINEOS_Julie_Vincent.jpg</image>
<duration>5:43</duration>
<tags>Julie Vincent, Head of Life Insurance Services, CommInsure</tags>
</track>
</tracklist>
</playlist>
Unfortunately, I'm not a Flash developer, so I can't be of much help to you.
The documentation here: http://code.longtailvideo.com/trac/wiki/FlashApi#Plugins1 shows it being done like this:
var title = view.getPlaylist()[1]['title'];