Skip navigation
fsoender
Currently Being Moderated

View with applicationComplete="applicationCompleteHandler(event)

Mar 26, 2013 1:10 PM

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));   
       
   }  

 

 
Replies
  • Currently Being Moderated
    Mar 27, 2013 10:04 AM   in reply to fsoender

    Only Applications dispatch that event.  You can use creationComplete in most cases in other components.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points