2 actions in 1 button?

Hey im new at Edge Animation, but i made a button that triggers a menu to appears, but i have 2 questions:
1. How can I make my button make the menu appear after 1 click, but when the menu is shown, and you then click the button again, it will play reverse?
2. How do i make the symbol i am using as button so when i hover my mouse over it, the cursor changes as if i was a link?
Thanks!

Try something like this. Change the code to do what you need. But basically you set a variable on each event to return to the other value.
//set the value of a Symbol variable
sym.setVariable("onOff", true);
// click event
sym.$('btn').click(function(){
  // get the variable
  var onOff = sym.getVariable("onOff");
  if (onOff == true) {
    sym.$('Ellipse').css({'background-color':'green'});
  sym.$('btnLabel').html('Off');
  // reset the variable to false for next click
  sym.setVariable("onOff", false);
  else {
  sym.$('Ellipse').css({'background-color':'red'});
  sym.$('btnLabel').html('On');
  // reset the variable to false for next click
  sym.setVariable("onOff", true);
I think this is the sample (but I am not sure I made several)
buttons on-off.zip - Box

Similar Messages

  • Not able to call action of a button

    Hi All
    RIght now i am facing a very strange issue.
    In my applictaion if on my page i drop a buttion and add action for that button.
    If i add a SOP(System.out.println()) in that action i am able to see that in my back end means action is called. But on one specific page when i add a button and add action its not working.
    I am not able to see the SOP on a specific page means action is not called.
    Any idea why button on that specifci page is not called ?
    Thanks in advance,
    Vikas

    Which page?
    Which jdev version?
    Which UI technology you are using?
    What's the difference to the other pages?
    How do you get to the page in question?
    Timo

  • Add action to a button

    Hi everybody,
    i�m a beginner programming JAVA. So i think the question will be so easy.
    How can I add an action to a button created on a container???
    i.e. i want that when pressing the button, a word document can be opened.
    thank you very much in advance.

    hi,
    you need to add a listener to the button such as an actionlistener:
    JButton button1 = new JButton();
    button1.addActionListener(new buttonListener());
    //  This should be an inner class
    class buttonListener implements ActionListener() {
       public void actionPerformed(ActionEvent e) {
         System.out.println("Event generated!");
    }you an use an inner class to handle the event, pass the addActionlistener an object of the inner class, the inner class here should implement the actionlistener interface which has the actionPerformed method. You need a listener, best place to find one is the API.

  • HT1430 my very new iphone5s will not turn on its as if the button no longer works is there any additonal swiping actions or hidden buttons i may have triggered accidently it is barely 2 weeks old and has no obvious signs of wear............not impressed A

    my very new iphone5s will not turn on its as if the button no longer works is there any additonal swiping actions or hidden buttons i may have triggered accidently it is barely 2 weeks old and has no obvious signs of wear............not impressed APPLE

    im hoping that by holding both the power and circle buttons it will spring back to life ..........somtimes apple you are too clever with your secert hidden butttons switches

  • Creation of UI Element on the action of a button?

    Hi,
    Can we create some UI Element on the action of some button, i.e. writing code to create UI Element outside the wdDoModifyView() method of the view?
    Regards,
    Smriti.

    Hi,
    We can create an UI element dynamically, on button click action..Follow the steps given below:
    1. Create a static variable say ' myvar ' of type com.sap.tc.webdynpro.progmodel.api.IWDView in last declaration part(ie. inside //@@begin others //@@end.
    Eg: static IWDView myview;
    2. 2. In wdDoModifyView(), add the following
    myview=view;
    3. Now add the following code in the "OnAction<Submit>" event to create an UI element dynamically:
    IWDTransparentContainer rootContainer = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDLinkToAction Link1 = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, "Link1");
    rootContainer.addChild(Link1);
    Hope it helps!!!
    Regards,
    TFG - Kumara Guru

  • Can we perform two actions with one button with two clicks one after other?

    Sir,
    can we perform two actions with one button with two clicks one after other?
    I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
    Regards
    Tanvir

    In code it should be easy.
    The following code adds a button called butman with a text "ADD".
    It then registers a listener that will be called if the button is clicked.
    This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
    Therefore it will swap the button's functionality between ADD and CLEAR on every click.
    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});I hope this is what you wanted.
    Some extra food for thought.
    You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
    I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed.

  • Single form Multiple Actions based on button click

    Hi,
    I have to call two different actions based on button click from single <form > .
    How to achive this?.
    Thank you

    Hi,
    I am using struts <html:form> and my code is as follows
    <script language="javascript">
              function setAction(val){
         if(val==A){
                   window.open(document.forms[0].action="preview.do");
         }else if(val==B){
         document.forms[0].action="create.do";
              document.getElementById('fcreate').submit();
    </script>
    <html:form action="/create.do" >
    <html:text property="name">
    </html:form>
    action is mandatory for <html:form>
    Its not sending the form elements, when I click the preview button.
    Create button works fine. In struts-conig, I have taken same form name for create and preview actions
    Please give me some tips
    Thank you

  • Approve quotation on action of custom button

    Hello experts,
    For some requirement, standard approve/reject button is to be hidden and based on certain zfield status, and custom button action, quotation should be approved. I am able to add the button. The quotation is created in an external system and is transferred to SRM. In SRM system, the quotation is created using BBP_PD_QUOT_CREATE. The quotation is visible in approver's UWL. Now when approver opens the quotation, custom button should be displayed instead of standard buttons 'Approve' or 'Reject'. Upto this, it is done.
    On the action of the button, I am creating instance of class /SAPSRM/CL_PDO_BO_QTE_ADV in approval mode and using the method /sapsrm/if_pdo_bo_qte~approve or /sapsrm/if_pdo_bo_qte~action_approve etc.. none of them is working. For all the methods above, i am getting error - 'A PDO layer update method was called in display mode'.
    Could you please guide me how can I approve the document using custom button action?
    Regards,
    Yayati Ekbote

    Hello experts,
    For some requirement, standard approve/reject button is to be hidden and based on certain zfield status, and custom button action, quotation should be approved. I am able to add the button. The quotation is created in an external system and is transferred to SRM. In SRM system, the quotation is created using BBP_PD_QUOT_CREATE. The quotation is visible in approver's UWL. Now when approver opens the quotation, custom button should be displayed instead of standard buttons 'Approve' or 'Reject'. Upto this, it is done.
    On the action of the button, I am creating instance of class /SAPSRM/CL_PDO_BO_QTE_ADV in approval mode and using the method /sapsrm/if_pdo_bo_qte~approve or /sapsrm/if_pdo_bo_qte~action_approve etc.. none of them is working. For all the methods above, i am getting error - 'A PDO layer update method was called in display mode'.
    Could you please guide me how can I approve the document using custom button action?
    Regards,
    Yayati Ekbote

  • I have a course in Captivate 6, when I try to publish in captivate 8 the actions of the buttons disappear

    I have a course in Captivate 6, when I try to publish in captivate 8 the actions of the buttons disappear
    i feel very concerned, because the work it's hard

    I was able to resolve this without support.  I identified the slide where the course stopped playing and the ppt from which the slide background was located.  Even though the ppt deck in the Captivate library showed that the ppt was to date, I updated the ppt anyway and that resolved the issue.
    The course would stop playing at the same slide, and didn't allow me to advance to any slides beyond that slide using the TOC, I simply got a blank gray screen, refreshing the course in the browser caused the course to start over from the beginning and it would stop at the same slide.  Refreshing the ppt allows the course to play through and the TOC now allows navigation.

  • Adding actions to my buttons

    hi flash ppl!
    why am i getting a "current selection cannot have actions
    applied to it" msg in the actionscript window(f9), when i try to
    add an action to my button to point to a section of my text? pls
    pls help.
    Frustrated newbie

    are you sure its a button that you have created and not a
    graphic?

  • Opening ms outlook on action of a button

    Normally, we open outlook using 'linkToUrl' by setting its reference. But this appears as a link on the screen. According to my requirement, i need to open the outlook on action of a button. So, is there a way to invoke a 'linkToUrl' element on action of a button?
    Regards,
    Puneet D

    Normally, we open outlook using 'linkToUrl' by setting its reference. But this appears as a link on the screen. According to my requirement, i need to open the outlook on action of a button. So, is there a way to invoke a 'linkToUrl' element on action of a button?
    Regards,
    Puneet D

  • Upload 5 files on action of a Button

    HI Friends,
       Requirement:  I need to upload master for 5 tables using 5 upload UI elements, on action of a button i should upload legacy data to tables. I am capable of uploading one file but not 5.
                                   Can someone help me. it is high priority.
    Thanks in Advance,
    Sankar

    Hi Kissnas,
               I am able to upload one file on action of a button.  kindly can you edit my logic, i.e how to upload file 1  in table 1 and file2 to table 2.
      TYPES :
           BEGIN OF str_itab,
           name(10) TYPE c,
           age(10) TYPE c,
           gender(10) TYPE c,
           END OF str_itab.
           DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
             i_data TYPE STANDARD TABLE OF string,
             lo_nd_sflight TYPE REF TO if_wd_context_node,
             lo_el_sflight TYPE REF TO if_wd_context_element,
             l_string TYPE string,
             fs_table TYPE str_itab,
             upload   TYPE STANDARD TABLE OF ysg_upload,
             l_xstring TYPE xstring,
             fields TYPE string_table,
             lv_field TYPE string.
    *       DATA : t_table TYPE if_upload=>elements_data_tab,
    *              data_table TYPE if_upload=>elements_data_tab.
    * get single attribute
            wd_context->get_attribute(    EXPORTING      name =  `UPLOAD`
                                            IMPORTING      value = l_xstring ).
      CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
        EXPORTING
          in_xstring = l_xstring
        IMPORTING
          out_string = l_string.
            SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
    * bind with table element.
            LOOP AT i_data INTO l_string.
        SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
         READ TABLE fields INTO lv_field INDEX 1.
        fs_table-name = lv_field.
         READ TABLE fields INTO lv_field INDEX 2.
        fs_table-age = lv_field.
        READ TABLE fields INTO lv_field INDEX 3.
        fs_table-gender = lv_field.
         APPEND fs_table TO t_table1.
    *     APPEND fs_table TO upload.
         APPEND fs_table TO upload.
      ENDLOOP.
      lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
      lo_nd_sflight->bind_table( t_table1 ).
    Thanks in Advance
    Sankar

  • Attaching an action to a button in Javascript

    Hey guys,
    I'm playing around with attaching an action to a button in javascript but I'm just not getting it
    I've tried putting it into a function like so
    function deleteSwatches () {
        = app.doScript("Delete Unused Swatches", "Custom Art Actions");
    Then calling the action with said function but it doesnt respond.
    Any ideas?

    Try this:
    !!! CS6 required
    var w = new Window('dialog', '');
    btnProd = w.add('button',undefined,'Delete unused swatches');
    btnProd.onClick = function() {
        //alert ("Delete, if your action with the defined name is available !AND! CS6 required")
        deleteSwatches ()
    w.show();
    function deleteSwatches () {
        app.doScript("Delete Unused Swatches", "Custom Art Actions");
    Otherwise looking for a John Wundes script, which do the same.
    Have fun

  • Applying Standard Advanced Action to a Button Type

    Hi. Does anyone happen to know if it's possible to apply a Standard Advanced Action to a Button Type that will be used on multiple slides. My project has Home, Back and Next Buttons that I've used on most slides. I've created a Standard Advanced Action for these buttons, but haven't figured out how to apply the advanced action without going through each slide and selecting it from the very long list of Advanced Actions I have for the project. If anyone knows of an easier way to do this it would be very helpful for me. Thanks.
    Kim

    Kim,
    Which version do you use? In Captivate 6 this is possible if you use Shape buttons: you can put them on the Main master slide (or on individual master slides), or time for the rest of the project. Blogged about them:
    http://lilybiri.posterous.com/why-i-like-shape-buttons-captivate-6
    If you are on a previous version, I'm sorry but a normal button cannot be displayed for the rest of the project, nor put on a master slide. However there is a static button widget that has not as many functionalities, navigation however is possible, advanced actions not. Maybe that widget can help you, it is static which means that you can display it for the rest of the project (be sure to check the option 'Always on top') or even use it on a master slide.
    Depending on the exact content of your standard actions, maybe the action can be used without editing on each slide. Then it is just copy+paste work with regular buttons.
    Lilybiri

  • Does a Database Action on a button override the DML Values?

    Greetings,
    I would like to know if a Database Action on a button (SQL Insert/SQL Update/SQL Delete) overrides the DML Valid Insert/Update/Delete Request Values? My button request is 'GENERATE', and obviously, it is not in the valid update request values. It does carry a SQL UPDATE Action, though the update doesn't seem to happen as the form is reloaded without any changes.
    Best regards,
    Mathieu

    Greetings,
    I definitely didn't look carefully enough. The update was happening all along, I just had forgotten to reset a flag on my page, which so happened to screw over with the session state. Thus, no matter the request of a button, if you specify a Database Action on it, it will override the DML Valid Request Values rule. That's good to know.
    Best regards,
    Mathieu

  • How to trap action of Back Button in IE Toolbar

    Hi
    Plz tell me a way How to trap action of Back Button in IE Toolbar

    hi i found something but it can get real messy.
    By the way, I think it can be hooked, but not trap, as in like cancel it if we like
    Manu G, Colin Fraser, Daniel Amsler - i think it's from these guys, i dunno if its ok to paste the link here so ill just paste the exact text
    =======================================================
    Sure, why not!
    Use the onunload event of the body tag.
    Something like this:
    <body OnUnload="alert('Woo hoo..');">
    This will be called everytime the backbutton is pressed.. woo hoo.. :)
    but one care needs to be taken.
    This will also be called when any link or button on the screen are
    clicked. So be sure to apply some kinda check on the buttons/ links.
    Something like:
    <body onload="flag=true" onUnload="if (flag) alert ('Woo hooo..');">
    <input type=button onclick="flag=false">
    This validation will make sure that on the button click, that logic in
    the onunload thing is not called...
    All the best & keep rockin'
    ~MeTaL~

Maybe you are looking for