Skip to main content
Known Participant
September 19, 2011
Question

MX:Controls not Work in iphone

  • September 19, 2011
  • 1 reply
  • 653 views

hi friends

i make simple air application(air2.6 sdk)

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

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" title="Hello World" >

<mx:Label text="Hello World! this is Iphone Application" horizontalCenter="0" verticalCenter="0"  fontSize="30"/>

</mx:WindowedApplication>

and make a IPA file from adt  command from commandline and install it on iphone and iphone display blank screen only no message display on screen which is on mx:Label />

and then i make another one

package{

    

    import flash.display.Sprite;

    import flash.text.TextField;

    import flash.text.TextFormat;

    import flash.text.TextFieldAutoSize;

    

    public class HelloWorld extends Sprite

    {

        public function HelloWorld():void

        {

            var textField:TextField = new TextField();

            textField.text = "Hello World!";

            textField.autoSize = TextFieldAutoSize.LEFT;

                

            var format:TextFormat = new TextFormat();

            format.size = 48;

            

            textField.setTextFormat ( format );

            this.addChild( textField );

        }

    }

}

and then i make another IPA file and install in iphone so this will work perfectly

so my Question is what is problem with use of <mx:Controls />

pls help me i have lot's of controls for my iphone app

This topic has been closed for replies.

1 reply

Adobe Employee
September 19, 2011

<WindowedApplication> is not supported on mobile platforms. (It makes use of NativeWindow which is not mobile-compatible.)

If you use Application instead of WindowedApplication, the application would work. Better still, you might want to use <s:MobileApplication> which is mobile-specific.

Known Participant
September 20, 2011

hi Ashutosh Sharma

thnx for your relay

i follow your instruction and  replace  <WindowedApplication> with <s:MobileApplication>

now my problem is :

Error: Could not resolve <s:MobileApplication> to a component implementation.  xmlns:s="library://ns.adobe.com/flex/spark">

my command line code is :

>mxmlc +configname=airmobile myfile.mxml

i'm using 4.5 SDK

any issue ??? or suggession regarding this

thnx in adv

Adobe Employee
September 20, 2011

If you're using Flash Builder, could you try creating a new project via File > New > Flex Mobile Project.

You can find a detailed tutorial at http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flex/articles/twitter-trends/build-first-mobile-flex-app.pdf