Closing FLEX current application using AS

I use the following code to close the current application using Action Script and JavaScript:
var urlString:String = "javascript:window.opener = self; self.close();";
var request:URLRequest = new URLRequest(urlString);
navigateToURL(request, "_self");
Then I got the message: SecurityError: Error #2121: Security sandbox violation: navigateToURL
Is there a way to solve the problem or should I use another way to close the current application from AS.
Regards,

I have try your code and I got the message:
Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.
at Error$/throwError()
at flash.external::ExternalInterface$/call()
at Maj_Temps_SouthShore_Desktop/keyPressed()[C:\Projets Développement Flex\Maj_Temps_SouthShore_Desktop\src\Maj_Temps_SouthShore_Desktop.mxml:215]
Regards,

Similar Messages

  • Save data while closing Flex mobile application using HTTPService

    On close of the Flex mobile application I need to save some information to the back-end by using HTTPService.
    On creationComplete() of the application I am adding :
    NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);
    On close of the mob application, the following method will get call.
    private function onExit(e:Event):void
        httpServiceCall("log event data");
    The request itself is not reaching backend. I have tested this by installing Wireshark, there is no entry if I close the application in wireshark(wireshark will just catch any kind of requests from frontend to backend).
    I am introducing delay to achieve this :
    public var closeTimer:Timer;
                private function onExit(e:Event):void
                    e.stopImmediatePropagation();
                   httpServiceCall("log event data");
                    closeTimer = new Timer(3000,1);
                    closeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, closeApp);
                    closeTimer.start();
                protected function closeApp(event:Event):void{
                    NativeApplication.nativeApplication.exit();
    The above code is not working. As soon as control comes to onExit() method, application is closing.
    According to my understanding, I have to introducesome delay before closing the application to achieve this requirement. How can I introduce delay in this case?

    Try opening Task Monitor and killing any existing "adl" process before launching.
    Does this help ?

  • Flex-PHP application using LCCS

    I need to create an LCCS video/audio/text chat application which will be deployed on a website with PHP as back-end. Only 2 people can comunicate with each other. There are a few questions I have related to this:
    Do I need to create different rooms for each user chat as 2 users can chat at a time?
    Do I need to create these rooms on the fly using the PHP classes in LCCS SDK to enable dynamic room creations?
    How do I interact with Flex and these Rooms? Do I need to create some PHP services which after creating a room, send the data to Flex, which Flex uses to initiate the chat application?
    Any help would be appreciated and it would be good if someone can share URL to similar tutorial or example.

    Thanks to all those links and comments were really very helpful. Regarding the Wiki link, point 6.c and 6.d mentions that
    For each user and from your own system, get an user ID, a username, and an assigned role.
    Generate an authToken by passing the required parameters to getAuthenticationToken. The token is a unique, signed string created from the your shared secret, the user's ID and username, and their assigned role.
    Here we need to generate user ID and username on server side? Also how do I define roles using server side scripting?

  • How to display data from local csv files (in a folder on my desktop) in my flex air application using a datagrid?

    Hello, I am very new to flex and don't have a programming background. I am trying to create an air app with flex that looks at a folder on the users desktop where csv files will be dropped by the user. In the air app the user will be able to browse and look for a specific csv file in a list container, once selected the information from that file should be displayed in a datagrid bellow. Finally i will be using Alive PDF to create a pdf from the information in this datagrid laid out in an invoice format. Bellow is the source code for my app as a visual refference, it only has the containers with no working code. I have also attached a sample csv file so you can see what i am working with. Can this be done? How do i do this? Please help.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="794" height="666">
        <mx:Label x="280" y="19" text="1. Select Purchase Order"/>
        <mx:List y="45" width="232" horizontalCenter="0"></mx:List>
        <mx:Label x="158" y="242" text="2. Verify Information"/>
        <mx:DataGrid y="268" height="297" horizontalCenter="0" width="476">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
                <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
                <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Label x="355" y="606" text="3. Generated PDF"/>
        <mx:Button label="Click Here" horizontalCenter="0" verticalCenter="311"/>
    </mx:WindowedApplication>

    Open the file, parse it, populate an ArrayCollection or XMLListCollection, and make the collection the DataGrid dataProvider:
    http://livedocs.adobe.com/flex/3/html/help.html?content=Filesystem_08.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_01.ht ml
    http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_6.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/ArrayCollection.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/XMLListCollection.html
    If this post answered your question or helped, please mark it as such.

  • Display PDF document in Flex Windows application

    Hi,
    I am creating a flex windows application using action script and mxml script.I need help in displaying a PDF document in that windows application.I tried google search it is giving me some open source projects with IFrames.But,they can be only used for browser applications(web).So,anyone please suggest me how could i accomplish this task with winows application.
    Thanks,
    adi2010

    Hi Everyone,
    I got the solution for my issue.We need to use HTMLLoader to load the PDF documents in Windows aplication for Flex.

  • Display PDF from flex windows application

    Hi,
    I am creating a flex windows application using action script and mxml script.I need help in displaying a PDF document in that windows application from a netwrok drive or local pc.I tried google search it is giving me some open source projects with IFrames.But,they can be only used for browser applications(web).So,anyone please suggest me how could i accomplish this task with winows application.
    Thanks,
    adi2010

    Hi ,
    The solution for the thread is
    <mx:HTML id="pdfHtml" location="test.html" width="100%" height="100%" />
    var pdfFile:File = File.applicationDirectory.resolvePath(pdfHtml.location);
        pdfFile = new File(pdfFile.nativePath);
        var fileURL:String = pdfFile.url;
        pdfHtml.location = fileURL;
    Thanks,
    adi2010.

  • Closing an application using ios4

    Is there a way to close an application using ios4 without double tapping the home button and closing the application by holding down on the application and waiting for the red minus sign?
    Before you just had to hit the home button to exit the application, and now I'm not sure.
    Not sure it makes a difference if the applications are open, but I thought I'd like to know if there is a simple step to exit and close the application.
    Thanks in advance.

    I actually have noticed my battery is depleting faster since upgrading to iOS4. Basically I've noticed that every time I look at the battery sensor, it's gone down 1% from the last time I looked, and I'm checking it quite frequently. A test I ran was I had Facebook & TweetDeck open at the same time (just 2 apps). I posted a tweet on TweetDeck and found my battery was down 1% in the time it took to draft a small 140 character message. I don't know if that is something to do with the new OS but I do know writing a tweet didn't use up 1 whole percent of my battery before. I think the new OS was really meant for the iPhone 4 and the 3GS was just like an afterthought. Maybe its not the multitasking per se, maybe it's just the new OS eats through more battery naturally but either way, it kind of ***** for those of us who live on our 3GS iPhones and are not eligible to upgrade.

  • How to use custom HTML page in flex web application with out using iframe

    Hi all,
              I have to import a custom HTML page (that has got links to another html pages) inside my flex web application and i dont want to use IFrame. Can you please suggest me with best example.
    Please help me out as i'm new to flex.
    Thanks,
    Swetha.

    Hi, there:
    Best thing to do is to start with the default login.html page, and then modify it. The login screen is fairly complex and it's easy to just miss a JS function you need to call. To get to default page, you would need to do one deploy (to simulator or whatever), and then look for login.html page in the temporary Xcode or Android project generated from the deployment. It should be under the "deploy" directory in your JDev workspace.
    You can also see all the framework JS files and CSS files that way as well.
    We have had customers implementing custom login screen so we know it can work, but they all had to start with the default login screen and then modify it.
    Thanks,
    Joe Huang

  • I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?,

    I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?, I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?, I have built a android application using adobe flex, and i have exported it with native air. The application is working fine on samsung phones whereas it is getting crashed on Moto Phones, which runs on android kitkat, is there any compatibility issue ?

    Thanks, Flex harUI, for the direction in regards to isolating build changes. That aside (still working on it), can you offer any direction in regards to my original question on SDK and AIR compatibility? I'm specifically looking for a version compatibility mapping or anything that definitively states, "Flex SDK x.y.z works with the following versions of AIR". This information is crucial for us in order to more specifically plan our own roadmap built upon these two frameworks as we consider both existing installations of our software and future distributions.

  • Control Flex application using presentation clicker

    I am building an application using Flex and need the ability
    to navigate through a "table of Contents" list using a presentation
    clicker, similar to navigating through a powerpoint presentation. I
    have been searching through the forum most of the day and haven't
    come across any information.
    Any help would be greately appreciated.
    Thanks!

    This is not a support forum for Flex.
    Try asking your question on FlexCoders:
    http://tech.groups.yahoo.com/group/flexcoders/

  • Attempting to install Flash plugin 11.4 but getting error: application currently in use

    I try to get a support in the Adobe forum. While I am waiting for any responses, I might as well look for the same here. Maybe someone have an idea.
    Last night, my Firefox 16.0.2 prompted sites like Youtube to upgrade my Flash Player. First attempt at installation was successful (if I remember it), but somehow Firefox slowed down at confirmation. So, I try to uninstall and reinstall Flash Player. Yes, I did complete uninstallation. Any subsequent attempts led to error: application currently in use.
    Earlier today, I resetted my Firefox browser. First attempt at another installation was successful, but the browser seemed to hang or slow down for a while until the Flash confirmation page showed up. I thought for sometime, everything went fine. It did not when I was having trouble watching flash player content from a site. I figured I better uninstall and reinstall it again. Here I go again with the error message like the above.
    Any idea what I should do next or how should fix this? Any input is appreciated. I'm using Windows 7

    Please restart you computer after the uninstall then try installing again.
    Thanks!

  • [svn:fx-trunk] 5604: Ensuring qualified class names are used in type selector cache keys for Flex 4 applications .

    Revision: 5604
    Author: [email protected]
    Date: 2009-03-26 14:00:26 -0700 (Thu, 26 Mar 2009)
    Log Message:
    Ensuring qualified class names are used in type selector cache keys for Flex 4 applications.
    QE: Yes, this should address style issues for test cases that contain two different components with the same local name.
    Dev: No
    Doc: No
    Checkintests: Pass
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • What is the best font to use for Thai Language in Flex Mobile Applications ?

    Hi
    I am facing issues with Thai language in flex mobile applications. I am using Tahoma font and facing issues in TextInput
    Whith Tahoma font text Offset setting to far from the starting of the text input .
    Can any one suggest me the best font to use with Thai language ?
    Many thanks in advance for your help .
    Regards,
    Kamal

    Personally, I prefer uncompressed TIFF or PNG.  But many times it won't matter ... you'll be dropping the images into an SD Sequence, so they will lose resolution on output.
    -DH

  • Attempting to Upgrade to Flash Player 11.4 - Error: application currently in use

    I noticed that at least other have experienced this, but in a different browser.
    Since last night, sites like Youtube has prompted to install the latest version of Flash Player. So, I went ahead installing the new version by following the instructions. Somehow, I kept getting this message - Error: application currently in use. I tried uninstalling and reinstalling, but kept getting that error message.
    The browser with the problem is Firefox 16.0.2. I'm using Windows 7. The problem does not appear in Chrome and Chrome has not prompted me to upgrade to the latest version of Flash player.
    I appreciate any input.
    Thanks,
    G.
    Please don't refer back to that Flash Player Issues Link, because I have visited it many times. The guide there has not specifically address this issue much.

    Could you please download the installer from the following link: http://helpx.adobe.com/flash-player/kb/installation-problems-flash-player-windows.html#mai n-pars_header
    Then close all browsers and double-click the downloaded file.
    Thanks,
    Sunil

  • Unable to record Flex based Windows application using LR Vugen 12

    Hi,  I am facing issue with LR Vugen 12.0.2 version. when I try to record one  windows based application using flex protocol it does not get launched instead it is shown in  : Task manager process list. I can launch the same application manually and also I have admin privilege for the LR. The application I used to record with 11.52 sometime but with LR 12 I am not. Using : Prorocol: FlexRecording mode: WinInet  Thanks

    Hi
    Every thing was working fine till today and i just found out that the network guys has updated the Windows security and also the Service Pack on the Server and i think this is causing the whole issue.now my Question is that if i uninstall all the security updates and the SP2 will the issue be solved.
    also i need one confirmation that the Windows OS we need SP1 instead of SP2 please re-confirm this.
    Thanks
    Aleem

Maybe you are looking for

  • How do I move my i-tunes libraries which are on my "C" drive under "My Music" to i-tunes libraries?

    Recently, my hard drive had to be reconfigured. i-tunes libraries under i-tunes show on the screen but are not located.  All of the i-tyunes libraries are located on the "C" drive under "My Music" libraries.  How I transfer/copy the music libraries t

  • Partial transparency with save for web gif?

    Hey all, I remember back in the day of photoshop 6 or maybe even 7, when I would create partial transparent .gif files through the "view menu" export transparency button, or something like that, and it would let me create beautiful partial transparen

  • Sun's JSF1.1 version with facelets not working

    Hi all I am trying to run my application using sun's JSF1.1 version with facelets. But not able to succeed in this. Can anyone tell me is JSF 1.1 is compatible with facelets? Any help would be really appreciated. Thanks.

  • Kernel panic when resuming from sleep

    I've been getting random kernel panics on my MacBook Pro when resuming from sleep. That is, only when resuming from sleep - otherwise the computer is fine. I read some other discussions on here regarding kernel panics, but it seems that an inspection

  • ESS - RPTARQPOST (Approved Leave)

    Hello, I was wondering if anyone has ever worked on the ABAP program RPTARQPOST which posts approved leave via infotypes 2001. Currently, people apply for leave thorough our ESS system. RPTARQPOST is then run and the infotype leave records are create