Flex Mobile Auto Switch To Landscape

I am building a Flex Mobile app for a final project at school and I would like it to automaticly switch to landscape mode when debugged. As of right now it starts out in portrait mode and I have to click rotate left.
Any help would be awesome!
Thank you.
--Logan

ok for anyone with the same problem......
open up your xml file     example    test.xml   
change the line.....
<aspectRatio>landscape</aspectRatio>
delete the comment charaters around it.
--Logan

Similar Messages

  • Flex mobile orientation: force portrait mode and then allow auto orientation

    I'm creating a flex mobile project and I want to force the app to portrait orientation when I click a button, and when I click other button allow again to change the orientation.
    This is my code when I click the first button, where I want to force portrait mode:
    protected function click(event:MouseEvent):void{      if(stage.orientation != StageOrientation.DEFAULT){           stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, orientationChanged);           stage.setOrientation(StageOrientation.DEFAULT);      }else{           doSomething();      }  }  
    private function orientationChanged(event:StageOrientationEvent):void{      doSomething();      stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGE, orientationChanged); } 
    private function doSomething():void{      stage.autoOrients = false; }
    It works ok and it changes the orientation if it's needed.
    Now, when I want to allow orientation change again, I've only putted:
    stage.autoOrients = true;
    It works ok if when I click the first button the app is in portrait and it doesn't have to change anything. But if it's on landscape and it have to change to portrait, when I allow orientation change again, it doesn't work ok.
    Do you know if I have to allow or change something? Or, is there any better way to do this?
    Thanks in advance

    Thanks for your answer. It works, but I have the same problem that I have setting the orientation. If I'm on landscape, it changes to Portrait ok, but when I want to allow auto orientation again, it doesn't work well.
    A little tricky I've found is:
    When I want to force to portrait:
    private var oldOrientation:String = null;
    protected function click(event:MouseEvent):void{
       if(stage.orientation != StageOrientation.DEFAULT){
                oldOrientation = stage.orientation;
                stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, orientationChanged);
                stage.setOrientation(StageOrientation.DEFAULT);
       }else{
                doSomething();
    private function orientationChanged(event:StageOrientationEvent):void{
                // do something if you are changing to portrait mode (the first change) and other thing if you are changing to old orientation
    And when I want to allow auto orientation again:
    if(oldOrientation != null){
            stage.setOrientation(oldOrientation);
            oldOrientation = null;             

  • Flex Mobile 4.5.1 iOS NetworkInfo not available

    Hi guys,
    I'm building a Flex mobile app for Android and iPad platform. I have a requirement to identify each tablet device on the server side. Normally the AIR SDK has the NetworkInfo class to access the MacAddresses available on the device:
    var interfaceVector:Vector.<NetworkInterface> = NetworkInfo.networkInfo.findInterfaces();
    My problem is that iPad 2 doesn't seem to support the NetworkInfo class on the device so I can't find a way to access the MAC address.
    Does anyone know a way to extract some sort of unique ID (it can be anything as long as it's unique) from an iOS device?
    Thanks in advance.
    Bashar

    Hi Bashar,
    that's not that iPad does not seems to support that api, it is explicitly not supported on mobile profile:
    AIR profile support: This feature is supported on all desktop operating systems and AIR for TV devices, but is not supported on all mobile devices. You can test for support at run time using the NetworkInfo.isSupported property. See AIR Profile Support for more information regarding API support across multiple profiles.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetworkInfo.h tml
    The topic of indentifying devices is returning on forums, e.g. see:
    http://forums.adobe.com/thread/803428
    As far as I can remember only BlackBerry tablet OS additions offers unique per-device UUID via actionscript:
    http://www.blackberry.com/developers/docs/airapi/1.0.0/qnx/system/Device.html
    on Android/iOS you could consider switching to per-installation model - that is generate your own UUID (in way you want: locally via script or via server-generated hash, etc) which once saved in application is later used to identify it against server.
    hth,
    regards,
    Peter

  • Flex Mobile Projet - ActionBar position

    Hi, I have created a Flex mobile project, with ViewNavigatorApplication layout.  I want to position the ActionBar in the bottom of the app, rather than the default top aligned. How can I do that?
    I tried by setting the this.navigator.actionBar.y = 300; in the creationComplete of the application, but as I navigate to any other view, it jumps back to top.
    Please suggest.

    If you can't find a better solution, extend the View class and add the code to this extended view. All your view will then have to extend this view.
    You would have to add something like navigator.actionBar.y = FlexGlobals.topLevelApplication.height - navigator.actionBar.height; in the creationCompleteHandler (i would use a callLater because your change will be overwrited by the view_creationCompleteHandler) and in the viewActivate Handler. The navigator will always flash at the top when you switch view... It's why I hope you'll find a better way to do it.

  • Flex Mobile Videoplayback ( GPU / CPU )

    Hi,
    I have problems with videoplayback on Android in an Flex Mobile app.
    I using the pur AS3 Strobe Media Playback with OSMF. When a play in emulator the video is ok,
    but on my Android device there are random lines on the Videos ( streamed or local )
    Also is the video not in the right frame ( in the emulator the video is not zoomed in like on the device )
    The app is set to autoOrient = false but for video i force it to landscape mode ( just for the playback )
    If I force the app to gpu rendering the video is perfect but the whole app is very sluggy ( Samsung Galaxy SII )
    Could someone help?

    Hi,
    I have problems with videoplayback on Android in an Flex Mobile app.
    I using the pur AS3 Strobe Media Playback with OSMF. When a play in emulator the video is ok,
    but on my Android device there are random lines on the Videos ( streamed or local )
    Also is the video not in the right frame ( in the emulator the video is not zoomed in like on the device )
    The app is set to autoOrient = false but for video i force it to landscape mode ( just for the playback )
    If I force the app to gpu rendering the video is perfect but the whole app is very sluggy ( Samsung Galaxy SII )
    Could someone help?

  • Flex mobile 4.6 app works inside flash builder but not in android emulator

    Originally posted on stackoverflow: http://stackoverflow.com/questions/8663892/flex-mobile-4-6-app-works-inside-flash-builder- but-not-in-android-emulator
    I have a basic flex mobile 4.6 app and it works fully fine in the flash builder built-in emulator using an android device profile like aria...
    It also launches fine in the android emulator but one particular view shows blank (and this view works fine in flash builder).
    Before I get in to many details of the view are there any categorical gotchas that can be causing this?
    I can't seem to get the trace statements from the app to show in 'adb logcat'. It seems I need to compile a debug version of the apk but I don't know how to do this. I use the 'Export Release Build' from the Project menu in flash builder and it doesn't seem to have an option for debug=true.
    The problematic/blank view basically uses the stagewebview and iotashan's oauth library to call linkedin rest apis... A different (and working) view can make restful web service calls in the emulator fine, so it doesn't seem to be an internet permission.
    The source code contained in the problematic/blank view is almost identical to the tutorial found at:http://www.riagora.com/2011/01/air-and-linkedin/
    The differences are: a) The root tag is a View b) I use StageWebView instead of HtmlContainer c) I use my own linkedin key and tokens.
    I would appreciate it if someone can provide me with some pointers on how to troubleshoot this situation. Perhaps someone can tell me how to debug the app while running in the emulator (I think I need the correct adt command arguments for this which matches the 'Export Release Build' menu but adds the debug param?)
    Thanks for your help in advance.
    Comment Added:
    I suspect that this has to do with connections to https:// api.linkedin.com and https:// www.linkedin.com. The only reason I can think of that the same code is not having issues inside of Flex Builder but indeed having issues in the Android emulator is something to do with certificates. Any ideas?

    Thanks er453r,
    I have created a project that clearly reproduces the bug.  Here are the steps:
    1) Create a UrlLoader and point it to https://www.google.com (HTTPS is important because http works but HTTPS does not)
    2) Load it
    3) Run in Flash Builder 4.6/Air 3.1 and then run in Android emulator.  The former works with an http status 200.  The latter gives you an ioerror 2032.  I am assuming what works in Flash Builder is supposed to work in the Android Emulator and what what works in the emulator is supposed to work in a physical device (plus or minus boundary conditions).
    I see a certificate exception in adb logcat but not sure if it's related...
    Here is the self contained View code which works with a TabbedViewNavigatorApplication:
    <?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"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        xmlns:ns1="*"
                        xmlns:local="*"
                        creationComplete="windowedapplication1_creationCompleteHandler(event) "
                        actionBarVisible="true" tabBarVisible="true">
              <fx:Script>
                        <![CDATA[
                                  import mx.events.FlexEvent;
                                  protected var requestTokenUrl:String = "https://www.google.com";
                                  protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                                            var loader:URLLoader = new URLLoader();
                                            loader.addEventListener(ErrorEvent.ERROR, onError);
                                            loader.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
                                            loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
                                            loader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpResponseStatusHandler);
                                            loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                                            var urlRequest:URLRequest = new URLRequest(requestTokenUrl);
                                            loader.load(urlRequest);
                                  protected function requestTokenHandler(event:Event):void
                                  protected function httpResponse(event:HTTPStatusEvent):void
                                            label.text += event.status;
                                            // TODO Auto-generated method stub
                                  private function completeHandler(event:Event):void {
                                            label.text += event.toString();
                                            trace("completeHandler data: " + event.currentTarget.data);
                                  private function openHandler(event:Event):void {
                                            label.text +=  event.toString();
                                            trace("openHandler: " + event);
                                  private function onError(event:ErrorEvent):void {
                                            label.text +=  event.toString();
                                            trace("onError: " + event.type);
                                  private function onAsyncError(event:AsyncErrorEvent):void {
                                            label.text += event.toString();
                                            trace("onAsyncError: " + event);
                                  private function onNetStatus(event:NetStatusEvent):void {
                                            label.text += event.toString();
                                            trace("onNetStatus: " + event);
                                  private function progressHandler(event:ProgressEvent):void {
                                            label.text += event.toString();
                                            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
                                  private function securityErrorHandler(event:SecurityErrorEvent):void {
                                            label.text +=  event.toString();
                                            trace("securityErrorHandler: " + event);
                                  private function httpStatusHandler(event:HTTPStatusEvent):void {
                                            label.text += event.toString();
                                            //label.text += event.responseHeaders.toString();
                                            trace("httpStatusHandler: " + event);
                                  private function httpResponseStatusHandler(event:HTTPStatusEvent):void {
                                            label.text +=  event.toString();
                                            trace("httpStatusHandler: " + event);
                                  private function ioErrorHandler(event:IOErrorEvent):void {
                                            label.text +=  event.toString();
                                            label.text += event.text;
                                            trace("ioErrorHandler: " + event);
                        ]]>
              </fx:Script>
              <fx:Declarations>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>
              <s:Label id="label" y="185" width="100%" color="#0A0909" horizontalCenter="0" text=""/>
    </s:View>

  • Flex Mobile 4.6 introduces Stage Text - how do you render HTML text with it?

    I have a little chat component in a Flex Mobile app that I just upgraded to SDK 4.6.  The chat component has a text area displaying messages and they are HTML formatted via the following:
    StyleableTextField(textArea).htmlText += myHTMLText;
    Worked in SDK 4.5 but StyleableTextField is not a part of the new Stage Text framework introduced in SDK 4.6.
    How do I HTML format the messages in my chat text area now?

    Thanks much for your response.
    Hmmm...  That appears to work but also causes a runtime exception where there was none before the 4.6 upgrade.  It occurs when I autoscroll on receiving a new message in the chat, something that worked fine in 4.5.
    I guess I'm kind of wondering what the best practice is here.  Maybe I'm just doing this wrong altogether.  I'm finding it very difficult to implement probably one of the most basic features one would find in any collaborative app - something that was very easy in Flex 3 - the chat pane.  I've had one functioning fine for about 3 years.  Not so much in Flex mobile.
    Chat is very simple functionality.  When you receive a new message from afar...
    1.  add it to a TextArea with some nice formatting
    2.  auto scroll far enough so the user can see the new message in its entirety. 
    Nothing difficult at all.
    Why are these two things difficult to find in the TextArea in Flex mobile?  It almost seems as though it's something we're not supposed to be doing? 
    The answer here seems to be don't use Stage Text.  Revert to an older TextArea skin.  Why?  What text area doesn't need formatting as an option?  What text area doesn't need to be auto scrolled here and there?  Or am I just going about this wrong?  Maybe using the wrong components?
    I guess for now I can revert to 4.5 skin, but now the code I used to auto scroll on receiving a new message throws a null pointer exception.  I've been using the valueCommit property to auto scroll, as follows:
    valueCommit="textArea.scroller.verticalScrollBar.value = textArea.scroller.verticalScrollBar.maximum"
    Haven't had a problem prevously.  But this now throws:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at com.components::ChatWindow/__textArea_valueCommit()
    What's the best practice to accomplish this and also to be able to take advantage of the latest and greatest?

  • Flex Mobile Application with online database

    Hi,
    I would like to create a Flex Mobile Application but this one have to be read/connect  to a online database ?
    I don't found any tuto or infos about that...
    Could you please tell me if it's possible and if yes, how to do that
    Thanks in advance !

    I don't understand one thing...
    There are different type to do a connection between Flex and PHP.
    Which one is the best ?
    1. With AMF (Flex :  service-config.xml, RemoteObject) (http://www.adobe.com/devnet/flex/articles/crud_flex_php_zend.html)
    2. With Zend Framework (Flex : Callresponder, Time,...)  already included in Flash Builder 4.5 (http://devzone.zend.com/1701/flex-and-zend-framework_part-1/)
    3. With Zend Server and Flash Builder 4.5 with PHP (http://www.adobe.com/devnet/flash-builder/articles/flashbuilder-php-part1.html)
    It's three differents approach but in 2 & 3, it's auto configured with Flex.. however to do a connection between Flex Mobile & PHP (online), I have to use the solution 1
    So, if somebody can help me to explain and understand the difference between that.
    thanks

  • Trying to use adobe air 17 in a Flex Mobile ap

    hello,
    My Flashbuilder is using  AIR 17 as is visible in AIR aps.
    However, my Adobe flex mobile app won't let me update a certain line in the .xml
    I want to change:
    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <application xmlns="http://ns.adobe.com/air/application/3.1">
    to
    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <application xmlns="http://ns.adobe.com/air/application/17">
    Yet when I try and debug, I get a popup window that says:
    Process terminated without establishing connection to debugger.
    invalid application descriptor: Unknown namespace: http://ns.adobe.com/air/application/17
    Launch command details:  "C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\bin\adl.exe" -runtime "C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\runtimes\air\win" -profile mobileDevice -screensize 480x762:480x800 -XscreenDPI 252 -XversionPlatform AND "C:\Users\l\Adobe Flash Builder 4.7\CSemt\bin-debug\CSemt-app.xml" "C:\Users\l\Adobe Flash Builder 4.7\CSemt\bin-debug"
    any help?

    Back in the day, you had to overlay the Flex and AIR SDks to make it work.  It may still be the case.
    i've since switched to pure AS3 projects since I didn't use any Flex components, so I don't follow this workflow anymore, I do this instead: Update the AIR SDK for ActionScript Projects | Flash Builder 4.7
    I remember following these instructions back when I was still overlaying the SDKs, maybe they'll help you:
    Overlay AIR SDK on Flex SDK | Flash Builder
    Obviously back up your existing SDK directory first....
    Good luck!

  • ANE for one platform on Flex mobile project for iOS and Android

    I'm very new at Flex Mobile Projects and native extension.
    I have a big doubt... If I have an ANE that only works on iOS or Android, can I use it into a project for Android AND iOS?
    I mean, if I want to do something and I've only found and ANE that works for iOS and another ANE that works for Android, can I create only one project and depending on the device use one or another? or should I create two different projects?
    Thanks in advance

    You can set them both up and when you publish just comment out the code that does not apply, this way you still keep it as one project but you can use the ANEs as needed, I had to do this with the iAd ANE only for Apple obviously and AdMob ANE which at the time was Android only.
    Example
    //Android ANE Code
    blah blah blah
    //iOS Code
    code code code
    Now when you publish for iOS comment out the Android related stuff
    //Android ANE Code
    blah blah blah
    //iOS Code
    code code code
    Also dont forget to update your included ANEs when you publish and remove the ones that dont apply and update the XML files as needed. Its possible, but annoying, it would be nice if it was automated or could be flagged somehow so the Flash publisher would auto ignore it.

  • Flex mobile add emoticons and text

    I created a chat program in the mobile project, but I can not add emoticons,I know textarea can not display pictures,So I reluctantly use RichEditableText, it can add a picture, but why can not I enter characters (letters and Chinese characters) in the phone debugging, just enter only numbers, and punctuation symbols。Or there are other ways to solve add text and pictures?

    Thanks much for your response.
    Hmmm...  That appears to work but also causes a runtime exception where there was none before the 4.6 upgrade.  It occurs when I autoscroll on receiving a new message in the chat, something that worked fine in 4.5.
    I guess I'm kind of wondering what the best practice is here.  Maybe I'm just doing this wrong altogether.  I'm finding it very difficult to implement probably one of the most basic features one would find in any collaborative app - something that was very easy in Flex 3 - the chat pane.  I've had one functioning fine for about 3 years.  Not so much in Flex mobile.
    Chat is very simple functionality.  When you receive a new message from afar...
    1.  add it to a TextArea with some nice formatting
    2.  auto scroll far enough so the user can see the new message in its entirety. 
    Nothing difficult at all.
    Why are these two things difficult to find in the TextArea in Flex mobile?  It almost seems as though it's something we're not supposed to be doing? 
    The answer here seems to be don't use Stage Text.  Revert to an older TextArea skin.  Why?  What text area doesn't need formatting as an option?  What text area doesn't need to be auto scrolled here and there?  Or am I just going about this wrong?  Maybe using the wrong components?
    I guess for now I can revert to 4.5 skin, but now the code I used to auto scroll on receiving a new message throws a null pointer exception.  I've been using the valueCommit property to auto scroll, as follows:
    valueCommit="textArea.scroller.verticalScrollBar.value = textArea.scroller.verticalScrollBar.maximum"
    Haven't had a problem prevously.  But this now throws:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at com.components::ChatWindow/__textArea_valueCommit()
    What's the best practice to accomplish this and also to be able to take advantage of the latest and greatest?

  • How to switch to Landscape mode

    Hi,
    I'm starting to programm with the PDA module for Pocket PC and I have a Windows Mobile 2003 SE device.
    Is it possible to programmaly switch to landscape mode ?
    Many thanks in advance
    Gerry

    As far as I know this isn't available.
    If you know of a windows function which can do this, you can try creating a DLL which will call it (using eVC++) and call that DLL from LV.
    Try to take over the world!

  • Can't convert Flex Mobile project to desktop project

    I'm using the Flash Builder 4.6 trial, and I'm very new to flex development. I've been asked to convert an existing Flex Mobile project (appears to have been developed in Flash Builder 4.5) into an AIR desktop app.
    The project imported without complaint. However, the Add/Change Project Type > Convert to Flex Desktop Project menu item is disabled.
    I created a blank Flex Mobile project, then a blank Flex web project, then a blank ActionScript project. It's greyed out for those, too. I checked with the projects closed and open; the rest of the items on that submenu are enabled for all projects when closed.
    Is this feature disabled in the trial version?  Is something else going on?

    Clearly the device from verizon works, I would try to contact a computer tech to repair your computer
    Really it should be as simple as turn on, connect, go. If it isn't there is a break down somewhere in that computer
    What error msg?

  • How to stop multiple auto-switching to address bar every time I open a new tab and try to type something anywhere outside of address bar?

    How to stop multiple auto-switching to address bar every time I open a new tab and try to type something anywhere outside of address bar? Like something just wants me to use that embedded search when u type something not-web-address in address bar and hit enter. And the most ridiculous thing is that it happens repeatedly on like every second, like I just move down from address bar and start typing again, but then again it switches me to address bar, and 3, 4 times like that. And the result is also that I can't see the address of that page.
    I think its has something to do with my AVG antivirus, because this started the same time some AVG Nation started to appear in every new tab i open (and thats also irritating me, I read about it here on support.mozilla.org and it seems that the only solution is to completely reinstall Firefox, but I dont want to lose all my settings) but when i type something in address bar and hit enter it opens the search results in Google.
    Please try to help me, I like Firefox but I must switch to Chrome until I fix this problem.
    Thanks in advance

    First, please update to Firefox 32. 22 is no longer support nor is it secure. Then let us know if you still have this problem. [[Update Firefox to the latest version]]

  • Flex Mobile Project unable to run on android device

    Hi,
    I Have created basic flex mobile project using flash builder and i could able to run on desk top, but while running the same on device i am getting force close exception also dint get any error log. i am using samsung galaxy pop GT-S5570 as my testing device. i have configured usb driver and enabled usb debugging in  my device too. any help to resolve this process?

    08:20:45.751 Raw device 'sd=sd1,lun=/dev/rdsk/c3t5000CCA03EC50D5Dd0s0' does not exist, or no permissions.
    Looks like either your lun doesnt exist  OR you running vdbnech session not as root.
    (Only a guess )

Maybe you are looking for

  • A continuous subform, how do i refer to a specific record

    Hi, I have a form which displays one client at a time.  Inside that i have a subform that shows every phone call ever logged for that client along with the date and time the call was made, sorted with the oldest at the top. Assume main form called fC

  • Error in sap query

    Dear Experts , I have a query and executing using SQ01 . Here im getting warnings as  The query specifications cannot be used to generate a list, i.e. the query will probably not return the list you desire. If you still want to execute the query, ple

  • How do I create a new library in Itunes 11?

    I have converted a bu7nch of songs to MP3 for my Andrtoid player. But they are all listed in my main library. I thought I would create a new library and name in MP3. But I don't see how to create a new library. I tried holding down the Option key and

  • Got Adobe update malware on my iPad. Don't know what to do. Help please

    We have an iPad and 4 iPhones but no iMac in the house and then a windows PC and laptop. Over the weekend we seemed to get infected by the nasty Adobe flash update malware that seems to be going around.  I ran malware bytes on the windows things and

  • Byte[] to float?

    Hi, I'm trying to write an applet which talks to its parent server. The server sends a series of floats (4 bytes each) to the applet, which is stored to a byte array by BufferedInputStream.read(buffer, 0, 4). I need to convert those 4-byte-sized byte