Typeerror error 1010 a term is undefined and has no properties

The counter displays sprites in place of number values. More experienced programmers have given me a clue. Why am I getting error # 1010. Secondly, what am I not seeing that's so obvious? I wish I...

The counter displays sprites in place of number values. More experienced programmers have given me a clue. Why am I getting error # 1010.

Secondly, what am I not seeing that’s so obvious? I wish I went in to this with a better foundation in actionscript 3, but I’m reading and doing my best.

WHAT I SEE
-dollar sign indicates a variable or array «$numbers»
-import flash.utils.Dictionary; «indicates an associative string»
-Error #1010: A term is undefined and has no properties
-is the associative string is fooling me? «maybe I set no values, duh»
-are the property of my symbols are set wrong?

numbers.fla
-MovieClip named «mc-NumberImage» Class «NumberImage»
-Bitmaps «number_0.jpg to number_9.jpg»

NumberDocumentClass.as «NumberDocumentClass»

package {
 import flash.display.Sprite;
 import flash.utils.Timer;
 import flash.events.TimerEvent;

 public class NumberDocumentClass extends Sprite {

  private var timer:Timer = new Timer(10);
  private var count:int = 0;
  private var fcount:int = 0;
  private var numbers:NumbersView;

  public function NumberDocumentClass() {
   timer.addEventListener(TimerEvent.TIMER, incrementCounter);    
   timer.start();   
   numbers = new NumbersView();
   addChild(numbers);
  }

  function incrementCounter(event:TimerEvent) {    
   count++;    
   fcount=int(count*count/1000);//starts out slow... then speeds up   
   numbers.setTime(formatCount(fcount));
  }  

  function formatCount(i:int):String {   
   return ("000000000" + i).substr(-9, 9); 
  } 
 }
}

NumbersView.as

package  
{
 import flash.display.DisplayObject;
 import flash.display.MovieClip;
 import flash.utils.Dictionary;
 import flash.events.Event;
 import caurina.transitions.Tweener;


 public class NumbersView extends MovieClip
 {

  private var _listItems:Array = new Array();


  public function NumbersView() 
  {
   var item:NumberImage;
   for (var i:Number = 0; i < 9; i++) {
    item = new NumberImage();
    addChild(item);
    item.x = i * item.width;
    _listItems.push(item);
   }

  }


  public function setTime($number:String):void {
   var nums:Array = $number.split("");
   for (var i:Number = 0; i < nums.length; i++) {
    if (int(nums[i]) == 0) {
     Tweener.removeTweens(_listItems[i].moveableNumber_mc);
     if (_listItems[i].moveableNumber_mc.y < 0) {
      _listItems[i].moveableNumber_mc.y = 120;
     }
     Tweener.addTween(_listItems[i].moveableNumber_mc, { y: 0, time:.3 } );
    } else {
     Tweener.addTween(_listItems[i].moveableNumber_mc, { y: -120 * int(nums[i]), time:.3} );
    }
   }
  }

 }

}

ERROR MESSAGE

TypeError: Error #1010: A term is undefined and has no properties.
    at NumbersView/setTime()
    at NumberDocumentClass/incrementCounter()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

Icon Ex Номер ошибки: Ошибка 1010
Название ошибки: Adobe Flash Player Error 1010
Описание ошибки: Error #1010: A term is undefined and has no properties.
Разработчик: Adobe Systems Inc.
Программное обеспечение: Adobe Flash Player
Относится к: Windows XP, Vista, 7, 8, 10, 11

Анализ «Adobe Flash Player Error 1010»

Эксперты обычно называют «Adobe Flash Player Error 1010» «ошибкой времени выполнения». Когда дело доходит до Adobe Flash Player, инженеры программного обеспечения используют арсенал инструментов, чтобы попытаться сорвать эти ошибки как можно лучше. Хотя эти превентивные действия принимаются, иногда ошибки, такие как ошибка 1010, будут пропущены.

Ошибка 1010 может столкнуться с пользователями Adobe Flash Player, если они регулярно используют программу, также рассматривается как «Error #1010: A term is undefined and has no properties.». Таким образом, конечные пользователи предупреждают поставщиков о наличии ошибок 1010 проблем, предоставляя информацию разработчику. Adobe Systems Inc. вернется к коду и исправит его, а затем сделает обновление доступным для загрузки. Если есть запрос на обновление Adobe Flash Player, это обычно обходной путь для устранения проблем, таких как ошибка 1010 и другие ошибки.

Что генерирует ошибку времени выполнения 1010?

Сбой во время запуска Adobe Flash Player или во время выполнения, как правило, когда вы столкнетесь с «Adobe Flash Player Error 1010». Вот три наиболее распространенные причины, по которым происходят ошибки во время выполнения ошибки 1010:

