Skip to main content
Participant
May 1, 2014
Question

Label must be an Identifier and Expecting identifier before rightbrace?

  • May 1, 2014
  • 1 reply
  • 196 views

Hi guys, i've become stuck, i'm trying to populate a list box with xml titles can you look at my code and see why i'm getting said errors (see title)

var loader:URLLoader = new URLLoader();

loader.addEventListener(Event.COMPLETE, onLoaded);

var xml:XML;

function onLoaded(e:Event):void

{

          xml = new XML(e.target.data);

          var il:XMLList= xml.channel.item;

          for (var i:uint=0; i<il.length(); i++)

          {

                    lb.addItem({data:il.title.text(),

                              label:il.title.text()}):

                    }

}

loader.load(new URLRequest ("http://www.skysports.com/rss/0,20514,12433,00.xml") );

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 1, 2014

you have a typo:

  label:il.title.text()}):

ends with a full colon, and should be a semi-colon.