Steps to remove an event handler pre-treat in OIM 11 g 2

Guys,

I've set up an event handler to pre-process successfully in OIM11gR2.

For some reason, I would like to disable/remove it.

I have a BSW get called the plugin, but still this event handler.


Please let me know how to remove it permanently.

Run weblogicDeletemetadata.sh, unsubscribe the plugin and then run purgecache.

Tags: Fusion Middleware

Similar Questions

  • Trigger event handler problem

    Hello
    I am facing a problem in the event handler, I'm pre process handler.bellow event is the steps that I followed and did all the steps correctly, but the event handler is not triggered.

    the steps that I follow is
    (1) develop a java class in which I will put middle name if the user does not have a middle name in the form of IOM in the CREATE operation.

    import java.io.Serializable;
    import java.util.HashMap;

    import com.thortech.util.logging.Logger;
    Import oracle.iam.platform.context.ContextAware;
    Import oracle.iam.platform.kernel.spi.PreProcessHandler;
    Import oracle.iam.platform.kernel.vo.AbstractGenericOrchestration;
    Import oracle.iam.platform.kernel.vo.BulkEventResult;
    Import oracle.iam.platform.kernel.vo.BulkOrchestration;
    Import oracle.iam.platform.kernel.vo.EventResult;
    Import oracle.iam.platform.kernel.vo.Orchestration;

    * / public class NamePreProcessEventHandlers implements PreProcessHandler {*}

    private logger = Logger.getLogger Logger ("logger name Handel");

    private String methodName ="";
    public NamePreProcessEventHandlers()
    *{*
    debug ("invoking NamePreProcessEventHandlers");
    *}*
    *@Override*
    public cancel Boolean (long arg0, arg1 is long,
    * AbstractGenericOrchestration arg2) {*}
    * / / TODO self-generated stub method *.
    Returns false;
    *}*

    *@Override*
    public void offset (long arg0, arg1 is long,
    * AbstractGenericOrchestration arg2) {*}
    * / / TODO self-generated stub method *.

    *}*

    * / / Write your implementation.*
    * Public EventResult run (long processId, long eventId, orchestration of the Orchestration) {*}
    * / / TODO self-generated stub method *.


    this.methodName = "execute";
    * / / This method get the parameters of the request of IOM form *.
    HashMap parameters = orchestration.getParameters ();

    debug ("settings" + settings);
    String operation = orchestration.getOperation ();
    debug ("operation process pre" + operation);

    If (operation! = null & & operation.equalsIgnoreCase ("create"))
    *{*
    String firstName = getParamaterValue (settings, "First name")
    If (firstName! = null & &! firstName.trim () .isEmpty ())
    *{*
    If (! parameters.containsKey ("Middle Name"))
    *{*
    orchestration.addParameter ("Name", firstName.substring (0,1));
    *}*
    *}*

    *}*
    return new EventResult();
    *}*

    *@Override*
    * Public BulkEventResult run (long arg0, long arg1, arg2 BulkOrchestration) {*}
    * / / TODO self-generated stub method *.
    Returns a null value.
    *}*

    *@Override*
    * public Sub initialize (HashMap arg0) {*}
    * / / TODO self-generated stub method *.

    *}*

    */***
    The value of request parameters obtaining *.
    **/*
    private String getParamaterValue (parameters HashMap,
    * String key) {*}
    String value = (parameters.get (key) instanceof ContextAware)
    *? (String) ((ContextAware) parameters.get (key)) .getObjectValue () *.
    *: (String) parameters.get (key); *
    Returns the value;
    *}*

    private void debug (String message)
    *{*
    Logger.Debug (this.) GetClass(). "GetName() +": "+ methodName +": "+ message);
    *}*
    *}*

    (2) create a jar named NamePreProcessEventHandlers.jar file and paste it into the LIB directory.

    (3) develpo a config to custom handler file as follows

    * < eventhandlers xmlns = "http://www.oracle.com/schema/oim/platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" > *.
    "< * class =" test.eventhandlers.NamePreProcessEventHandlers action-Manager' entity-type = 'User' operation = "CREATE" name = "NamePreProcessEventHandlers" Stadium = "preprocess" order = "FIRST" sync = "TRUE" / >. *
    * < / eventhandlers > *.

    (4) create a plugin.xml file

    * < eventhandlers xmlns = "http://www.oracle.com/schema/oim/platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" > *.
    "< * class =" test.eventhandlers.NamePreProcessEventHandlers action-Manager' entity-type = 'User' operation = "CREATE" name = "NamePreProcessEventHandlers" Stadium = "preprocess" order = "FIRST" sync = "TRUE" / >. *
    * < / eventhandlers > *.
    (5) make an Eventhandler of the zip file in which I placed the plugin.xml and lNamePreProcessEventHandlers.jar
    (6) save the plugin file to the server of the IOM
    (7) import of the event custom in the MDS.
    (8) clear the cache and restart the server of the IOM.

    (9) then create user page in free service, but the event handler is not triggered.

    Please help as I am with IOM 11gr2.was I miss some steps or above process is sufficient.

    Thank you and regars
    $

    All looks good, but your plugin.xml is not correct.

    Go to the format below and try again.






  • Measures to develop the event handler in 11 GR 2 IOM user name generation

    Friends,

    Can you please provide me steps to develop the event handler in GR 11, 2 IOM user name generation?

    Thank you
    Chakri

    The detailed procedure received in my blog for this. Take a look.

    http://Srini-bellamkonda.blogspot.com/2012/11/develope-pre-event-handler-to-generate.html

  • IOM 11.1.1.5.0 - process pre event handler

    Hi everyone, I am trying to set up an event handler to preprocess to automate email and user connection when I click on "create a user".

    I mean when I want to create a new user, I want to just fill the first name, last name, organization and type and this preprocess will automatically fill the emails and the login of the user fields. I don't know if it is possible or not with an event handler?

    Thank you

    Thibault

    Hope that you have followed the appropriate steps for recording plugin and mds import but check below

    Check the PLUGINS:

    Open ant.properties.
    Edit the file:

    # WLS installation directory
    WLS. Home=/Home/ofmuser/Oracle/middleware/wlserver_10.3

    # The directory of IOM. If shiphome its same as installation directory
    IOM. Home =/Server

    build the zip file as I said above

    Copy your zip in /server/plugins

    Goto /Server/plugin_utility
    Ant f pluginregistration.xml registry

    xelsysadm

    T3: / /: 8003 (Managed server IP and port)
    /Home/test/Oracle/middleware/Oracle_IDM1/server/plugins/EventHandler.zip (this just an example move the zip with the absolute path)

    For importing MDS check below

    Open weblogic.properties

    Change it:
    wls_servername = oim_server1 *(managed server name) *.

    application_name = OIMMetadata

    metadata_from_loc = / tmp * (put the location of eventhandler.xml before /db/eventhandler.xml)*
    All the rest leave it as what.

    Goto /server/bin
    ./weblogicImportMetadata.sh

    WebLogic

    T3: / /: 7001 *(weblogic host and port) *.

    For eventhandler.xml check with below



    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance".
    xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" >
    <>
    Class = "com.test.EventHandlers.TestPreProcessEventHandler"
    entity-type = 'User '.
    operation = "CRΘER."
    name = "TestProcessEventHandler".
    Stadium = "pretreatment".
    order = "1010".
    Sync = "TRUE" / >

  • Help with the event handler.

    Hello
    We had two adapters entity IOM 10 g that fires when the user group memberships are changed. He was attached to the User Groups.User Members post insert and delete data object after.
    To have the same functionality in OIM 11 g, we try to create the event handler.

    I have doubts in this regard.
    1. how the event handler will fire in 11 g on change of group.
    2. we have event handlers that are registered using Ant plugin to check utility. Now, if I want to join this newly created event handler, do I need to implement the new code already a create a new pot and re-save the plugin or can we have several plugin.zip file.

    Thank you

    concerning
    Stone

    steps below:

    prepare the pot for the class as in 10g-> put the server (anywhere) IOM-> goto /Server/bin/now run below
    UploadJars.sh

    Select as a scheduled task
    provide the absolute path with name of the jar.
    If credentials requested provide IOM credential (xelsysadm)

    Once the pot is downloaded to remove the file system. subsequently if necessary change to use UpdateJars.sh instead of UploadJars.sh
    Once you do this PurgeCache.sh performance as well

    --

  • interrupt an event of any other event handler

    Is it possible to have an event that interrupts another handful rutin event? I mean, I have an event handle the structure with several events (case). One of this event takes place, and the structure begins to run in rutin. Meanwhile, rutin is running, another event takes place. Is it possible to stop rutin from first event to run the other?

    Thank you!

    No. not really.

    Structures of the event has no any code embedded in them that can take a long time to run and block the other events.  If you do not have one such routine, you must move to the other while loop using an architecture of producer/consumer with queues.  The structure of the event would just load a command into a queue that the other dequeue while loop and start working on.  The structure of the event loop will become quickly available to treat other events.

    If the second event is one that is designed to interrupt the first routine, then you just need to have the right communication architecture to send to the other loop.  This could be another queue order, perhaps a declarant or accident.  A local variable or functional global variable.

    Remember that you can not stop any structure in the middle of its processes.   A time of loop can be stopped, but all the code in the while loop should run before this iteration of the loop stops.

  • PowerEdge R720 remove individual event

    Hi everyone, our monitoring system (pulls that openmanage info) has a critical event on it, that I know is very well, she is treated.

    Now, I know I could erase the whole journal using the iDrac omconfig or, but I would rather just delete this unique event, leaving the other intact events on the box. He'll go to a syslog server in the future but for now it is not configured to do this, then I will lose not rather past events.

    Someone know a way to remove a single event or have I not option here but to clear entire log?

    Thank you.

    KB73,

    Currently, there is not a way to remove an event individually in the journal of materials. This is due to the information in question lies in the ESM chip, thus actively recovered by OMSA. So that being said, even if you change the OMSA file created with the ESM inside newspaper, basically when you restart OMSA he would rewrite all changes you made in the file and display the error again. The only option you have is to make a backup of the newspaper for "SEO" as you said, but then just erasing the log after you saved.

    Let me know if that answers your question.

  • OIM 11 g: Event Handler in bulk parameters ArrayIndexOutOfBoundsException?

    I have a very basic pre-treat installation to TOGGLE event manager operations.

    The problem that I am running is only for operations in block, the length of the "global settings" table is less than the length of the array 'ID of the entity', which causes an ArrayIndexOutOfBounds exception when I try to access the table ' in bulk settings.

    public BulkEventResult execute(long processID, long eventID, BulkOrchestration orchestration) {
    
        String[] entityIds = orchestration.getTarget().getAllEntityId();
        HashMap<String, Serializable>[] bulkParams = orchestration.getBulkParameters();
    
        log.warn("entityIds length = " + entityIds.length);       // 5   
        log.warn("bulkParams length = " + bulkParams.length);     // 4 <-- why is this less than entityIds??
    
        for(int i = 0; i < entityIds.length; i++) {
            String entityId = entityIds[i];
            HashMap<String, Serializable> params = bulkParams[i]; // <-- this throws ArrayIndexOutOfBoundsException when i = 4
    
            // remainder omitted for brevity
        }
    }
    
    

    I must be missing something really basic here or do something stupid or a combination of both, but my assumption would be that these berries would always have the same length. Are there cases where they would not have the same length?

    Experts of ideas?

    For anyone else who runs into this, it turns out that to TURN operations, the number of cards of parameters in bulk might not match the number of targets in the orchestration in bulk. If you take a look at Action of managers to TURN Oracle, they work specifically around this in the code:

    // Excerpt from oracle.iam.identity.usermgmt.impl.handlers.enable.EnableUserActionHandler.execute(long, long, BulkOrchestration)
    // ...
    HashMap[] bulkParams = orchestration.getBulkParameters();
    HashMap[] newBulkParams = new HashMap[entityIds.length];
    for (int i = 0; i < entityIds.length; i++) { // iterating target entityId's length, not bulk params array
         HashMap params = null;
         if (i < bulkParams.length) {
              params = bulkParams[i]; // If orchestration contains bulk params for target "i", it uses it
         }
         if (params == null) {
              params = new HashMap(); // If bulkParams isn't long enough, it just adds an empty HashMap
         }
         params.put(UserManagerConstants.AttributeName.STATUS.getId(), UserManagerConstants.AttributeValues.USER_STATUS_ACTIVE.getId());
         newBulkParams[i] = params;
    }
    orchestration.setBulkParameters(newBulkParams); // This "fixes" the bulk params array to ensure the length matches the entityIds length
    // ...
    
  • Configuration in the event handler scripts

    Hi guys,.

    This is my first question here.

    Please forgive me if I have some grammar errors.

    I'm building a plugin for Photoshop CC which includes several scripts jsx and a Panel of the HTML of the CEP.

    In my plugin I would activate a script jsx on all the actions that the user is within the app.

    I managed to achieve using the Script event handler and parameters of my script to run the event "Everything" (see image below).

    My question is if anyone knows how I can configure my jsx script in the handler automatically during the installation of my plugin.

    I'm not talking about copy the script in the destination folder (settings presets/scripts /).

    The flow I'm looking for is as follows:

    1. The user install my plugin from https://creative.adobe.com/addons
    2. Activate user the plugin by going to Windows-> Extensions-> MyPluginName
    3. When loading my CEP Panel, he calls a script jsx (which is included in the plugin).
    4. The jsx (from the 3rd stage) script sets another jsx script (which is also included in the plugin) to operate on all the actions that the user makes the Photoshop app.

    I need an automatic solution to the fourth step. Anyone...?

    Capture.JPG

    P.s

    I am familiar with the events Manager.xml Script file, but the addition of my script to the list is a partial solution.

    I am looking for a fully automatic solution in the background.

    app.notifiersEnabled = true;
    app.notifiers.add( "All ",new File('path/to/your.jsx') );
    
  • Event handler registration in IOM weblogic cluster envirnoment

    Hi Experts,

    We have OIM11gr2 cluster environment using the logical web cluster solution.

    We recorded with success the event handler and the node to the database file (as described in the document).

    Ask advise should I have to repeat the steps of node 2, given that we are facing the question that is to say for a user event handler does not work and it is not able to generate the user login.

    I guess, then the IOM works from node 2 handler not able to invoke.

    Request your help to identify the root cause associated with registering event handler or a bug of the IOM

    Kind regards

    David

    Hello

    The front brace for the event handler does not work for reliable recon from 11 g

    You must use better UserLogin generation Plugins.

    Booking of username and generation of common name - 11g Release 2 (11.1.2.2.0)

    ~ J

  • Trouble finding a place for my event handler

    I'm a newbie on my first work programme. I'm trying to teach myself JavaFX by creating a program simple Tic-Tac-Toe. I created an AnchorPane to hold the TIC-TAC-TOE grid which consists of 4 Cree-crossing lines that have been created in the JavaFX scene generator. There are 2 horizontal and 2 vertical lines. In the Java program, I loaded my FXML file and my TIC-TAC-TOE grid looks great. I created 9 ImageView that match 9 of TIC-TAC-TOE squares. I load those with x.jpg or o.jpg images. Those that work very well and I can see them on my network manually.

    I can't find out how to make them appear if I click in one of the squares. I created a rectangle and is the same color as the grid and without border and place in the center square. I put a fx:id = "MMR" (medium-medium rectangle) and an onMouseClicked = "#handleRMM" in the FXML file.

    I created an event handler, and I know it's because I put System.out.println ("Clicked!"); and I can see it on the NetBeans console. But the rest of the event to display the X does not appear.

    I can't get to work in the main part public class handler extends Application of the program. But the AnchorPane, my ImageViews and everything is defined in part public void start (primaryStage stage) of the program. For this purpose, I can not access the ImageViews to the event handler. I will list my code, and I hope someone can tell me what I'm doing wrong. Thanks in advance.

    David
    package tictactoe;
     
     
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javafx.application.Application;
    import javafx.fxml.FXML;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.*;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.layout.AnchorPane;
    import javafx.stage.Stage;
     
    /**
     *
     * @author David
     */
    public class Main extends Application {
     
        
        /**
         * @param args the command line arguments
         */
        public void main(String[] args) {
            Application.launch(Main.class, (java.lang.String[])null);
        }
     
        @Override
        public void start(Stage primaryStage) {
            
            
            try {
                            
               
                AnchorPane page = (AnchorPane) FXMLLoader.load(Main.class.getResource("TicTacToe.fxml"));
                Scene scene = new Scene(page);
                
                primaryStage.setScene(scene);
                scene.getStylesheets().add("tictactoe/tictactoe.css");
                primaryStage.setTitle("TicTacToe");
                ImageView mm =new ImageView();//Middle Middle
                final ImageView lt =new ImageView();//Left Top
                final ImageView lm =new ImageView();//Left Middle
                final ImageView lb =new ImageView();//Left Bottom
                final ImageView tm =new ImageView();//Top Middle
                final ImageView bm =new ImageView();//Bottom Middle
                final ImageView rt =new ImageView();//Right Top
                final ImageView rm =new ImageView();//Right Middle
                ImageView rb =new ImageView();//Right Bottom
                //mm.setImage(new Image("tictactoe/images/x.jpg"));
               
                //page.getChildren().add(mm);
                
                mm.relocate(246,145); mm.setFitWidth(100); mm.setFitHeight(100);
                lt.relocate(107,35);
                lm.relocate(107,145);
                lb.relocate(107,260);
                tm.relocate(246,35);
                bm.relocate(246,260);
                rt.relocate(375,35);
                rm.relocate(375,145);
                rb.relocate(375,260);
                
                page.getChildren().add(mm);
                //page.getChildren().remove(mm);
                page.getChildren().add(lt);
                page.getChildren().add(lm);
                page.getChildren().add(lb);
                page.getChildren().add(tm);
                page.getChildren().add(bm);
                page.getChildren().add(rt);
                page.getChildren().add(rm);
                page.getChildren().add(rb);
            
                primaryStage.show();  
                
            
            }
               
                                 
         
            
            catch (Exception ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                        }
                
        
        }
    
         
        public void handleRMM() {
            
           ImageView mm =new ImageView();
            mm.relocate(246,145); mm.setFitWidth(100); mm.setFitHeight(100);
            mm.setImage(new Image("tictactoe/images/x.jpg"));
            
            System.out.println("Clicked!");
        }
        
    }
    and my FXML file:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.image.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.shape.*?>
    <?scenebuilder-stylesheet tictactoe.css?>
    
    <AnchorPane id="AnchorPane" fx:id="anchor" prefHeight="400.0" prefWidth="600.0" style="" xmlns:fx="http://javafx.com/fxml" fx:controller="tictactoe.Main">
      <children>
        <Line endX="100.0" endY="1.0" layoutX="15.0" layoutY="125.0" startX="450.0" startY="1.0" />
        <Line endX="100.0" endY="0.0" layoutX="15.0" layoutY="250.0" startX="450.0" startY="0.0" />
        <Line endX="-100.0" endY="-125.0" layoutX="301.0" layoutY="158.0" startX="-102.0" startY="180.0" />
        <Line endX="-100.0" endY="-125.0" layoutX="465.0" layoutY="163.0" startX="-100.0" startY="180.0" />
        <Rectangle id="rlt" fx:id="rmm" arcHeight="5.0" arcWidth="5.0" fill="WHITE" height="122.50001525878906" layoutX="202.0" layoutY="127.0" onMouseClicked="#handleRMM" stroke="WHITE" strokeType="INSIDE" width="163.4998779296875" />
      </children>
    </AnchorPane>

    Just my $0.02 worth.

    Any interactive game is a starting point quite complex. The logic of a game is quite complex (even if it's a really simple game). TIC-TAC-TOE, you'll not only to deal with the mouse click but you need a way to tell if it's a valid move (i.e. If the place is not already busy). Is not difficult in itself, but you need to know where to keep the underlying data to this logic, and really data (State of play) must be independent of the display of the game: in short, at a certain level, you will need to understand the model-view-controller architecture.

    Now you are at the stage where you're still trying to understand the syntax of the language, and you have little chance to learn than just trying codes and post on the forums. Of course, you can look at other resources too and there are more resources for learning Java I can possibly list, but perhaps Oracle's Java tutorial [url http://docs.oracle.com/javase/tutorial/java/index.html] would be a good starting point. Understand the first three chapters or so meets immediate syntax issues you encounter.

    If you have other references, Kathy Sierra "head first Java" and "Thinking in Java" Bruce Eckel are the ones who always get good customers.

  • IOM event handler FILED and imported, but not working

    Hello
    I use the OIM 11 g in 32-bit windows envoirnment.
    I recorded a pre event handle precess and also he imported IOM but it does not work. pls find below details.

    DB entry of Table MDS_PATHS
    1 LastNameEventHandlers.xml 197 196 /tiks/LastNameEventHandlers.xml 5 143 http://www.oracle.com/schema/oim/platform/kernel 1 1 eventhandlers DOCUMENT UTF-8 3558973303 0 0

    Entered plugins table DB
    2 com.holcim.hssa.eventhandler.LastNmPreProcessEventHandlers oracle.iam.platform.kernel.spi.EventHandler 1.0 LastNamePreProcessEventHandlers 1


    need tio know where the eventhandlers goes D:\ORCL_HOME\Oracle_IDM1\server\features this path or another.



    but it does not work

    I have the impression may be that you have imported the metadata into a path not recognized (/ tiks). According to the documentation, you must use a path to what IOM knows (i.e. under the /db. /file or /custome).

    Also, I guess (even if you haven't posted it) your plugin and event Manager XML files have the required prefix

    As has been pointed out, if you need to work in recon trust, that you may also need to change to a post process manager.

  • How can I resize window "script event handler?

    How can I resize window "script event handler? (I entered in a script long as event handler script. After adding the script, I can't view or scroll key buttons on the right) .attached is a screenshot of the problem I am facing.a.jpg

    Quit photoshop and go to

    For Photoshop CS6

    Photoshop CS6 Photoshop C:\Users\Your Name\AppData\Roaming\Adobe\Adobe CS6\Adobe settings

    For Photoshop CC

    C:\Users\Your Name\AppData\Roaming\Adobe\Adobe Photoshop CS6\Adobe Photoshop CC settings

    remove the

    Script Manager.xml events

    then restart photoshop


    I think that the events are for something like select menu or tool (filter), and then this, for example.

    For your script, probably add using skip under Script would be preferable.



  • How to create the event handler in OIM11g

    Hi all

    How can I create an event handler in OIM11g

    Thank you in advance.

    There are three components necessary to generate this
    1 plugin.xml
    2 EventHandler class
    3 eventhandler.xml to import in the scheme of SDM that define the OPERATION, CONTROL, etc.

    You can zip the first two and enroll using register utility in server/bin and then import a 3rd in MDS using WeblogicImportMetaData.sh

    to follow the details link below
    http://docs.Oracle.com/CD/E14571_01/doc.1111/e14309/oper.htm

    Step by step of development explanation, deployment

    http://idmoim.blogspot.in/2011/07/developing-and-deploying-OIM-11g-custom_29.html

    -nayan

    Published by: Zaba Nayan on 8 February 2012 08:54

  • Correct way to use an event handler

    What follows is dynamically adds a series of buttons and a label to each button. The problem is that the event handler is triggered two times for each button, and the last button never gets Treaty at all.

    Should I use a different ResizeEvent.RESIZE event handler? How can I add the label to the last button in the sequence?

    Thank you.

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"creationComplete =" init () "> "
    < mx:Script >
    <! [CDATA]
    Import mx.events.ResizeEvent;
    private var button: Button2;
    public var numButtons:Number = 5;
    private var counter: Number = 0;
    public void init (): void {}
    for (var i: int = 0; i < numButtons; i ++) {}
    button = new Button2;
    hbox.addChild (button)
    button.addEventListener (ResizeEvent.RESIZE, handleButtonAdded)
    }
    }
    private void handleButtonAdded(e:ResizeEvent):void {}
    counter ++
    trace (e.Target)
    e.Target.label = String (counter);
    button.removeEventListener (ResizeEvent.RESIZE, handleButtonAdded)
    }

    []] >
    < / mx:Script >
    < mx:HBox id = "hbox" horizontalGap = "0" / >
    < / mx:Application >

    This is the button: Button2.mxml

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Button ' http://www.Adobe.com/2006/MXML "creationComplete ="init ()">
    < mx:Script >
    <! [CDATA]
    public void init (): void {}
    This.Width = 100;
    }
    []] >
    < / mx:Script >
    < / mx:Button >

    Hmm, what you trying to do?  There are a few questionable things happening.  Your event handler is called "handleButtonAdded", but it takes a ResizeEvent? Do you mean to trigger an event in function when the button has been added to the scene, or a parent like FlexEvent.ADDED or when the creation is complete, FlexEvent.CREATION_COMPLETE?

    The second thing is your variable 'button '.  It is declared outside the loop in function 'init '.  Which means that, when this loop ends and even during execution, it will point to the last created button.  So all buttons have listeners, which means when a button trigger a ResizeEvent, it will remove the listener for all pointing to your variable 'button '.  Is guaranteed (well, maybe not) the behavior that your last button is NOT a listener, that's why he won't shoot.

    In addition, you can set the size of the button and the label when you declare them. You have to subclass and use headphones.

Maybe you are looking for