"A term is undefined and has no properties"-error

  • deafdigit
  • Newbie
  • Newbie
  • deafdigit
  • Posts: 7

Post 3+ Months Ago

Hi everyone,


I'm trying to convert an old apple-dock-ish flash-script file to as3 and I've ALMOST got it, but now flash has started giving me the following error:

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

This is my code:
Code: [ Select ]
stage.addEventListener(Event.ENTER_FRAME,enter_frame_func);

function enter_frame_func(e:Event):void{
    var picItems:Array = new Array(square1, square2, square3, square4, square5);
    for (var i = 0; 1 < picItems.length; i++) {
        var xxm:Number = picItems[i].mouseX;
        var yym:Number = picItems[i].mouseY;
        var dist:Number = Math.sqrt(xxm*xxm + yym*yym);
        if(dist<50){
            picItems[i].scaleX = picItems[i].scaleY = ((200-dist)-picItems[i].scaleY)/80;
            trace(picItems[i].scaleX);
        } else {
            picItems[i].scaleX = picItems[i].scaleY = 1;
        }
    }
}
  1. stage.addEventListener(Event.ENTER_FRAME,enter_frame_func);
  2. function enter_frame_func(e:Event):void{
  3.     var picItems:Array = new Array(square1, square2, square3, square4, square5);
  4.     for (var i = 0; 1 < picItems.length; i++) {
  5.         var xxm:Number = picItems[i].mouseX;
  6.         var yym:Number = picItems[i].mouseY;
  7.         var dist:Number = Math.sqrt(xxm*xxm + yym*yym);
  8.         if(dist<50){
  9.             picItems[i].scaleX = picItems[i].scaleY = ((200-dist)-picItems[i].scaleY)/80;
  10.             trace(picItems[i].scaleX);
  11.         } else {
  12.             picItems[i].scaleX = picItems[i].scaleY = 1;
  13.         }
  14.     }
  15. }


It's a really short code, so I think you'll be able to spot the mistake easily.

Thanks in advance,
deafdigit
  • deafdigit
  • Newbie
  • Newbie
  • deafdigit
  • Posts: 7

Post 3+ Months Ago

Oh, so... yeah I solved the problem myself. Seems there was a syntax error in the for-loop.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.