Ошибка 1010 Crash — Номер ошибки вызовет блокировка системы компьютера, препятствуя использованию программы. Эти ошибки обычно возникают, когда входы Adobe Flash Player не могут быть правильно обработаны, или они смущены тем, что должно быть выведено.

Утечка памяти «Adobe Flash Player Error 1010» — этот тип утечки памяти приводит к тому, что Adobe Flash Player продолжает использовать растущие объемы памяти, снижая общую производительность системы. Возможные причины включают сбой Adobe Systems Inc. для девыделения памяти в программе или когда плохой код выполняет «бесконечный цикл».

Ошибка 1010 Logic Error — Логические ошибки проявляются, когда пользователь вводит правильные данные, но устройство дает неверный результат. Это видно, когда исходный код Adobe Systems Inc. включает дефект в анализе входных данных.

Adobe Systems Inc. проблемы файла Adobe Flash Player Error 1010 в большинстве случаев связаны с повреждением, отсутствием или заражением файлов Adobe Flash Player. В большинстве случаев скачивание и замена файла Adobe Systems Inc. позволяет решить проблему. Мы также рекомендуем выполнить сканирование реестра, чтобы очистить все недействительные ссылки на Adobe Flash Player Error 1010, которые могут являться причиной ошибки.

Типичные ошибки Adobe Flash Player Error 1010

Наиболее распространенные ошибки Adobe Flash Player Error 1010, которые могут возникнуть на компьютере под управлением Windows, перечислены ниже:

  • «Ошибка программного обеспечения Adobe Flash Player Error 1010. «
  • «Adobe Flash Player Error 1010 не является приложением Win32.»
  • «Возникла ошибка в приложении Adobe Flash Player Error 1010. Приложение будет закрыто. Приносим извинения за неудобства.»
  • «К сожалению, мы не можем найти Adobe Flash Player Error 1010. «
  • «Отсутствует файл Adobe Flash Player Error 1010.»
  • «Проблема при запуске приложения: Adobe Flash Player Error 1010. «
  • «Не удается запустить Adobe Flash Player Error 1010. «
  • «Adobe Flash Player Error 1010 выйти. «
  • «Неверный путь к программе: Adobe Flash Player Error 1010. «

Проблемы Adobe Flash Player Adobe Flash Player Error 1010 возникают при установке, во время работы программного обеспечения, связанного с Adobe Flash Player Error 1010, во время завершения работы или запуска или менее вероятно во время обновления операционной системы. Отслеживание того, когда и где возникает ошибка Adobe Flash Player Error 1010, является важной информацией при устранении проблемы.

Источники проблем Adobe Flash Player Error 1010

Большинство проблем Adobe Flash Player Error 1010 связаны с отсутствующим или поврежденным Adobe Flash Player Error 1010, вирусной инфекцией или недействительными записями реестра Windows, связанными с Adobe Flash Player.

Точнее, ошибки Adobe Flash Player Error 1010, созданные из:

  • Поврежденная или недопустимая запись реестра Adobe Flash Player Error 1010.
  • Вирус или вредоносное ПО, которые повредили файл Adobe Flash Player Error 1010 или связанные с Adobe Flash Player программные файлы.
  • Другая программа (не связанная с Adobe Flash Player) удалила Adobe Flash Player Error 1010 злонамеренно или по ошибке.
  • Другая программа, конфликтующая с Adobe Flash Player Error 1010 или другой общей ссылкой Adobe Flash Player.
  • Неполный или поврежденный Adobe Flash Player (Adobe Flash Player Error 1010) из загрузки или установки.

Продукт Solvusoft

Загрузка
WinThruster 2022 — Проверьте свой компьютер на наличие ошибок.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление

Today I spent hours tracking down a bug related to inserting and/or deleting data from a Tree control. In certain circumstances, an update to the underlying dataProvider would cause the following to be reported:

TypeError: Error #1010: A term is undefined and has no properties.
at mx.controls.listClasses::ListBase/makeRowsAndColumnsWithExtraRows()

After a bit of Googling, I found that I am not alone. Other folks have the same issue with Tree. Even more common, it looks like people are getting the same error when manipulating data in an AdvancedDataGrid, in which case it is reported as:

TypeError: Error #1010: A term is undefined and has no properties. at mx.controls.listClasses::AdvancedListBase/makeRowsAndColumnsWithExtraRows()

After drilling down into the Flex Framework source and exploring the makeRowsAndColumnsWithExtraRows function, I added some watch expressions in the Flash Builder Debug pane. (The debug features are really, really useful for this kind of thing.) The culprit? The value for verticalScrollPosition was being reported as -1, causing a line of code to look for an array element at index -1. This array element was in turn undefined, so the error message suddenly makes perfect sense.

The real puzzler here is that verticalScrollPosition could ever be less than zero. This is the logical equivalent of scrolling to the top of the list, then scrolling up one more spot, which is of course impossible. In any case, I have decided to assume that -1 is invalid at all times, and that -1 really means 0. I hope that is a safe assumption!

