How to stop the Flex application when user clicks on Cancel button from JS-confirm message?

Hi All,
I use the next code when a user clicks on a link:
private function clickHandler():void
      ExternalInterface.call('confirm', 'Of course you want to go to the Adobe forums!');
      navigateToURL(new URLRequest('http://forums.adobe.com'), '_self');
This will show up the javascript confimation box. But when the cancel-button is clicked, the user goes straightly to http://forums.adobe.com...
How to stop Flex performing the next code when a user clicks on the Cancel button?
Or, how to catch which button is clicked by a user in Flex?
Thanks!

I agree with Mr. Hall that using mx.controls.Alert in Flex may be a better route.
Show the Alert like this:
// show an alert with a question and yes and no choices
Alert.show( "Would you like to go to the Adobe Forums?", "Question",
     Alert.YES | Alert.NO, this, closeHandler, null, Alert.YES );
Then handle the response in the closeHandler() function:
protected function closeHandler( closeEvent:CloseEvent ):void
if( event.detail == Alert.YES )
     navigateToURL( new URLRequest('http://forums.adobe.com'), '_self' );
else if( event.detail == Alert.NO )
     // they chose no
The following documentation on Alerts may be helpful:
http://www.flexafterdark.com/docs/ActionScript-Alert
Let me know if that helps...
Ben Edwards

