1 Reply Latest reply on Aug 10, 2008 6:12 AM by Peter Lorent

    Newbie: Array killing function ?

      Hi all,
      This very simple & "out-of-the-book" Array declaration and - initialisation kills the function underneath.
      If I take out the Array-piece the function works again.
      Even in strict mode the compiler reports no errors.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">
      <mx:VBox >
      <mx:TextInput id="zone1" text="zone" />
      <mx:Button id="button1" label="click!" click="myEventHandler(event)" />
      import mx.controls.Alert;

      // Array constructor
      public var myArray:Array = new Array();
      myArray[0]= 1;
      myArray[1]= 2;
      myArray[2]= 3;

      public function myEventHandler(event:Event):void {
      zone1.text = ("hello");
      Alert.show("An event occurred");


      Being new tot AS3 I'm probably doing something very wrong, but I'm really mystified.
      So can someone out here please tell me what is going wrong here ?
      And perhaps what the correct code should look like?
      Thx a lot.

      Rgds from Rotterdam in Holland,