So, the solution is simple. In my case I had already subclassed the Tree control. If you’re using the stock control from the framework, you’ll need to subclass it and simply add the following:

override public function get verticalScrollPosition():Number
{
return Math.max(0, super.verticalScrollPosition);
}

All it does is intercept any request for verticalScrollPosition and guarantee that it is greater than or equal to zero. In brief testing, the error has disappeared and I have seen no side effects.

Like anything else on this blog, use this fix at your own risk, since I can’t guarantee it won’t have any negative impact.

Happy coding!

private function init():void    {     graphicsLayer = new GraphicsLayer;     map.addLayer(graphicsLayer);     srv.send();    }        private function resultHandler(event:ResultEvent):void    {    myXML = event.result.myXML.entry;           var gArr:Array = [];    var graphics:Array = [];    for each (myObject in data) {     latlong = Number(myObject.point.toString());                 myPoint = new MapPoint(latlong);          var uGraphic:Graphic = new Graphic (myPoint);     gArr.push(myPoint);     graphics.push(uGraphic);    }     var outSR:SpatialReference = new SpatialReference(3857);    geometryService.project(gArr, outSR, new AsyncResponder(projectCompleteHandler, null, graphics));    }        protected function projectCompleteHandler(result:Object, token:Object):void    {     var pRslts:Array = result as Array;     for (var pg:int = 0; pg < pRslts.length; pg++){      var pGeom:Geometry = pRslts[pg];      token[pg].geometry = pGeom;     }     graphicsLayer.graphicProvider = token;    }    

please help.

  • flex
  • web_developers

  • All Posts


  • Previous Topic

  • Next Topic

1 Solution

Sherly,

   Here it is tested. You are going to have to learn a lot more about flex as copy and pasting code you find will somethimes work but you have to have some understanding of what it is doing.

<?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"      xmlns:s="library://ns.adobe.com/flex/spark"     xmlns:esri="http://www.esri.com/2008/ags"      title="Map" creationComplete="init()" >     <fx:Script>         <![CDATA[             import com.esri.ags.Graphic;             import com.esri.ags.SpatialReference;             import com.esri.ags.events.GeometryServiceEvent;             import com.esri.ags.geometry.Geometry;             import com.esri.ags.geometry.MapPoint;                          import mx.collections.ArrayCollection;             import mx.rpc.AsyncResponder;             import mx.rpc.events.ResultEvent;                          private function init():void             {                 pointsXML.send();             }             protected function pointsXML_resultHandler(event:ResultEvent):void             {                 var gArr:Array = [];                 var myGraphics:Array = [];                 var x:XML = XML(event.result);                 var pntList:XMLList = x..entry;                 for (var i:int = 0; i < pntList.length(); i++){                     var latlong:Array = pntList.point.split(" ");                     var myPoint:Geometry = new MapPoint(latlong[1], latlong[0], new SpatialReference(4326));                                          var coordGraphic:Graphic = new Graphic(myPoint);                                          gArr.push(myPoint);                     myGraphics.push(coordGraphic);                 }                 var outSR:SpatialReference = new SpatialReference(3857);                 geometryService.project(gArr, outSR, new AsyncResponder(projectCompleteHandler, null, myGraphics));                                 }                                  protected function projectCompleteHandler(result:Object, token:Object):void             {                 var pRslts:Array = result as Array;                 for (var pg:int = 0; pg < pRslts.length; pg++)                 {                     var pGeom:Geometry = pRslts[pg];                     token[pg].geometry = pGeom;                 }                                  graphicsLayer.graphicProvider = token;                              }                      ]]>     </fx:Script>     <fx:Declarations>         <s:HTTPService id="pointsXML" resultFormat="text"                        url="xml/properties.xml" result="pointsXML_resultHandler(event)"/>         <esri:GeometryService id="geometryService"                                url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>     </fx:Declarations>     <s:navigationContent>         <s:Button width="80" height="70" click="navigator.popView()" icon="assets/backbutton.png"/>     </s:navigationContent>          <esri:Map id="map">         <esri:extent>             <esri:Extent xmin="-467799" ymin="5253018" xmax="2171419" ymax="6627661"/>         </esri:extent>         <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>         <esri:GraphicsLayer id="graphicsLayer">             <esri:symbol>                 <esri:SimpleMarkerSymbol alpha="0.9"                                          color="0xFFFF00"                                          size="12"                                          style="square">                     <esri:SimpleLineSymbol color="0xDD0000" width="2" alpha="1" style="solid"/>                 </esri:SimpleMarkerSymbol>             </esri:symbol>         </esri:GraphicsLayer>     </esri:Map> </s:View> 

Now you need to make this as answered.

Don’t forget to click the Mark as answer check and to click the top arrow (promote) as shown below:

11 Replies