Similar Messages

  • How to make the page expired when user click back

    how to make the page as expired when i click back button on the browser.
    i want a better way.
    actually i have a timer.when it reaches 00.00 then the expired page will be called automaticlly using location.href="expired.jsp" then if the user clicks back it should not show the previous page.this concept is applied with paging concept
    response.setheader is not working ...
    i have redirect when click back using
    <body onunload>....i call another page here.
    but it is not a good way.
    so pls help me to solve this problem
    using session or another good way

    Use this instead.
    Frame.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);

  • Could somebody please advice how to stop the pages dropping ,when l go on ebay ,utube etc

    could somebody please advice how to stop the pages dropping ,when l go on ebay ,utube etc

    could somebody please advice how to stop the pages dropping ,when l go on ebay ,utube etc

  • When user clicks on "Like Button," the counter increases but nothing shows up showing the user recommends my site to their friends. What did I do wrong?

    When user clicks on "Like Button," the counter increases but nothing shows up showing the user recommends my site to their friends. What did I do wrong?
    I used the iframe code from Facebook's "Like Button" site; and inserted the code in the html widget popup box, then positioned it where I wanted it on my page and published. It looks fine (though I had to add "http" before my url to get it to show up).
    So, when a user clicks on button, a pop-up opens asking for Facebook password. When I (the user) enter a password, nothing happens after that. I thought the idea was that a user would be able to show their friends that they like my website. After I entered my password in pop-up after clicking on "Like" I went to my facebook page (a company page) to see if it showed that I (the user that clicked on "Like" on iweb) recommended the website. But nothing showed up. I thought maybe it was because Facebook associated my password as the admin for the Facebook page so didn't count it. But a friend tried it and same thing happened. I went back and on one page I put in another facebook code for a combo Like/Send button. It shows up but acted the same as the regular Like button.
    Questions:
    1. Is this the way the Like Button is suppose to work? Only benefit of Like button being that it just counts the clicks on the Like button and does NOT let users share their recommendation with their friends?
    2. If it's suppose to let users share their "Likes" with their friends, what did I do wrong? There were three types of code but in reading discussions, they all say to use iframe. (I used the first choice which I think was html for Javascript SDK and put that in my HTML Snippit box and the Like/Share button showed up on my iweb page next to the facebook icon and the words "likes this" but when I click it, I don't see instructions that it's sending my recommendation to my friends.)
    I must have done something wrong, but can't figure out what. Does anyone know? If the only benefit of the Like Button is the counter, it doesn't seem worthwhile.
    Thanks to anyone who can figure this out!  My website is couponsforfun.com

    You want something like this?
    http://home.wyodor.net/demoos/facebook/
    The send button sends the link to their friends in the address field with a message.
    They recieve a message in the inbox.
    There's no post on a page.
    If they want that, then they should share the link themselves.
    Perhaps it's best to study what facebook has to offer and how it works instead of guessing what it is supposed to do and be disappointed.

  • How can we enable tick icon when user click any button

    how can we enable tick icon when user click any button in captivate 6@

    hi first of all thanks for imitate action.
    actually i want to make a menu (TOC) with tick icons, on starting all ticks are disabled but when i click on any button from my menu i want to enable tick for that particular button so that user can know easily the visited button.

  • Issue of data getting wiped out when user clicks on back button..

    Hello Gurus,
    I have a selection program which displays ALV on execution. Now I have programmed the "Back" Button of standard toolbar so that when comeone clicks on it, it should leave to selection screen.
    WHEN 'TBACK'.
          LEAVE TO TRANSACTION SY-TCODE.
    But when I do that, the values entered by user during execution of selection screen wipes out and all the selection fields become empty. How can I make sure that when sure clicks on 'Back' button, the selectiuon screen is presented but with values in which user put during execution.
    Regards,
    Rajesh.

    Hi Rajesh ,
    Leave to transaction sy-tcode is as as good as call transaction...so basically using this statement will start the transaction afresh..and give a new selection screen....
    Better option would be to leave to screen 0 (preferaby used for a report )which will take you back to the previous screen processed or leave to screen XXXX for a particular screen( in case of a module pool )
    Hope it helps
    Regards
    Byju

  • Recently got a new computer and installed itunes from external drive - all music shows up in the library, however when i click on a song i receive this message "the song could not be used because the original file could not be found".  What do i do?

    I recently got a new computer and installed itunes from which had been saved onto an external drive - all music shows up in the library, however when I click on a song I receive this message "the song "abc" could not be used because the original file could not be found".  What can I do?

    I was given the option to locate the file where the song is held. If so select "locate" and direct it to the folder / file where the song is and open it. itunes then will give you the option to use this process to update all of your library. OK that as this will do it automatically instead of doing them one by one. I hope this helps.
    Martin

  • How to Stop the method Action When an Exception Occur in other Method

    Hi All ,
    public void action( Event clientEvent) {
    startAction();
    JOptionPane.showMessageDialog(null, getDocumnetId());
    how to Stop the method action ( "action" ) if an exception occur in the method ("startAction")
    ( if the exception occur we doesn't need to show the JOption Message )

    Hi,
    try FacesContext.getCurrentInstance().renderResponse();
    Frank

  • How to stop the video buffering when video is paused

    Hi
    I am developing the video player with custom video controls and I want to stop the video buffering when my video is paused. As sson as I play the video the buffering starts from the last bufferring point.
    can any one please help me for doing this i searched lot but not getting the solution please help me out to sort out this.
    Please refer the following link that I want to create the progress bar for my video player.
    http://tv.adobe.com/watch/training-with-trani/shake-detection/
    Thanks
    Sameer

    Hi
        Here is the code i would tried bothe bufferTime and maxBufferTime but not getting the required output.
        please check the code below.
        var _videoInfo = new Object();
        _videoInfo.onMetaData = onMetaDataHandler;
        ns = new NetStream(nc);
        //ns.maxPauseBufferTime = 0;
        ns.client = _videoInfo;
        ns.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);
        ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR,asyncErrorHandler);
        sndTransform = new SoundTransform(initVol);
        vid = new Video(stage.stageWidth,stage.stageHeight);
        vid.smoothing = true;
        videoCont.addChild(vid);
        vid.attachNetStream(ns);
        ns.play("video.flv");
        ns.soundTransform = sndTransform;
    Thanks

  • How to show an dropdown menu when user click on one point on lineseries?

    Hi all,
    I am new  in flex development.
    I am showing line series on the chart, I'd like to give some interaction, when user click on the "point" on the line, I'd like to show a dropdown menu, and react to user's choice on the menu item.
    Is it doable? Any sample or reference?
    Thanks in advance.
    /// Jack

    Cool, that definitely moving forward.
    I saw two questions here:
    1. I added mouseOver/mouseOut action to the LineSeries, it then react when I mouse over the line, instead of at the data point.
    2. How do I know the dataPoint's position and locate popmenu in that place? on other words, how do I have dropdown menu. I tried to use "this" as DisplayObjectContainer and send to Menu.createMenu, but seems not working.
    Here is the code pieces I am talking about:
    [Bindable]public var myMenu:Menu;
                // Create and display the Menu control.
                private function createAndShow():void {
                    Menu.
                    myMenu = Menu.createMenu(holder, myMenuData, true);
                    myMenu = Menu.createMenu(null, myMenuData, false);
                    myMenu.labelField="@label";
                    myMenu.show(10, 10);
                private function hideMenu():void {
                    myMenu.hide();
    <mx:series>
                        <mx:LineSeries mouseOver="createAndShow()" mouseOut="hideMenu()" sortOnXField="true"  xField="date1" yField="score1"  displayName="Score1">
    Thanks.

  • Glass Pane( preventUserInput when user clicks on Search button in af:query)

    Hi,
    We are using glass pane implementation on a search screen.
    When I click on Search button in af:query component (having selectInputDate (Date Picker) components)., glass pane is firing correctly,
    but second time when I am trying to select date using Date Picker (and Change the Month), glass pane is fired (entering into handleBusyState function) and calendar popup is not opening.
    I folled the below article for implementation.
    url: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/27-long-running-queries-169166.pdf used for glassPane implementation.
    Can any one help me for this issue.

    Hi am using the following code (javascript) -- Jdev(11.1.1.3)
    function preventUserInput(evt){   
    var eventSource = evt.getSource();
    var popup1 = eventSource.findComponent("showGlassPanePopup");
    if (popup1 != null){
    AdfPage.PAGE.addBusyStateListener(popup1,handleBusyState);
    evt.preventUserInput();
    //JavaScript call back handler
    function handleBusyState(evt){ 
    var popup = AdfPage.PAGE.findComponentByAbsoluteId('r3:0:r1:0:showGlassPanePopup');
    if(popup!=null){
    if (evt.isBusy()){
    popup.show();
    } else if (popup.isPopupVisible()) {
    popup.hide();
    AdfPage.PAGE.removeBusyStateListener(popup, handleBusyState);
    ... End of Code..
    This line .. (popup.isPopupVisible()) removes the Popup , if popup is visible...
    If u want the view am using..
    SELECT EMPNO , DEPTNO , HIREDATE FROM EMPLOYEE (sample Application i have created), created a view criteria for this..
    ( (EMPNO = :empNum ) AND (DEPTNO = :deptNum ) AND (TO_CHAR( TO_TIMESTAMP(HIREDATE), 'yyyy-mm-dd hh24:mi:ss.ff') = :hireDts ) ) (View Criteria)
    .. <af:clientListener method="enforcePreventUserInput" type="query"/> (added for af:query)
    Popup Used: <af:popup id="showGlassPanePopup" contentDelivery="immediate">
    <af:dialog id="d2" type="none" closeIconVisible="false">
    <af:panelGroupLayout id="panelGroupLayout1" layout="vertical">
    <af:outputText value="Processing......Please Wait.." id="ot97"/>
    </af:panelGroupLayout>
    </af:dialog>
    </af:popup>
    1. When i click search for first time.. it is showing like -- Processing .. Please Wait'
    2. When i click select Date picker it is show -- Processing .. Please Wait'
    and show a calender popup window.. If we change the month ... it will again show like -- Processing .. Please Wait'
    and it will not open calender window.
    Please Help me on this..Am facing trouble due to this.
    Thanks in Advance.
    Edited by: user10115793 on Nov 15, 2011 12:58 AM

  • How to popup file upload tag when we click on a button?

    Hi All,
    In BSP, How to popup the file upload tag when we click on a button?
    Let us Assume that when we click on open button as mentioned in the below 1st screen shot one popup should open like the below mentioned screen shot2 in the same page?
    Screen Shot1
    Screen shot 2
    Please help me on this.
    Thanks

    if you're using a document class ascircle, that should something like:
    package{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    public class ascircle extends MovieClip{
    public function ascircle(){
    init();
    private function init():void{
    stage.addEventListener(MouseEvent.CLICK,clickF);
    function clickF(e:MouseEvent):void{
    Circle.play();
    // if you're adding code to the main timeline, you would use:
    stage.addEventListener(MouseEvent.CLICK,clickF);
    function clickF(e:MouseEvent):void{
    Circle.play();

  • In ME22N change when I click on Print button system should generated messag

    Hi Gurus,
    Once I take the PO print next time when I go to ME22N when I click on print button system should generate the message with out clicking the repeat output.
    next time when I want take the print with out clicking the repeat output in ME22N when I click on print button system automatically generate the output message.
    For that what are the settings need to be setup.
    Thanks in advance
    sapmm

    Hi ,
    If you dont want message to be generated during PO change.Change the following setting.
    For eg. u have message type ZNEU.
    SPRO-MM-Purchasing-Mesages-Output control-message type -click Define Message Types for Purchase Order
    click on :Fine-Tuned Control: Purchase Order
    Delete the entry for operation 2 , for ZNEU.
    Thank you.
    Regards
    Amar

  • How to stop the "Read Reciept" when using messaging in the BI Process Chain

    Hey all - I set up a message in my process chain and now we get an email daily when that process finishes.  However it's asking for a read receipt from the users that it sends the message to.  I searched on this and also clicked on every button the message settings but could not find a way to turn off the read receipt request. 
    Does anyone know how to turn this off?

    HI,
    Go To
    1. SCOT   Tcode.
    2. Click on SETTINGS on the upper tab.
    3. Click on CONFIRMATION OF RECEIPT..
    4.and check the Radio button.. SAP  doesnot expectreceipt confirmation from internet..
    and click the tick button..
    Hope this helps u..
    Best Regards,
    VVenkat..

  • Getting FLV to stop playing when user clicks on nav button

    I have a portfolio_mc that is inside of a content_mc (stage->content_mc->portfolio_mc). There are 3 buttons that take the user to an appropriate frame designated by a frame label and this loads up an FLV. The problem is that when I click on any of the navigation buttons on the main timeline, the FLV that is currently playing, is still playing (I can hear the audio). So I need to figure out how to stop this.
    Here is the code used for controlling the buttons in the motion_mc timeline:
    stop();
    var naviArr:Array = new Array(btn01, btn02, btn03);
    btn01.addEventListener(MouseEvent.CLICK, navigate);
    btn02.addEventListener(MouseEvent.CLICK, navigate);
    btn03.addEventListener(MouseEvent.CLICK, navigate);
    btn01.buttonMode = true;
    btn02.buttonMode = true;
    btn03.buttonMode = true;
    function navigate(event:MouseEvent):void
    switch(event.target){
       case btn01:trace("video01");
       gotoAndPlay("video01");
       handleBtn(btn01);
       break;
       case btn02:trace("video02");
       gotoAndPlay("video02");
       handleBtn(btn02);
       break;
       case btn03:trace("video03");
       gotoAndPlay("video03");
       handleBtn(btn03);
       break;
    function handleBtn(btn:MovieClip):void
       for(var i:uint = 0; i<naviArr.length; i++){
          if(naviArr[i] == btn){
             naviArr[i].removeEventListener(MouseEvent.CLICK, navigate);
             naviArr[i].buttonMode = false;
          }else{
             naviArr[i].addEventListener(MouseEvent.CLICK, navigate);
             naviArr[i].buttonMode = true;     

    I really like your layout it is very cool looking.
    You have it all set up just right. KGlad is right you don't even need to embed the flvplayback controls in another movieclip. I think the reason I had them in movieclips was another designer had them all set up that way and at the time I didn't want to mess with them. =P
    At the beginning of your navigate function before you drop into the switch statement just put this in.....
    function navigate(event:MouseEvent):void
        if(movie != null) //anytime there is something called movie on in scope when we navigate tell it to stop.
            movie.stop();
    switch(event.target){
       case btn01:trace("video01");
       gotoAndPlay("video01");
       handleBtn(btn01);
       break;
       case btn02:trace("video02");
       gotoAndPlay("video02");
       handleBtn(btn02);
       break;
       case btn03:trace("video03");
       gotoAndPlay("video03");
       handleBtn(btn03);
       break;
    That should do it for you.

Maybe you are looking for

  • RGB 98 or grayscale? Which profil is the best for IBook

    I have a Black and white pictures iBook to produce and would like to know which profile to set up my picture in order to get better printing result? In RGB adobe 98 or grayscale?

  • Regarding BADI's in MIGO yransaction

    Hi Experts, I need to update the field value in the MIGO transaction while user clicks the save button. I found the badi's for the transaction. I need to know how to update the field value in the transaction screen dynamically....

  • Configure  MOPZ after EHP1 in solution Manager

    Dear Experts, We have fresh installed SAP Solution Manager 4.0 on windows 2003. Now we have to update EHP1 with SP26 i.e.SAP EHP 1 for SAP Solution Manager 7.0.Now I want to configure Maintenance Optimizer in this Solution manager.So that We can down

  • Straighten before red eye'ing

    Hi, Just noticed in my iPhoto 6.0.2 that if I straighten before removing red eyes that the position for red eyeing is not "transformed" so it misses the clicked eye... Regards Edward

  • IPhoto won't import Nikon D70 raw files after upgrade to Leopard

    I recently upgraded to Leopard, and yesterday, I hooked my Nikon D70 up to the computer. iPhoto auto starts, and tells me that there are pictures to import. When I click the import button, iPhoto tells me that it is importing the photos, (which are i