Database and Views, Flex Mobile

HI !
in flex mobile, every time I do a query, I have to re-open the database for each view? thanks!

I'm guessing you have to reconnect your class because you are instantiating it in each view
the idea is to instantiate and connect the database class and each view use the same instance (which is already connected) so you only want to instantiate the class once
You could do that in the main app and pass it to each view that needs it, but that can get complictaed and tedious for larger apps and not good practise
or use a singleton which acts like a global or static class, the same instance available everywhere
or (the best way) use a framework which instantiates the class for you and you can simply inject it to each view.
there are plenty of guides to AS3 singletons on google
I found this video useful. Its a bit long but might give you some ideas on the way to go
http://tv.adobe.com/watch/max-2010-develop/flexactionscript-30-architecture-and-dependency -injection-frameworks-overview/

Similar Messages

  • Problem in retreiving from database and viewing it in browser--urgent

    hai,
    i have develped an application using swings where the mails received from client and reply posted will be pasted in JEditorPane. all the mails,query and reply will be stored in database.
    then iam retrieving the mails from database and displaying it in browser using table data.(Just like forum). Iam using encodehtmltag function to omit the html tags that r present in the mail data.
    when i display it in browser it extends a page horizontically. how to avoid this. how to word wrap. one of my friend asked me to set number of character to be displayed per line. i did that. but problem is i could see the word break . i have set 90 characters to be displayed per line. i dont want to break the word. for eg., if the end string of a line is regarding it is displayed like this---reg and then arding in next line. how to avoid this.
    please help me iam breaking my head with this for past few days.

    If the field is a Date in your database, you can use the ResultSet.getDate() method, which will return a java.sql.Date (which extends java.util.Date).
    You can then use SimpleDateFormat to format it the way you like.
    See the API doc for more details.

  • Is there a way to save data to just one view in Flex Mobile applications?

    I am having trouble handling data between views in a Flex Mobile application that I am writing. I know how to pass data from one view to another, but I was wondering if there is a way to save that data to a view, then get more data from another view (in this case it would be the same view that the original data came from) and put that data on the same view without overwriting the original data. I would be glad to post some code if anyone needs to see it.

    I think we realise that this is the same question as the other thread.

  • Flex mobile and PHP project

    Hi! Recently I've downloaded the Flash Builder for PHP to work with my Zend Server remotely located in OpenShift online. I did not  download and install the Zend Server physically on  my computer. Hence, when creating the Flex mobile and PHP project, I couldn't find my web root address. Now I have an error connecting to the MySQl database in the server from the Flash Builder. Can someone help me with this? I'm new to using these programs.
    I'm following this guide on building mobile apps:
    http://files.zend.com/help/Flash-Builder-for-PHP/Getting-Started/Mobile/build_a_mobile_(ph p)_application.htm#Step_13:_Preview_the_Mobile_Application_Using_the_Desktop_Emulator

    PHP is server side.
    If you want to have a app to function offline you would probably need sqlite and then code actionscript to synch data when the device regains it's connectivity.

  • 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

  • PDF stored in database and to view the PDF when clicking on a link

    Is it possible to save a PDF document in the database as a blob column and to retrieve the PDF when clicking on the link
    Example
    Above method is possible for images
    See: http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm.
    But can I reach the same for PDF documents?
    Thanks in advance for your response.
    Kind regards,
    Iloon

    Hello Andy,
    This Upload and Download Files is very useful feature in APEX.
    However, is there a way of displaying PDF files first in the report by clicking the corresponding link
    in the table?
    I mean, is it possible to view PDF files first by clicking the link before deciding to download them?
    As we see, this approach is used by most websites and after opening and viewing a PDF file, we can save them.
    Thanks.
    Shurick.
    Edited by: Shurick on Sep 28, 2009 12:51 PM

  • Include or create a view in the database and use this view?

    Well, I need to get related data of the main table from another related tables, so one way to do that is to use the Include method in Entity Framework to get this related data.
    However, I am thinking in another option, create a view in the database and use this view in entity framework. In this way, I avoid the needed of the include, because I think that is expensive in resources. But I am no very sure about that.
    I would like to know if the use of views on entity framework is a good idea to improve the performace or is better to use the include.
    For example, if I use the include I have the advantage that I get only one the main record and all the related data I have in the navigation properties, so the info is more shorted.
    Which is the advanteges and disadvantages of both methods to get related data in entity framework?
    Thank so much.

    Hello ComptonAlvaro,
    >>I would like to know if the use of views on entity framework is a good idea to improve the performace or is better to use the include.
    If your view would use a Join syntax to query master-child relationship tables, it actually is similar with the Include() method which actually results a duplicate records from master table, you could check this
    link for detail description.
    >>Which is the advanteges and disadvantages of both methods to get related data in entity framework?
    One visible difference is that records from Views are not editable by default(if you want edit them, you could refer to this
    blog).
    In your case, my suggestion that you could use the lazying load which will load the matter table once and disable the trace if you only need to display data.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Oracle 9I Database, and Mobile Server install history

    Dear Oracle technical representative:
    This TAR started out as a true request for help in solving installation problems with Oracle 9i Release 2 Enterprise Edition, and Oracle 9i Mobile Server Release 5.0.1, but it has turned into a history of frustration with out of date, laconic, and often incorrect, and misleading documentation. As a software developer, I understand that documentation is always out of date, at least mine is. Nonetheless, I must speak my mind while understanding, and sympathizing with your situation.
    I struggled through the documentation, and managed to get everything working. While I was doing that, I wrote down the step by step procedure that I used to get Database, and Mobile Server running. By sharing this rough install history with you, it is my hope that it will help prevent others from experiencing the same difficulties that I have had. It has been my observation that when a user has problems installing a trial software package they give up quickly, and do not purchase a copy. It is thus extremely important that the installation instructions, and quick start guide be accurate, attentive to detail, and well written. The first impression is the one that counts.
    The Oracle 9i Lite Installation, and Configuration Guide for Windows NT shipped with Oracle 9i Lite Release 5.0.1 definitely requires, and emergency rewrite. It is terribly out of date, inaccurate, and laconic. My guess is that it is a very sloppy rewrite of poorly written 8i documentation. The Oracle 9i Database Installation Guide for Windows is somewhat better. It however should do a better job informing you that before installing onto a old server the Microsoft Foundation Class (MFC), and VC runtime libraries must be up to date. The history describes the trouble with not having the MFC42.dll at version 6. Another corker is that the default port the installer presents is 2030, and not 1521, and that leads to major confusion in the both the Database, and Mobile Server installs.
    Thank you for looking at the history. I hope that it will be of use to you when you update your documentation.
    Thomas G. Matney
    Mississippi State University
    [email protected]
    (662)325-2791
    TAR for Oracle 9i Release 2 Database Enterprise Edition, and Oracle Lite Release 5.0.1 Mobile Server
    Installation problems are highlighted in red.
    Installation sequence/history:
         1. Installed Windows NT 4.0 Server SP1 on Dell Power Edge 4300 dual x86 server to wipe the slate clean.
         2. Setup TCP/IP, and IPX/SPX networks
              Computer name YGGDRASILL
              Host name = YGGDRASILL
              Domain = CFR.MSSTATE.EDU
              Internet name = YGGDRASILL.CFR.MSSATE.EDU = 130.18.130.225
         3. Installed NT SP3, and Internet Explorer 4.01 from the NT 40 Options Pack CD as the gateway to installing MTS 2.0, and IIS 4.0.
         4. Installed MTS 2.0, and IIS 4.0 from NT 4.0 Optins Pack CD.
         5. Applied NT 4.0 SP6.
         6. Installed Internet Explorer 5.5 as a prerequisite to installing MADAC 2.6.          
         7. Installed MDAC 2.6
         8. Installed Paint Shop Pro 7 for capturing error screens.
         9. As previous install errors stated that the ordinal function xxxx could not be found in MFC42.dll, the latest version (6.0.8665.0) of the dll was installed, and registered from MS VC++ SP5. Also I upgraded MSVCIRT.dll, MSVCRT.dll, MSCRT40.dll, and added MSVC60.dll from SP5 to be on the safe side.
    According to the installation documents all the prerequisites for installing Oracle 9i Release 2 Database Enterprise Edition are satisfied.
         10. Began install of Oracle Database Enterprise Edition with target parameters:
              Home directory = D:\Oracle\Ora92
              Database directory = D:\Oracle\oradata
              Global database name = FIA.YGGDRASILL.CFR.MSSTATE.EDU
              Port = 2030
              SID = FIA
              SYSTEM Password = phwphw
              SYS Password = phwphw
              SCOTT Password = phwphw
              DBSNMP Password = I left this one unassigned or empty.
              tnsnames.ora entry for remote TCP/IP connection
              a. CD 1 of 3 load
                   1. Error writting to MFC42u.dll. Action ignore. A check indicated that MFC42u.dll version did not match the updated version of MFC42.dll. Plan is to update after install. Unicode version of MFC is probably not used by the installer.
              b. CD 1 completed with only one problem, and CD 2 load begins.
              c. CD 2 installed without incident., and CD 3 load begins, and completes without farther problems. The only issue to address at this time is to update the MFC42u.dll.
                   HTTP Server URLs
                        http://7778
                        https://4443
         12. Evaluation of install success begins.
              a. Oracle HTTP Service will not start. It is of particular interest that on installs that I do not upgrade the MFC42.dll the Oracle HTTP Service will start correctly, but during the install I get the error message Ordinal nnnn not found in MFC42.dll, and the Oracle MTS Recovery Service crashes during the install. I am caught between a rock and hard spot on this one. See the Figure 1. At the end of this document. I do not need the HTTP Server at this time but I will need it later and this issue must be resolved. It appears that it hangs during startup. I am sorry but I lost the ordinal number nnnn.
              When I try to start the HTTP server from the Programs menu. It Hangs, and does not return an error message. See Figure 2, and the included Apache Setup.txt, the install log, and the HTTPd.conf . The conf, and setup files look OK to me. What is the problem?          
              b. All other services start correctly.
              c. Logged into the database as SCOTT on the server with SQL Plus using the connection information:
                   FIA.CFR.MSSTATE.EDU =
                   (DESCRIPTION =
                   (ADDRESS_LIST =
                   (ADDRESS = (PROTOCOL = TCP)(HOST = yggdrasill)(PORT = 1521))
                   (CONNECT_DATA =
                   (SERVER = DEDICATED)
                   (SERVICE_NAME = FIA.YGGDRASILL.CFR.MSSTATE.EDU)
              I created some tables, inserted data, and queried for the data. Everthing seems to be working correctly.
              d. Logged in remotely from my AOL account on a dial-up line using Oracle 9i Release 2 Personal Edition installed on my ThinkPad. Every thing tested out as above. I used the connection information:
                   FIA.CFR.MSSTATE.EDU =
                   (DESCRIPTION =
                   (ADDRESS_LIST =
                   (ADDRESS = (PROTOCOL = TCP)(HOST = yggdrasill.cfr.msstate.edu)(PORT = 1521))
                   (CONNECT_DATA =
                   (SERVER = DEDICATED)
                   (SERVICE_NAME = FIA.YGGDRASILL.CFR.MSSTATE.EDU)
         13. I concluded that except for the Oracle HTTP Server Service not starting correctly, and that after updating the MFC42u.dll to VC++ SP5 level the stage is set for installing Oracle 9i Mobile Server Release 5.0.1. I copied the MFC42u.dll to the server and registered it successfully.
         14. As Visual Studio 6.0 Professional updates all of the MFC stuff, I decides to install it at this juncture, and apply SP5.
         15. Installed JDK1.3.1 required for Oracle 9i Mobile Server Release 5.0.1
    At this time the prerequisites for installing Oracle 9i Mobile Server Release 5.0.1 are satisfied, and MFC, and rt are at version 6.
    It is important to note that after installing MS Visual Studio Professional 6.0 SP5, the HTTP server started working. It is clear that prior to installing Oracle Database it is essential that MFC, and possibly other components are upgraded before starting an installation of Oracle. This probably only applies to old NT servers, but it should be mentioned in the installation instructions.
         16. Attempt to install Oracle Mobile Server Release 5.0.1
              a. File locations Screen
                   Name: = OraLite501               
                   Path: = D:\OraLite501
              b. Select Mobile Server at Installation Screen
              c. Mobile Server Repository Database Information Screen
                   Hostname = YGGDRASILL = hostname from tnsnames.ora
                   Port = 2030 = same as Database port
                        It is troublesome that the port in tsnames.ora is 1521, and not 2030 as was specified in the database install. I will try this port on the reinstall. On the retry, it worked. The problem was that I was mislead by the default port of 2030 at the database install. The database was actually installed on port 1521, and I was not given an error message, or warning. As I am a first time installer of Oracle products this threw me for a loop. The default port for the database needs to be 1521, if regardless of what the user specifies for a port you are going to install on port 1521.
                   Net Service Name = FIA.YGGDRASILL.CFR.MSSTATE.EDU = Global database name as required by installation instructions.
              d. Yes. At Do you want to install the Mobile Server Repository question.
              e. At Oracle Protocol Support, I checked the SPX box.
              f. Summary, and Install screens function to specifications.
              g. Mobile Server Repository Wizard
                   Database System password:
                        Password = phwphw
              h. Mobile Server Repository Wizard
                   Schema Name: fiafield
                   Password : fiafield
              i. Success at last with the install part. The problem was the wrong port number. See my above comments on this problem, and how Oracle could grease the skids for the next first time installer.
         j. I could not find the httpd.conf file in the place the install instructions said it should be for running the Mobile Server in Oracle HTTP Server. Since only one copy of httpd.conf existed, I added the include D:\OraLite501\mobile\server\bin\wtgias.conf to the bottom of the file assuming that it is the correct one. I the re-booted instead of using apache -k restart. The Oracle HTTP Server started, so there is hope. The install instructions state that the httpd.conf file would most likely be in the program files directory, when they are really installed in the Oracle Lite home directory.
         k. According to the documentation the Mobile Server should start when the Oracle HTTP Server starts with the wtgias.conf file added to the httpd.conf file. It does not. If I use Process Explorer, I know that Apache loaded the wtgias.conf, because both Apache.exe processes that are running have the wtgias.dll loaded. The facts are at this stage of the game are
              1. OraMTSRecoveryService is started
              2. OracleOraHome92HTTPService is started
              3. OracleOraHome92Listener is started on port
              4. OracleServiceFIA is started
              5. Apache.exe has the wtgias.dll loaded
              6. The Moble Server is not running and it should be if the documentation is correct.
              7. If I start the Mobile Server either as a service using wtgsvc -i or with the webtogo command from the DOS prompt, the Mobile Server starts, but when I attempt to log in with the URL http://Yggdrasill:7778/webtogo/startup it inform me the Mobile Server is not started and it is. Figure 3 shows the response I receive from the login attempt.
         l. I finally ran the Mobile Server in total debug mode using the command webtogo -d0", and it gave me the subtle hint that the correct URL is
              http://Yggdrasill.cfr.msstate.edu/webtogo/startup.
         When I use the above URL and I can login to the Mobile Server with UN = fiafield, and PW = fiafield. I was confused by the documentation. I was under the assumption that the host address would be either http://Yggdrasill:7778, or http://Yggdrasill:4443. After all when I, installed Oracle Database these URLs were listed. It needs to be made clear in the installation guide for the mobile server that the Mobile Server address is http://Your servers WWW address/webtogo/startup, and the statements about the Mobile Server will start when the Oracle HTTP Server is started needs to be removed since they are incorrect. Also, the documentation should clearly state that the Schema Name, and Password given in the Repository Wizard Screen are synonymous with the username, and password for the Mobile Server login.
         m. After determning the hard way that the Mobile Server does not start when the the Oracle HTTP Server starts, and that the correct URL is http://Internet address/webtogo/startup = http://Yggdrasill.cfr.msstate.edu/webtogo/startup, I decide to start the Mobile Server as a service with the command wtgsvc -i. After I re-booted, to my surprise, I could not login to the Mobile Server. When I checked the system services, the webtogo service was running. So to give the start as a service thing a fair chance I re-booted again, but obtained the same results. I thus concluded that the Mobile Server will not run correctly as a service. As it turns out my conclusion was wrong. After waiting a few minutes, my login try was successful. The documentation should indicate that after booting it may be a minute or two before the Mobile Server service become available.
         n. After some serious problems with the installer, and the documentation everything is working. I have a green light to go on to the next stage, which is program the handheld to take advantage of the Mobile Server. I will be glad to get back to programming, and am so thankful that I am not a network administrator.
         Appendix
    HTTPd.Conf (Abstract only), Apache Setup.txt,
    tsnames.ora, and listener.ora.
    HTTPd.conf (Abstract only)
    # Based upon the NCSA server configuration files originally by Rob McCool.
    # Include the Oracle configuration file for custom settings
    include "D:\oracle\ora92\Apache\Apache\conf\oracle_apache.conf"
    include "D:\OraLite501\mobile\server\bin\wtgias.conf "
         tsnames.ora
    # TNSNAMES.ORA Network Configuration File: D:\oracle\ora92\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    INST1_HTTP.CFR.MSSTATE.EDU =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = yggdrasill)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = SHARED)
    (SERVICE_NAME = MODOSE)
    (PRESENTATION = http://HRService)
    FIA.CFR.MSSTATE.EDU =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = yggdrasill)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = FIA.YGGDRASILL.CFR.MSSTATE.EDU)
    EXTPROC_CONNECTION_DATA.CFR.MSSTATE.EDU =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
              listener.ora
    # LISTENER.ORA Network Configuration File: D:\oracle\ora92\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = yggdrasill)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle\ora92)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = FIA.YGGDRASILL.CFR.MSSTATE.EDU)
    (ORACLE_HOME = D:\oracle\ora92)
    (SID_NAME = FIA)
              Apache SetupInfo.txt
    The following information is available in:
    D:\oracle\ora92\Apache\Apache\setupinfo.txt
    The HTTP Server can be accessed using the following URLs:
    http://yggdrasill:7778
    https://yggdrasill:4443

    You can find information regarding enabling the iSQLPLUS in the following Oracle manual.
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch2.htm

  • Flex mobile project: web root and root path for a remote web service?

    Hi all,
    i'm trying to set up the testdrive tutorial for flex mobile project, with flash builder 4.5
    and php data.
    I've uploaded the files on my remote web space (e.g. http://mywebsite.org, and the
    test file is http://mywebsite.org/TestDrive/test/test.php... and it works
    correctly)... But when i'm setting properties of the project, i don't know what
    to write into the web root and root path fields... I thing root path is simply
    http://mywebsite.org... and whatever i write in the other fields (output folder
    too) i have errors when i click on "validate configuration"...
    What should i put into those fields? is zend framework (and gateway.php)
    strictly necessary?
    As you can see... i'm a bit confused....
    Many thanks for any help
    Bye
    Alex

    I thought it was a simple question...
    No advice?

  • How to display html content with image in Adobe Flash and Flex mobile project?

    Hi,
      I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?

    Hello,
    The only current way is to use an iFrame, or if you only need some html tags you could use the Text Layout Framework.
    Here this is the iFrame approach:
    http://code.google.com/p/flex-iframe/
    If the swc do not work in Flex4 just use its ource code which works...
    ...it is basically based on this:
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    see also and vote, please:
    http://bugs.adobe.com/jira/browse/SDK-12291
    http://bugs.adobe.com/jira/browse/SDK-13740
    Regards
    Marc

  • Flex Mobile 4.5.1: Package contents and URLLoader

    On Flash for web and desktop (Projector debugger), one can use a URLLoader to load local URLs (eg files off your hard drive).  This is very useful for some development purposes, as you just need to make sure any external files (JSON & PNG) are in the same relative path as the SWF, and you then don't need to worry about different code paths whether you're loading these external files from local storage or http.  URLLoader operates the same whether loading locally or remotely.
    Is there any way to easily get the same behavior on a Flex Mobile 4.5.1 app (specifically for an iOS target)?  Again, this is useful because in my live app, these external files will be loaded from our web server, but for testing purposes I would like to be able to run in a server-less mode and include them with the deployed debug IPA file.  My first problem is that I cannot seem to figure out how to deploy these files to the application in the first place - I tried adding my external-files folder to the Flex Build Path as an additional Source folder, but they still don't show up under the Package Contents for iOS tab.
    Any ideas?  Are there any include-extra-files-in-package options in the -app.xml? 
    Or is there no way to use URLLoader for local storage on mobile, and I am stuck with using Embed?  (I guess besides Embed I could manually deploy the files to the iOS file system and use the AIR api for access, but that's still a different code path, defeating my goal - we have a decent bit of code built around the idea that URLLoader is agnostic)

    Edit: Realized my original answer wasn't correct, the files were being pulled in from another setting.
    After some experimenting, the answer is YES, and it's actually a bit unexpected: Just in fact adding the external files folder to the Flex Build path | Source Path actually pulls them all in.  It seems those directories are passed to both mxmlc and adt.  Unexpected surprise.

  • IOS universal support and ASC 2.0. Will it impact Flex Mobile projects?

    Hello,
    Regarding the latest release notes for AIR 16, it says
    "The legacy compiler is not (and will not be) compatible with iOS 64-bit.[...] it will be removed with version 16 of the AIR SDK"
    I am a bit lost with what it means for Flex Mobile (4.6 or Apache Flex SDK). Will we still be able to compile once AIR 16 is out or will this new compiler have issue with Flex projects compiled for iOS? Will it need us to make some changes on existing Flex applications?
    Thanks for your clarifications,
    Fabien

    It seems this wrong rumour is spreading around... a lot of people don't bother researching properly.
    When they talk about the legacy compiler they talk about ADT, MXMLC will continue to work. The simplified IPA packaging process is: Source code --- MXMLC/ASC2---> SWF ---ADT AOT Compiler---> IPA
    So with AIR 16 the ADT -useLegacyAOT argument will be removed.

  • 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, URLLoader and Sessions

    I have created a Flex Mobile Project that I've been testing so far on a Motorola Xoom and uses the URLLoader object to query some JSP pages and return the output. These JSP pages require user authentication which depend on sessions.
    If my URLLoader requests are made sequentially (the second request is not made until the first is completed) session information functions normally. If multiple URLLoader requests are made at the same time there is a chance that one or more of the request's session information will fail. I've used a packet sniffer and found that the "Cookie: JSESSION=..." header value is not being set or sent to the server.
    I've actually been able to solve this problem by fetching my session ID when I login, storing it locally and setting the "Cookie: JSESSION=..." value manually in the header of all my URLLoader requests. Most of the time the browser will overwrite this value that I've set with the session ID that it has, and that's fine. But in the case where it doesn't set this value then my manually set value is passed to the server and it is able to find the appropriate session.
    The solution I've come up with seems to work so far, but I was still wondering if anybody knows what's causing this or knows a better solution?

    That sounds like everything's working the way it should. Until the "first" request is authenticated successfully and the response comes back to the browser/device, your app doesn't have session credentials. Sending multiple simultaneous unauthenticated requests will thus all need to authenticate individually -- and making matters worse, may create multiple sessions on the server, so as they come back your session info (as represented by your JSESSION ids) will rapidly run through all the new sessions until settling on the last one.
    I would suggest changing your application flow to let your first request go by itself first and not submit any other requests until that (authenticated) response is received.
    -- Tom
    Flex SDK engineer

  • Flex mobile and databinding

    Is data binding feature supported in flex mobile project? I have data binding code used in <s: Application>. When I move the application to flex mobile in <s: view>, I can't seem to make data binding work.

    <?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:amcharts="http://www.amcharts.com/com_internal"
                                     backgroundColor="#FFFFFF"
                                     width="100%" height="100%"
                                     viewSourceURL="srcview/index.html">
      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      <fx:Script>
                                  <![CDATA[
                                            import mx.collections.ArrayCollection;
                                            import flash.filters.DropShadowFilter;
                                            [Bindable]private var chartData:ArrayCollection = new ArrayCollection([
                                                      {year:2001,income:23.5,expenses:18.1},
                                                      {year:2002,income:26.2,expenses:22.8},
                                                      {year:2003,income:30.1,expenses:23.9},
                                                      {year:2004,income:29.5,expenses:25.1},
                                                      {year:2005,income:24.6,expenses:25.0},
                                                      {year:2006,income:25.5,expenses:18.1},
                                                      {year:2007,income:26.2,expenses:52.8},
                                                      {year:2008,income:36.1,expenses:23.9},
                                                      {year:2009,income:24.5,expenses:33.1},
                                                      {year:2010,income:44.6,expenses:29.0}
                                            [Bindable]private var shadow:DropShadowFilter = new DropShadowFilter(2,45,0,0.5);
                                  ]]>
      </fx:Script>   
                        <s:VGroup width="100%" height="100%">
                                  <s:Group width="100%" height="100%">
      <amcharts:AmSerialChart
                                                      id="chart"
                                                      width="100%"
                                                      height="100%"                
                                                      dataProvider="{chartData}"
                                                      categoryField="year"
                                                      angle="30"
                                                      depth3D="30">
      <amcharts:graphs>
                                                                <amcharts:AmGraph title="Income" id="g0" valueField="income" type="column" lineAlpha="0" fillColors="[#ADD981]" fillAlphas="[1]"/>                       
                                                                <amcharts:AmGraph title="Expenses" markerType="line" id="g1" valueField="expenses" type="line" lineThickness="2" bullet="round" filters="{[shadow]}"/>                       
      </amcharts:graphs>
      <amcharts:valueAxes>
                                                                <amcharts:ValueAxis dashLength="5"/>                           
      </amcharts:valueAxes>
      <amcharts:categoryAxis>
                                                                <amcharts:CategoryAxis gridPosition="start" dashLength="5"/>
      </amcharts:categoryAxis>
      </amcharts:AmSerialChart>
      <amcharts:AmLegend
                                                      color="0x000000"
                                                      x="45"
                                                      y="10"
                                                      switchable="false"
                                                      dataProvider="{chart}"
                                                      width="100%"
                                                      marginRight="20"
                                                      marginLeft="40"
                                                      textClickEnabled="false"
                                                      marginBottom="5"/>                    
      </s:Group>
                                  <s:HGroup width="100%">
                                            <mx:Spacer width="32"/>
                                            <mx:DataGrid dataProvider="{chartData}" width="100%" editable="true" height="100"/>                   
                                            <mx:Spacer width="20"/>
      </s:HGroup>
                                  <mx:Spacer height="10"/>
                        </s:VGroup>           
    </s:View>

Maybe you are looking for

  • How can I turn an audio podcast into a video for Youtube using iMovie?

    Hey there, guys. I'm trying to turn a podcast I created in Garageband into a movie using iMovie so I can upload it to YouTube. Now, for the duration of this podcast, I simply want one picture to show on the screen. So, in other words, the cast goes f

  • Connection to UDDI via /uddi/api/inquiry

    Hi, I was reading the blogs and threads written on UDDI and the use of the publishing services. I have two questions that I would like to ask if anyone could please assist me with them: - When using the local registry is it possible to login into the

  • Can I select and drop multiple photos onto the video timeline in the order that I select them?

    can I select multiple photos and drop them onto the video time line in the order I select them in? Why do I loose the link to my files in the organiser? I have edited and saved several projects, now I want to combine them as one movie how do I do tha

  • Why can't Wells Fargo recieve ebills from Verizon?

    I have a WF bill pay account and it USED to be able to recieve automatic ebills from Verizon.  All of a sudden, I get a notice saying that I can't anymore.  I have deleted the Verizon payee and re-entered it.  When I tried again, Wells Fargo says it

  • Performance Problem After upgrade to oracle 10g

    Hi I have upgrade one of my datawarehouse database from oracle 9.2.0.8 to oracle 10.2.0.4 running on solaris 9 After the upgrade jobs which were running in the database is taking hell lot of time. The jobs are accessing the views which is used to get