Sherly,

   That error comes when you are missing an import in your code, and because you have not attached all of the code it is impossible to say which import you are missing.

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark" title="map2" creationComplete="init()" xmlns:esri="http://www.esri.com/2008/ags">
 <fx:Script>
  <![CDATA[
   import com.esri.ags.Graphic;
   import com.esri.ags.SpatialReference;
   import com.esri.ags.events.GeometryServiceEvent;
   import com.esri.ags.geometry.Geometry;
   import com.esri.ags.geometry.MapPoint;
   import com.esri.ags.layers.GraphicsLayer;
   
   import mx.collections.ArrayCollection;
   import mx.rpc.AsyncResponder;
   import mx.rpc.events.ResultEvent;
      [Bindable]
   private var myXML:ArrayCollection;
   private var myObject:Object;
   private var latlong:Number;
   private var myPoint:Geometry;

   
   private function init():void
   {
    graphicsLayer = new GraphicsLayer;
    map.addLayer(graphicsLayer);
    srv.send();
   }
   
   private function resultHandler(event:ResultEvent):void
   {
   myXML = event.result.myXML.entry;
      
   var gArr:Array = [];
   var graphics:Array = [];
   for each (myObject in data) {
    latlong = Number(myObject.point.toString());   
    myPoint = new MapPoint(latlong);
    
    var uGraphic:Graphic = new Graphic (myPoint);
    gArr.push(myPoint);
    graphics.push(uGraphic);
   }

   var outSR:SpatialReference = new SpatialReference(3857);
   geometryService.project(gArr, outSR, new AsyncResponder(projectCompleteHandler, null, graphics));
   }
   
   protected function projectCompleteHandler(result:Object, token:Object):void
   {
    var pRslts:Array = result as Array;
    for (var pg:int = 0; pg < pRslts.length; pg++){
     var pGeom:Geometry = pRslts[pg];
     token[pg].geometry = pGeom;
    }
    graphicsLayer.graphicProvider = token;
   }
   
  ]]>
 </fx:Script>
 <fx:Declarations>
 <s:HTTPService id="srv" url="xml/properties.xml" result="resultHandler(event)"/>
 <esri:GeometryService id="geometryService" 
        url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
 </fx:Declarations>
 
 <esri:Map id="map">
  <esri:extent>
   <esri:Extent xmin="-467799" ymin="5253018" xmax="2171419" ymax="6627661"/>
  </esri:extent>
  <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
  <esri:GraphicsLayer id="graphicsLayer">
   <esri:symbol>
    <esri:SimpleMarkerSymbol alpha="0.9"
           color="0xFFFF00"
           size="12"
           style="square"/>
   </esri:symbol>
  </esri:GraphicsLayer>
 </esri:Map>
</s:View>

sherly,

   Which Adobe Flex SDK are you using and What ESRI Flex API?

I am using Flex SDK 4.5.1 and  ArcGIS API for Flex 2.5. Sir, can you tell me what am I doing wrong? Thanks in advance.

The error is gone now but i still can’t project my points to the map. Please Help.

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark" title="map2" creationComplete="init()" xmlns:esri="http://www.esri.com/2008/ags">
 
 <fx:Script>
  <![CDATA[
   import com.esri.ags.Graphic;
   import com.esri.ags.SpatialReference;
   import com.esri.ags.events.GeometryServiceEvent;
   import com.esri.ags.geometry.Geometry;
   import com.esri.ags.geometry.MapPoint;
   import com.esri.ags.layers.GraphicsLayer;
   
   import mx.collections.ArrayCollection;
   import mx.rpc.AsyncResponder;
   import mx.rpc.events.ResultEvent;
   [Bindable]
   private var myXML:ArrayCollection;
   private var myObject:Object;
   private var latlong:Number;
   private var myPoint:Geometry;
   
   private function init():void
   {
    graphicsLayer = new GraphicsLayer;
    map.addLayer(graphicsLayer);
    srv.send();
   }
   
   private function resultHandler(event:ResultEvent):void
   {
    var gArr:Array = [];
    var graphics:Array = [];
    for each (var node:XML in event.result.entry.point)
    {
     latlong = Number(node.point.toString());
     myPoint = new MapPoint(latlong);
     
     var uGraphic:Graphic = new Graphic(myPoint);
     gArr.push(myPoint);
     graphics.push(uGraphic);
    }
    
    var outSR:SpatialReference = new SpatialReference(3857);
    geometryService.project(gArr, outSR, new AsyncResponder(projectCompleteHandler, null, graphics));
   }
   
   protected function projectCompleteHandler(result:Object, token:Object):void
   {
    var pRslts:Array = result as Array;
    for (var pg:int = 0; pg < pRslts.length; pg++)
    {
     var pGeom:Geometry = pRslts[pg];
     token[pg].geometry = pGeom;
    }
    
    graphicsLayer.graphicProvider = token;
   }
   
  ]]>
 </fx:Script>
 <fx:Declarations>
 <s:HTTPService id="srv" url="xml/properties.xml" result="resultHandler(event)" resultFormat="e4x"/>
 <esri:GeometryService id="geometryService" 
        url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
 </fx:Declarations>
 
 <esri:Map id="map">
  <esri:extent>
   <esri:Extent xmin="-467799" ymin="5253018" xmax="2171419" ymax="6627661"/>
  </esri:extent>
  <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
  <esri:GraphicsLayer id="graphicsLayer">
   <esri:symbol>
    <esri:SimpleMarkerSymbol alpha="0.9"
           color="0xFFFF00"
           size="12"
           style="square"/>
   </esri:symbol>
  </esri:GraphicsLayer>
 </esri:Map>
