Cant access the properties of a FeatureLayer

Discussion created by krister on Oct 7, 2010
Latest reply on Oct 11, 2010 by krister
I´m working with ArcGIS Server 10 and the JavaScript API v2.1 and I'm trying to access the properties (name, fields etc) of a featureLayer but it seems like I get no reference to the featureLayer. When I try to alert the name (... or other properties) i get "undefined". This is kind of what I´m doing in code (JavaScript)...

var featureLayer=new esri.layers.FeatureLayer("", {mode: esri.layers.FeatureLayer.MODE_SELECTION});


Am I missing something... ??