3 Replies Latest reply on Feb 22, 2012 7:31 AM by Ned Murphy

    Implicit coercion of a value of type fl.controls:ComboBox to an unrelated type XMLList

    JJ0330 Level 1

      Hi, new to Flash and working on a school assignment and don't understand the error in yellow below.  Below is the code snippets of two function involved.  Thanks, Joe

       

       

      Error:

      Implicit coercion of a value of type fl.controls:ComboBox to an unrelated type XMLList.                                             

       

      Code:

                                        private var _feed_list:ComboBox;

       

       

      private function done_loading(e:Event){

                                                      var feed_xml:XML = new XML(e.target.data);

                                                      var feed_items:XMLList = feed_xml.*;

                                                      populate(_feed_list);

                                                      var match:Boolean = false;

                                                      for(var i=0;i < _feeds_dp.length;i++){

                                                                      if(_feeds_dp.getItemAt(i).link == feed_xml.@link){ 

                                                                                      match = true;

                                                                      }

                                                      }

       

      private function populate(xml:XMLList){

                                                      var count:int = 1;

                                                      for each(var item:XML in xml.item){

                                                                      var t:String = item.title == '' ? item.link:item.title; 

                                                                      _feeds_entries_dp.addItem({

                                                                                                                                                                         label:t+', '+item.date,

                                                                                                                                                                         link:item.link,

                                                                                                                                                                         preview:item.preview,

                                                                                                                                                                         description:item.description,

                                                                                                                                                                         date:item.date,

                                                                                                                                                                         time:item.time,

                                                                                                                                                                         author:item.creator,

                                                                                                                                                                         media:item.media

                                                                                                                                                                         });

                                                                      _feed_entry_list.labelField = 'label';

                                                                      _feed_entry_list.dataProvider = _feeds_entries_dp;

                                                      }

                                      }