</s:View>

Here’s what my xml looks like:

<feed>
<entry>
<point>46.47506 7.293239</point> 
</entry>

<entry>
  <point>46.424827 7.322059</point>
</entry>
………

</feed>

Sherly,

   A couple of points.

  1. A geometry is not going to project if it never knows what spatial reference it is in to begin with (which is your case)
    myPoint = new MapPoint(latlong);
  2. The MapPoint constructor is expecting a minimum of two properties x and y normally it would look like
    myPoint = new MapPoint(xCoord, Ycoord);

    You are trying to feed it one Number and no Spatial Reference.

Try this if your points are in WGS 1984:

var latlong:Array = node.point.toString().split(" ");
                myPoint = new MapPoint(latlong[0],latlong[1], new SpatialReference(4326));

Don’t forget to click the Mark as answer check and to click the top arrow (promote) as shown below:

I’m still getting an error. Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy to XML  Please help. :disappointed_face:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark" title="map2" creationComplete="init()" xmlns:esri="http://www.esri.com/2008/ags">
 
 <fx:Script>
  <![CDATA[
   import com.esri.ags.Graphic;
   import com.esri.ags.SpatialReference;
   import com.esri.ags.events.GeometryServiceEvent;
   import com.esri.ags.geometry.Geometry;
   import com.esri.ags.geometry.MapPoint;
   
   import mx.collections.ArrayCollection;
   import mx.rpc.AsyncResponder;
   import mx.rpc.events.ResultEvent;
   
   [Bindable]
   private var myGraphics:Array;
 
   private function init():void
   {
    pointsXML.send();
   }
   protected function pointsXML_resultHandler(event:ResultEvent):void
   {
    var gArr:Array = [];
    for each (var node:XML in event.result.feed.entry);
    {
     var latlong:Array = node.point.toString().split(" ");
     var myPoint:Geometry = new MapPoint(latlong[0], latlong[1], new SpatialReference(4326));
     
     var coordGraphic:Graphic = new Graphic(myPoint);
     
     gArr.push(myPoint);
     myGraphics.push(coordGraphic);
    }
     var outSR:SpatialReference = new SpatialReference(4326);
     geometryService.project(gArr, outSR, new AsyncResponder(projectCompleteHandler, null, myGraphics));     
   }  
   
   protected function projectCompleteHandler(result:Object, token:Object):void
   {
    var pRslts:Array = result as Array;
    for (var pg:int = 0; pg < pRslts.length; pg++)
    {
     var pGeom:Geometry = pRslts[pg];
     token[pg].geometry = pGeom;
    }
    
    graphicsLayer.graphicProvider = token;

   }
   
  ]]>
 </fx:Script>
 <fx:Declarations>
  <s:HTTPService id="pointsXML"
        url="xml/properties.xml" result="pointsXML_resultHandler(event)"/>
  <esri:GeometryService id="geometryService" 
         url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
 </fx:Declarations>
 
 <esri:Map id="map">
  <esri:extent>
   <esri:Extent xmin="-467799" ymin="5253018" xmax="2171419" ymax="6627661"/>

  </esri:extent>
  <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
  <esri:GraphicsLayer id="graphicsLayer">
   <esri:symbol>
    <esri:SimpleMarkerSymbol alpha="0.9"
           color="0xFFFF00"
           size="12"
           style="square"/>
   </esri:symbol>
  </esri:GraphicsLayer>
 </esri:Map>

</s:View>

and the error comes from this line of code:

for each (var node:XML in event.result.feed.entry);

Sherly,

  Try this:

var x:XML = XML(event.result);
for each (var node:XML in x);

