How do I disable an event handler?

The file below contains a canvas and a button on the canvas. There are two event handlers, one for the button and one for the canvas. How to I disable the event handler for the canvas when the button is clicked?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            public function init():void{
                canvas.addEventListener(MouseEvent.CLICK, handleClick)               
                button.addEventListener(MouseEvent.CLICK, handleButtonClick)
            public function handleClick(e:Event):void{
                trace("Application clicked")
            public function handleButtonClick(e:Event):void{
                trace("Button clicked")
        ]]>
    </mx:Script>
    <mx:Canvas  id="canvas" x="108" y="82" width="200" height="200"  backgroundColor="0xff0000">
        <mx:Button  id="button" x="10" y="168" label="Button" mouseChildren="false"/>
    </mx:Canvas>
</mx:Application>

u can do this when user clicks on any of the canvas or button, just check it currentTarget and then work with ur functions accordingly

Similar Messages

  • How do I create an Event Handler for an Execute SQL Task in SSIS if its result set is empty

    So the precedence on my entire package executing is based on my first SELECT of my Table and an updatable column. If that SELECT results in an empty result set, how do I create an Event Handler to handle an empty result set?
    A Newbie to SSIS.
    I appreciate your review and am hopeful for a reply.
    PSULionRP

    Depends upon what you want to do in the eventhandler. this is what you can do
    Store the result set from the Select to a user variable.
    Pass this user variable to a Script task.
    In the Script task do whatever you want to do including failing the package this can be done by failing the script task, which in turns fails the package. something like
    Dts.TaskResult = Dts.Results.Failure
    Abhinav http://bishtabhinav.wordpress.com/

  • Can  DISABLE preProcess Event Handler add to the Orchestration parameters?

    I have a DISABLE pre-process event handler defined on the User object. I need to set the current date on a USR UDF attribute whenever the user is disabled or enabled or created. The CREATE handler works and the date value shows up on the user profile. However, when I try to set this attribute on the pre-process DISABLE or ENABLE event handlers, the new date does not show up. Here is the code I am using in my DISABLE/ENABLE event handler:
    Date currentTime = new Date(System.currentTimeMillis());
    orchestration.addParameter(USER_STATUS_DATETIME_ATTR_NAME, currentTime);
    Where the orchestration object is from the execute() parameter list.
    Any ideas as to why this is not working? Is adding to the orchestration not allowed for DISABLE or ENABLE event handlers? I know my handler is getting calls as I am logging the orchestration.getOperation() value.
    Thanks for any suggestions.
    -Dave
    Edited by: user552098 on Nov 12, 2012 1:56 PM

    When you update the field, make sure you are using the field label name, and not the UDF value.
    -Kevin

  • How can I disable the "Events" how can I disable "Faces"

    buona sera
    how can I disable the "Events"
    how can I disable "Faces"
    grazie

    You can not
    Events are one of many views or your photos in your library - as are faces
    YOu can simply ignore both but you can disable them
    LN

  • How can I add new event handler in BC4J event flow in UIX?

    How can I declarativly add extension to existing event handleres in BC4J+UIX page?
    I generate through wizards UIX+BC4J pages and I want extend some actions in eventhandlers section. Can I do it in some way like <event name=".." method=".." class=".."> like in any regular event handlers?

    you can use the <method ..> event handler inside the BC4J event handlers, like:
    <bc4j:findRootAppModule name="EmpAppModule" >
    <bc4j:findViewObject name="CurrentDeptEmpsVO" >
    <method class="myPackage.myClass" method="doOperation"/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>

  • How can I disable the event sound played when a new window is opened?

    When Firefox starts, or when a new window is opened there is an annoying click.
    How can I disable this?
    The only way I have been able to stop it is by disabling all event sounds from the control panel but I'd rather just disable this particular sound.

    No, it's Windows XP. Hmmm, I don't know! I only started noticing it recently and as far as I remember, the only new add on is NoScript. I found the event that was being triggered (Start Connection) and disabled the sound in Windows. So the problem is solved in that I don't have the annoying sound ... but don't know why it started and hope nothing sinister is going on.

  • How can I trigger an event handler, based on a history dropdown select (onclick)

    Hi
    Firefox remembers user names and email addresses previously entered in text input fields. I wish to trigger an event-handler when an item has been selected.
    Best regards, Jens Larsen

    I figured out part of this. I had the event listener
    listening to the spry select id, I set an id on the select and the
    input lines and it's working correctly. Now I just have to push the
    changes to the database.

  • STRUTS and UIX: How to use getCustomMethod in event handler

    I am having app module method exposed to a client as my custom method that does something. Then I have a data page (UIX) with a submit button that triggers event handler:
    public void onMyEvent(DataActionContext ctx) {
        HttpServletRequest request = ctx.getHttpServletRequest();
        HttpSession session = request.getSession();
        JUCtrlActionBinding method = ctx.getCustomMethod();
        if (method == null) System.out.println("method is null!!!!!!!!!!!");for some reason my method handle is null WHY???
    this seems to work when I call my method from findForward() though.

    If you use ADF BC, you can override the method create(AttributeList) in the Entity Object implementation class (EmployeesImpl.java).
    Use: Menu --> Tools --> Override Methods --> create
    In the overridden create method you can assign the next value from a DB sequence (e.g. EMP_SEQ) to the ID attribute:
    protected void create(AttributeList nameValuePair) {
    // Super
    super.create(nameValuePair);
    // Id
    SequenceImpl s = new SequenceImpl("EMP_SEQ", getDBTransaction());
    setEmployeeId(s.getSequenceNumber());
    }

  • How to use multiple Screen Event Handling on JavaFX

    Hi,
    Its appreciate , if any one assist me on Event Handling on JavaFX with multiple scene with single stage.
    Thanks
    Biswajit

    I think is this usefull for you. . .
    http://forums.sun.com/thread.jspa?threadID=5359128&tstart=30
    Regards,
    Rams.

  • How to write an JavaScript Event Handler for Portal Form?

    I have created an form in Portal builder.
    There are two column, R04 and R05.
    I need to use Javascript Event Handler to check if R04 value is smaller than R05 value.
    Can I be able to build up this function?
    Can anyone give me a hint? or steps?
    Thanks

    Here are some suggestions.
    1. do what we did, and write your own protocol server that understands whatever custom commands you need, and then write a custom thin client which will send commands to and receive responses from this protocol server. you can use any language for the client software. the protocol server should be written in java so that it can receive commands from the client and then use the 9iFS API to execute the requests or retrieve the data that the client wants to display.
    2. write a custom fat client, in java, that accesses the 9iFS API directly. this means that each client will be accessing the iFS schema on the database machine directly. if you configure the iFS service on the client to use the THIN driver, then you won't need to install the Oracle client software on the client machine. You'll just need all the iFS .jar files and the database's JDBC driver (classes12.zip). Note that using the THIN driver is not supported because of bugs and performance problems. If you use the OCI8 driver, which is supported, then you'll have to install the whole Oracle client software package on the client machine.
    3. write a thin client that uses the WebDAV protocol, and communicate with our built-in DAV server. this approach will allow you to execute any command that DAV understands. you may be able to find some free HTTP or DAV client software on the net, or you can try writing it yourself. this is probably a better solution than number 1 unless you really need to send custom commands that are not in our DAV server's vocabulary.

  • How to create Event Handler in OIM11g

    Hi all,
    How can I create an event handler in OIM11g
    Thank You in advance.

    there are three component required to generate this
    1. plugin.xml
    2. EventHandler class
    3. eventhandler.xml to import into MDS schema which define OPERATION,ORDER..etc
    you have to zip the first two and register using register utility in <IDM_HOME>server/bin and then import 3rd one into MDS using WeblogicImportMetaData.sh
    for details follow below link
    http://docs.oracle.com/cd/E14571_01/doc.1111/e14309/oper.htm
    Step by step explanation from development to deployement
    http://idmoim.blogspot.in/2011/07/developing-and-deploying-oim-11g-custom_29.html
    --nayan
    Edited by: Nishith Nayan on Feb 8, 2012 8:54 AM

  • How to create event handler in project online

     how to create a remote event handler for project online...
    i want to create a event handler onprojectcreating using CSOM...need Help..

    Hi Abidulla,
    Here is a good post from UMT for you to start.
    http://www.umtsoftware.com/blog/2013/08/01/project-server-2013-remote-event-handlers/
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Event handler as a method. How ?? ( WD for ABAP)

    Hi All,
            Can you tell me how i can use an event handler as a method. I mean i use the wizard and get the parameter list to be passed .. but then I dont know what to pass as WDEVENT. I am trying to call this within another method.
    Regards,
    Anoop
    Message was edited by: Anoop Singh Saini

    Hello Anoop,
    did you have a look at the event and event handler documentation?
    http://help.sap.com/saphelp_nw2004s/helpdata/en/eb/ed6f4169e25858e10000000a1550b0/frameset.htm
    Regards, Heidi

  • How to set event handler in af:inputText  adf faces component.

    Hi,
    I am using ADF Faces components for my application.
    I want to capture the onchange event of a text box on the server side.For this what should I do. How do I register an event handler for this.
    In the documentation of the CoreTags of the ADF for onFocus it is stated as below.Will this help me in any manner ?
    onfocus String the event handler for when the element receives focus.
    Please help me.
    Regards
    Uma

    Uma,
    - set autosubmit to true
    - set a value change listener in the managed bean
    Frank

  • Event handler if new File added in current folder

    Hi folks,
    I'm just trying to write a little jsx script for Bridge CS6.
    How can I implement an event handler that will react if the user adds a new thumbnail (new file) to the current folder in bridge.
    I've tested it with this code, but it doesn't work:
    app.document.thumbnail.watch ("children", function(id, oldVal, newVal) {
         $.writeln (oldVal + " to " + newVal);
         // some code here
    Thanks. Greetings

    Beautiful. Works as advertised. Thank you for pointing it out to me. Unfortunate that a basic subset of this extension's behaviour doesn't ship with Thunderbird out of the box, though.

Maybe you are looking for

  • JMS Adapter Message Selector Problem...

    Hi I have set the following in the invoke before producing the message and dropping on the queue <invoke name="Invoke_1" partnerLink="adapt" portType="ns1:Produce_Message_ptt" operation="Produce_Message" inputVariable="Invoke_1_Produce_Message_InputV

  • Text diff. in Windows OS and MAC OS

    I am faceing a Problem like I created one Application form in Swing. There i getting form DataBase and placed it there. while taking printout also it working fine. But if I am running this same programme in Mac OS. The four side of the Char. are cut

  • What font is used for the menu of Illustrator CS5?

    What font is used for the menu of Illustrator CS5? I know how to change the default font, which is used to input characters. But, I do not know how to check the font used in the menu. Is it the font that is described in the following files? C:\Users\

  • Questions about iPhoto

    using Mavericks 10.9.4 and iPhoto 9.5.1 on Mac Mini. 2012. The events are often shuffled around. Why?  Can I prevent that?   Is it possible to combine a few of the events into a "super event?"

  • How to get ipod out of recovery mode

    I have an ipod 1st generation (I think).  It wouldn't access itunes because it needed an update.  I installed itunes on my laptop and tried to run the update.  It freaked the ipod out so that it is stuck in recovery mode, and itunes is not able to re