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.

       

      Code:

       

      <?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"

        applicationComplete="applicationCompleteHandler(event)">

       

       

      protected function applicationCompleteHandler(event:FlexEvent):void

         {

          udpSocket = new UDPSocket();

          udpSocket.addEventListener(DatagramSocketDataEvent.DATA, udpDataHandler);

          udpSocket.bind(1000);

          udpSocket.receive();

         }

       

       

      Get this ERROR:

       

      Multiple markers at this line:

      -creationComplete

      -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, "169.254.1.1", int(2000));   
             
         }