The error is gone now but the points are still not projected. I can’t think of anything to do now. It seems like my codes are correct but nothing happens. Please help. :disappointed_face:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
  xmlns:s="library://ns.adobe.com/flex/spark" title="Map" creationComplete="init()" xmlns:esri="http://www.esri.com/2008/ags">
 
 <fx:Script>
  <![CDATA[
   import com.esri.ags.Graphic;
   import com.esri.ags.SpatialReference;
   import com.esri.ags.events.GeometryServiceEvent;
   import com.esri.ags.geometry.Geometry;
   import com.esri.ags.geometry.MapPoint;
   
   import mx.collections.ArrayCollection;
   import mx.rpc.AsyncResponder;
   import mx.rpc.events.ResultEvent;
   

 
   private function init():void
   {
    pointsXML.send();
   }
   protected function pointsXML_resultHandler(event:ResultEvent):void
   {
    var gArr:Array = [];
    var myGraphics:Array = [];
    var x:XML = XML(event.result.feed.entry);
    for each (var node:XML in x);
    {
     var latlong:Array = node.point.toString().split(" ");
     var myPoint:Geometry = new MapPoint(latlong[0], latlong[1], new SpatialReference(4326));
     
     var coordGraphic:Graphic = new Graphic(myPoint);
     
     gArr.push(myPoint);
     myGraphics.push(coordGraphic);
    }
     var outSR:SpatialReference = new SpatialReference(4326);
     geometryService.project(gArr, outSR, new AsyncResponder(projectCompleteHandler, null, myGraphics));     
   }  
   
   protected function projectCompleteHandler(result:Object, token:Object):void
   {
    var pRslts:Array = result as Array;
    for (var pg:int = 0; pg < pRslts.length; pg++)
    {
     var pGeom:Geometry = pRslts[pg];
     token[pg].geometry = pGeom;
    }
    
    graphicsLayer.graphicProvider = token;

   }
   
  ]]>
 </fx:Script>
 <fx:Declarations>
  <s:HTTPService id="pointsXML"
        url="xml/properties.xml" result="pointsXML_resultHandler(event)"/>
  <esri:GeometryService id="geometryService" 
         url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
 </fx:Declarations>
 <s:navigationContent>
  <s:Button width="80" height="70" click="navigator.popView()" icon="assets/backbutton.png"/>
 </s:navigationContent>
 
 <esri:Map id="map">
  <esri:extent>
   <esri:Extent xmin="-467799" ymin="5253018" xmax="2171419" ymax="6627661"/>

  </esri:extent>
  <esri:ArcGISTiledMapServiceLayer url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
  <esri:GraphicsLayer id="graphicsLayer">
   <esri:symbol>
    <esri:SimpleMarkerSymbol alpha="0.9"
           color="0xFFFF00"
           size="12"
           style="square">
     <esri:SimpleLineSymbol color="0xDD0000" width="2" alpha="1" style="solid"/>
     </esri:SimpleMarkerSymbol>
   </esri:symbol>
  </esri:GraphicsLayer>
 </esri:Map>

