3 Replies Latest reply on Mar 3, 2013 8:30 AM by l33tian

    Why doesnt applicationComplete work in tabbed view?

    fsoender Level 1

      Im trying to use applicationComplete in a tabbed view, why cant I do this?

      I get an error while doing this.

       

      Code:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:s="library://ns.adobe.com/flex/spark" title="Test"
        applicationComplete="applicationCompleteHandler(event)">


      </s:View>

        • 1. Re: Why doesnt applicationComplete work in tabbed view?
          l33tian Level 1

          What type of error are you getting, applicationComplete events are only dispached by application types or its subclasses like windowed application, for Mobiole applications, ViewNavigatorApplication and also other Top level Application containers also dispatch applicationComplete events. What are you trying to achieve? every control dispatches creation complete, you can use that instead if you need to call some sort of logic when the control has just been created.

          • 2. Re: Why doesnt applicationComplete work in tabbed view?
            fsoender Level 1

            This is some of the code. get this error:

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

             

             

            <?xml version="1.0" encoding="utf-8"?>

            <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"

                         xmlns:mx="library://ns.adobe.com/flex/mx"

                         xmlns:s="library://ns.adobe.com/flex/spark" title="Test"

                          applicationComplete="applicationCompleteHandler(event)">

             

            <fx:Script>

                         <![CDATA[

                    

                      import mx.events.FlexEvent;

                               import be.aboutme.nativeExtensions.udp.UDPSocket;                                                                        private var udpSocket:UDPSocket;

             

            protected function applicationCompleteHandler(event:FlexEvent):void

                                {

                                       udpSocket = new UDPSocket();

                                       udpSocket.addEventListener(DatagramSocketDataEvent.DATA, udpDataHandler);

                                       udpSocket.bind(1000);

                                       udpSocket.receive();

                                }

             

             

             

            protected function udpDataHandler(event:DatagramSocketDataEvent):void

                                {

                                       var Value:String = event.data.readUTFBytes(event.data.bytesAvailable);

                                      

                                                                          if(Value)

                                       {                                 

                                              NewValue = Value;                                    

                                              chartData.source[chartIndex] = NewValue;

                                             

                                             

                                       }

                                                                          else

                                       {                                 

                                              NewValue = 0;                                 

                                       }

                                }

                               

                         ]]>

                  

            </fx:Script>

                  

            </s:View>

            • 3. Re: Why doesnt applicationComplete work in tabbed view?
              l33tian Level 1

              Cannot resolve attribute 'applicationComplete' for component type spark.components.View. mean there is no such event handler (applicationComplete) for view components, use creationComplete instead if you want the code to be called when the component gets created initially.