Skip to main content
UbuntuPenguin
Participating Frequently
November 8, 2012
Question

Declaration of worker:Worker stops application

  • November 8, 2012
  • 1 reply
  • 562 views

If you have a simple Air mxml main file like so

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

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

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

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

          <fx:Declarations>

                    <!-- Place non-visual elements (e.g., services, value objects) here -->

          </fx:Declarations>

          <fx:Script>

                    <![CDATA[

                    ]]>

          </fx:Script>

</s:WindowedApplication>

You get an empty window.

However, if you have the same main mxml file like this, you get absolutely nothing, no errors or traces.

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

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

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

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

          <fx:Declarations>

                    <!-- Place non-visual elements (e.g., services, value objects) here -->

          </fx:Declarations>

          <fx:Script>

                    <![CDATA[

                              private var worker:Worker;

                    ]]>

          </fx:Script>

</s:WindowedApplication>

I'm not too sure why a declaration of a non referenced worker variable stops the app from showing itself (shouldn't it be optimized out and ignored when creating the bytecode ?).  I am using Flashbuilder 4.7 with the 3.5 SDK.

This topic has been closed for replies.

1 reply

chris.campbell
Legend
November 14, 2012

Could you go into your project properties, then into the Flex Compiler section and add "-swf-version 17"  to the additional compiler arguments?

Thanks,

Chris