</s:View>


  • Previous

    • 1
    • 2
  • Next


  • Previous

    • 1
    • 2
  • Next

  • Home
  • Forum
  • Flash Help
  • Actionscript 3.0 (incl. Flex/AIR)
  • Error 1010….what is undefined?

  1. 05-23-2007, 05:24 PM


    #1

    databell is offline


    Senior Member


    Error 1010….what is undefined?

    This is really strange. I’ve got a button symbol on stage with an instance name of aboutUs_btn. My code on my AS layer is:

    this.aboutUs_btn.addEventListener(MouseEvent.MOUSE _DOWN, about);
    function about(evt:MouseEvent):void {
    this.wipe_mc.gotoAndPlay(2);
    this.gotoAndStop(«history»);
    head.unload();
    }

    And then I test the movie and get this error and it makes no sense to me.

    TypeError: Error #1010: A term is undefined and has no properties.
    at main1_fla::MainTimeline/about()

    What’s weird is I tried this in another .fla and it didn’t bring up the error. That makes no sense. They’ve both got Publish Settings for AS3/FL9

    Adam Bell
    dzign@datatv.com

    Over 90% of all websites
    suck……
    Join the minority.


  2. 05-23-2007, 05:50 PM


    #2

    senocular is offline


    half as fun, double the price

    senocular's Avatar


    trace your values and see if any come up undefined (or use the debugger to check out their values during playback)


  3. 05-23-2007, 06:09 PM


    #3

    databell is offline


    Senior Member


    I don’t know how to do that.

    Adam Bell
    dzign@datatv.com

    Over 90% of all websites
    suck……
    Join the minority.


  4. 05-24-2007, 04:44 AM


    #4

    tonypa is offline


    Senior Member

    tonypa's Avatar


    Most likely you do not have movie clip with instance name «wipe_mc» on stage when code is run.


  5. 05-24-2007, 08:45 AM


    #5

    cancerinform is offline


    Mod

    cancerinform's Avatar


    Forget what I originally wrote. It is too early in the morning

    But what you can do is put a trace of an object at a certain point in the script. If your error occurred after the trace then the trace will be executed otherwise not.

    Last edited by cancerinform; 05-24-2007 at 08:49 AM.

    — The right of the People to create Flash movies shall not be infringed. —


  6. 05-24-2007, 02:23 PM


    #6

    databell is offline


    Senior Member


    First to Tonypa, there is an instance of wipe_mc on the stage. Second to cancerinform, since I’m not very aware how to do trace statements, I’d just stick it somewhere in my about_btn function and if it’s in the right place in that function, it’ll work?

    Adam Bell
    dzign@datatv.com

    Over 90% of all websites
    suck……
    Join the minority.


  7. 05-24-2007, 02:37 PM


    #7

    jjcorreia is offline


    Member


    Quote Originally Posted by databell

    Second to cancerinform, since I’m not very aware how to do trace statements, I’d just stick it somewhere in my about_btn function and if it’s in the right place in that function, it’ll work?

    Its very basic, just stick it anywhere

    Code:

    trace ( this );
    trace ( this.aboutUs_btn );
    trace ( this.wipe_mc );
    trace ( about );
    trace ( anything else );


  8. 05-25-2007, 09:49 AM


    #8

    databell is offline


    Senior Member


    Well, here’s what I did. I got rid of all ‘this’ references and then deleted all wipe_mc lines just to see what would happen. It worked. Clicking on aboutUs_btn did exactly what it was supposed to do. So I figure let’s bring wipe_mc back. I started by just doing a reference to the wipe_mc instance. No this. And this is what I got as a compiler error:

    1120: Access of undefined property wipe_mc.

    Adam Bell
    dzign@datatv.com

    Over 90% of all websites
    suck……
    Join the minority.


  9. 05-25-2007, 09:50 AM


    #9

    databell is offline


    Senior Member


    OK. Kind of expected that. Remember, wipe_mc is on the stage! So let’s add the ‘this.’ back to this.wipe_mc:

    undefined

    That was from the trace (this.wipe_mc); statement.

    TypeError: Error #1010: A term is undefined and has no properties.
    at main2_fla::MainTimeline/about()

    So we’re back to that again. Is it possible because there’s no linkage property that this is occuring? Again, this didn’t happen in a different Flash 9 .fla.

    Adam Bell
    dzign@datatv.com

    Over 90% of all websites
    suck……
    Join the minority.


  10. 05-25-2007, 09:57 AM


    #10

    cancerinform is offline


    Mod

    cancerinform's Avatar


    Are you sure you gave it the name wipe_mc in the property inspector?
    Are you calling the movieclip from an external class script or from the main timeline?

    Last edited by cancerinform; 05-25-2007 at 10:01 AM.

    — The right of the People to create Flash movies shall not be infringed. —


  11. 05-25-2007, 01:41 PM


    #11

    databell is offline


    Senior Member


    That’s weird. I had the instance name in there. Then it disappeared. That makes no sense. I retyped in it and the problem is finally gone! Sorry about all that. Everything seems to work now.

    Adam Bell
    dzign@datatv.com

    Over 90% of all websites
    suck……
    Join the minority.


  12. 10-10-2007, 02:40 PM


    #12

    WarpZone is offline


    Junior Member


    For what it’s worth, I have an action game that uses for loops to iterate through arrays to check for collisions of bullets VS enemies, the old-school way. And with 30-90 collisions attempted per frame, I get this 1010 warning maybe 4 or 5 times over the course of 2 minutes of juicy combat.

    The weird thing is how inconsistantly it pops up. I have dozens of collisions being checked every frame, but it never occurs more than once per frame, and seldom occurs at all. I have not been able to discern any pattern to its appearence whatsoever, I.E. it doesn’t seem to be particularly triggered by too many collisions or collisions that result in the death of an enemy, vollies of shots that miss all enemies, bullets or enemies leaving the screen en masse, or any other litmus test I can think of.

    I’m thinking it ~may~ occur when a bullet leaves the screen and is therefore removed from the screen and the array, since this check happens in a different place in code than the collision test. I.E. the two blocks of code check the same array, but when for loop one modifies the array, it doesn’t tell the other for loop about it. Even if this is the case, I should point out that it doesn’t seem to happen every time old bullets are removed from the screen.

    Since the error is so rare, (less than 1 in 5000 collisions attempted) it’s really hard to even think of a theory that explains it.

    Most of the webpages that talk about 1010 seem to involve users going «WTF, I understand your explaination, but it doesn’t explain the behavior I’m seeing.»

    I’m thinking there may factors at work here the developer’s not exposed to.

    Fortunately, it doesn’t seem to impact performance at all. I’m tempted to just leave it.

    Is there any good reason not to just ignore 1010 warnings, in cases like mine where the cause cannot be determined because the error is not reliably reproducible?

    Last edited by WarpZone; 10-10-2007 at 02:54 PM.


  13. 10-10-2007, 03:34 PM


    #13

    MyFriendIsATaco is offline


    Bearded (M|G)od

    MyFriendIsATaco's Avatar


    sometimes really fluke things like that happen, and if it doesn’t affect the actual execution of the app, its easier to just wrap it in an empty try/catch statement to suppress the error.

    For example:

    Code:

    try
    {
        trace(someUndefinedVariable);
    }catch($e:Error){}

    It will trace as undefined, but it won’t actually throw an error.


  14. 10-11-2007, 12:57 PM


    #14

    KindaGamey is offline


    Member


    This may or may not help you, but I just dealt with that rather cryptic error.

    It turns out that I had a bunch of text fields, mytxt0, mytxt1, mytxt2… etc.
    And I was using a for… loop to update them.

    well my for loop was: (var a=0; a<=12; a++)

    Well there were 12 text objects, but because I was starting my counting at 0 I should have only counted up to 11. so either (var a=0; a<12; a++) or (var a=0; a<=11; a++) would fix the error.

    I’ve done the same thing with Arrays. It tries to find that last item and can’t because my count went one too high.


  15. 10-11-2007, 01:13 PM


    #15

    deadlock32 is offline


    a.k.a gltovar

    deadlock32's Avatar


    Quote Originally Posted by KindaGamey

    This may or may not help you, but I just dealt with that rather cryptic error.

    It turns out that I had a bunch of text fields, mytxt0, mytxt1, mytxt2… etc.
    And I was using a for… loop to update them.

    well my for loop was: (var a=0; a<=12; a++)

    Well there were 12 text objects, but because I was starting my counting at 0 I should have only counted up to 11. so either (var a=0; a<12; a++) or (var a=0; a<=11; a++) would fix the error.

    I’ve done the same thing with Arrays. It tries to find that last item and can’t because my count went one too high.

    Well you loop:
    (var a=0; a<=12; a++)

    defines 13 iterations of a:

    0 to 12 = 13

    1 to 12 = 12

    0 to 11 = 12

    So that may explain the issue you were having


  16. 10-11-2007, 01:17 PM


    #16

    KindaGamey is offline


    Member


    yeah, i know that… I was just pointing out that a mistake like that will bring up the same error. So, if the guy is doing hit tests for thousands of missiles or bullets, pinging one that no longer exists would bring up that same error —

    (thecakeisalie.)


  17. 05-15-2008, 01:25 PM


    #17

    metaphist is offline


    Junior Member


    possible solution

    I just ran into this problem. If you have different keyframes with a movie clip on each, they can all have a different property name on each keyframe. So if you rename something on one keyframe and not on another, it may trace undefined or null. Same goes for swapping out symbols.


  18. 07-08-2008, 04:34 PM


    #18

    mcurtis is offline


    Junior Member


    10 10 let’s not do it again

    I had a problem with my dynamic text field leading to the 1010 error.

    I found:
    http://www.kirupa.com/forum/showthread.php?t=270559

    and it helped me to change
    this.getChildByName(«menuButton0») .label_txt.text = «11»;

    into

    (this.getChildByName(«menuButton0») as menubutton).label_txt.text = «11»;


  19. 07-06-2010, 09:50 AM


    #19

    Brighteyes is offline


    Junior Member


    Im coming up with this error:

    TypeError: Error #1010: A term is undefined and has no properties.
    at Videodoc_fla::MainTimeline/frame1()

    And my code is:

    rewindBtn.onRelease.addEventListener(MouseEvent.CL ICK); void
    function (){
    movieMc.seek(0);
    }

    Not sure how to fix the problem…help!


  20. 07-24-2010, 08:48 PM


    #20

    Nderman is offline


    Junior Member


    Hello I got the same error and i solved it like this.Firstly how my problem appeared:
    I got 4 answer button and they have same FUNCTION for MOUSE_CLICK event.
    And In that function i wanted to get which button is clicked and i read the answer from a text field which both of them belongs that button.
    And I used this way (the way that gives me that error).
    function cevap_check(e:MouseEvent):void <<< the function
    i catch the answer so
    var selected_answer:String=e.target.txtasnwer.text;
    but not when i click other area of that button. Solution way:
    yes this worked but only if the target is ONE OBJECT(this object is the one when i imported a button image and i rightclick and choose CONVERT TO SYMBOL) not other object in that button. so i got tht with trace tricks e.target
    doesnt give me the right object where i want to reach. so i found out this e.currentTarget.name so i got the name which button i clicked. i create a new MOVIECLIP var AdoptClip:MovieClip = MovieClip(this.getChildByName(e.currentTarget.name )); so i got the button and then just var select_answer:String=AdoptClip.txtAnswer.text; and so i got the answer correctly. Not the object which is clicked(i mean before the area not working on the button)



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules


Click Here to Expand Forum to Full Width

HTML5 Development Center

Понравилась статья? Поделить с друзьями:
  • Type object is not subscriptable ошибка
  • Type module js ошибка
  • Type mismatch vba excel ошибка
  • Type hidden как изменить
  • Type error takes no arguments