0
votes

While learning Flash Builder, I am testing a simple application that runs in a browser, the code is like so:

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

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

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

xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

<fx:Script>

<![CDATA[

private function doSomething():void

{

myPanel.visible = false;

}

]]>

</fx:Script>

<s:Panel id="myPanel" x="32" y="38" width="445" height="316" title="My Panel">

<s:Label x="206" y="34" text="Label"/>

<s:HSlider x="171" y="121"/>

<s:Button click="doSomething()" x="182" y="198" label="Goodbye"/>

</s:Panel>

</s:Application>

When I run the application in a browser if show fine, but when I set the a project up with the settings for Desktop Application I can't getting anything to show up. I have no problems listed in the problems view. Does anybody have some advice on why I don't see a compiled application.Thanks

2
firstofall how you set web application to run in desktop application.ketan

2 Answers

3
votes

First thing convert your Flex web project to desktop application with flash builder like this :

enter image description here

then change the tag <s:Application /> with <s:WindowedApplication /> (Flash builder suggest by default to change this tag when changing project type)

your finally project look like this :

<?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" minWidth="955" minHeight="600">


    <fx:Script>
        <![CDATA[

            private function doSomething():void
            {
                myPanel.visible = false;
            }

        ]]>

    </fx:Script>
    <s:Panel id="myPanel" x="32" y="38" width="445" height="316" title="My Panel">
        <s:Label x="206" y="34" text="Label"/>
        <s:HSlider x="171" y="121"/>
        <s:Button click="doSomething()" x="182" y="198" label="Goodbye"/>
    </s:Panel>
</s:WindowedApplication>
0
votes

You need to use a Spark WindowedApplication for Desktop Applications. s:Application is only for web.