1 Reply Latest reply on Mar 27, 2013 10:04 AM by Flex harUI

    View with applicationComplete="applicationCompleteHandler(event)

    fsoender Level 1

      My view wont allow "applicationComplete="applicationCompleteHandler(event)" in my view, when I use the code in a none tabbed app it works.




      <?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="Tool" destructionPolicy="never"




      protected function applicationCompleteHandler(event:FlexEvent):void


          udpSocket = new UDPSocket();

          udpSocket.addEventListener(DatagramSocketDataEvent.DATA, udpDataHandler);






      Get this ERROR:


      Multiple markers at this line:


      -Cannot resolve attribute 'applicationComplete' for component type spark.components.View.




      And why doesnt this code work in a view:


      private function sendPort():void

          var bytes:ByteArray = new ByteArray();
          bytes.writeUTFBytes(ValueOut + "\n");
          udpSocket.send(bytes, "", int(2000));