Event triggering from a class to parent

Hi,
             I am trying to write a custom class for image loading.
public function imageLoader(url:String, mc:MovieClip):void {
                              loader = new Loader();
                              loader.load(new URLRequest(url));
                              mc.addChild(loader);
                              loader.contentLoaderInfo.addEventListener(Event.INIT, initListener);
                              loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
                              loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadListener);
                    public function initListener(e:Event):void {
                    public function progressListener(e:ProgressEvent):void {
                    public function loadListener(e:Event):void {
I ll get the events in these listeners in the loadImage class. But i want to trigger a function in the calling class or root or stage, when these loader events are fired.
How this can be done?
Regards,
Sreelash

the ImageLoader class should extend EventDispatcher
you cna then redispatch the events wihtin the ImageLoader class
e.g.
public function initListener(e:Event):void {
     dispatchEvent(e);
then in the parent class you will have a reference to the ImageLoader class and you can add event listeners there
e.g.
var imageLoader:ImageLoader = new ImageLoader();
imageLoader.addEventListener(Event.INIT, somefunction);
imageLoader.load("image", this);
or something alone these lines depending on how you want to structure things

Similar Messages

  • Event triggering by abap class & ISR

    hi gurus
    1 ) can i able to see the event triggering by abap class in SWEL ?  ,
    2) in custom  ISR scenario , new form scenario has been created by our functional consultant , and asking me to trigger a workflow for approval ,  when employee fills that particular ISR FORM , workflow should start and to go his HR administrator , when HR administrator double click on workitem he should get the ISR form in display mode  & also with some descpition text  is to be added in the screen (like user decision description ) with approval button ..... my question is how to trigger a event from in form scenario ? , how to bring the FORM screen to display mode  to the HR administrator ?
    regards
    surya

    Hi Surya
    The BO for ISR forms is BUS7051 - Notification. Turn on the trace via SWELS and create a PCR/ISR form and you should see the events being triggered in SWEL.
    Good Luck
    Ravi

  • Event triggers from HANA to sharepoint

    Hi All,
    Is it possible to create a trigger in HANA that on creation of a new row in a particular table, creates an event that goes to a sharepoint portal  and triggers a mail and a push notification to MS BI mobile users?
    Please let me know how that would work.
    Thanks,
    Shyam

    Hi,
    I have the same req, we did like below the problem is resolved.
    1. Craete Event in SM62 in BW , Event name = ECCTOBW.
    2. Assign that Event in BW and give Parameter name = ECCTOBW_P. (Param is directly give in BW)
    (In Case of dataloads, create Process chain and give thios Event and Parameter in Start-->Event) and Activate and Exexute the Processc Chain.
    3. Then Run the below program in ECC then check your processc hain, it will trigger.
    This is the way how to use the Events triggers in different system.
    REPORT  ytestrd1tobd1.
    CALL FUNCTION 'RSSM_EVENT_RAISE'
      DESTINATION 'BWCLNT' ------------> Here give your BW system ID
      EXPORTING
        i_eventid              = 'ECCTOBW'
        i_eventparm            = 'ECCTOBW_P1'
      EXCEPTIONS
        bad_eventid            = 1
        eventid_does_not_exist = 2
        eventid_missing        = 3
        raise_failed           = 4
        OTHERS                 = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Thanks
    Reddy

  • No WF event triggered from PR coming from MRP

    Hi every one,  I have some Purchase Requisitions coming from MRP process, those PR doesnu2019t trigger any Workflow event to start a Workflow to approve them up  (client requirement). The regular PR (manually) does trigger the traditional event.
    My question is..what can I do to make the system generate the regular  PR event u201CBUS2105-RELEASESTEPCREATEDu201D as a triggering event for those purchase requisitions coming from the MRP?
    The SAP installation is:
    SAP ERP Central Component 5.0
    SAP_BASIS and SAP_ABA =  R:640  L:0017 SP: SAPKB64017
    Any recommendation?
    Edited by: Jaime Felipe on Feb 5, 2009 10:29 PM

    Hi Jaime,
    You need to do the configuration in SPRO.
    SPRO>>Material Management>>Purchasing>>Purchase Requisition>>Release Procedure>>Procedure with Classification.
    Under this section you will find
    1. Edit Characteristics
    2. Edit Classes
    3. Setup Procedure with classification
    4. Check Release Strategies
    You will find the documentation for each step, the documentation provided is very good and self explanatory. Do the config for each above mentioned steps in the given sequence and our event REELASESTEPCREATED gets triggered.
    Please revert back if you face any problem.
    Regards,
    Gautham Paspala

  • How a dailogbox can be triggered from BSP application

    Hi,
    1. My requirement is to show a dailogbox for confirmation, from the BSP application, whenever a user action is performed[clicked on a button].
    This dailodbox sholud be triggered from the BSP application[not form the client side(JavaScript) logic/code ].
    2. Is there any simpler way of showing a "success" message in a dailog box, from the BSP application
    Hints please.
    Thanks,
    Pramod.

    Hi Pramod,
    Try the following steps:
    1. In the OnInputProcessing event triggered from the button's OnClick event, after your server-side processing, set a page attribute appropriately
    (flag = 'success'.)
    2. Call a javascript function in the OnLoad event in your layout:
    <htmlb:page title = "Test" onLoad = "displayPopup()" >
    3. Include the javascript function:
    <SCRIPT language="JavaScript">
    function displayPopup()
    <%
    IF flag IS NOT INITIAL.
    %>
    alert("Success");
    <%
    ENDIF.
    flag = ''.
    %>
    </SCRIPT>
    Basically, when the page is loaded/refreshed after your OnClick event, based on the value of flag you set, you could display appropriate messages.
    Hope this solves your problem.
    Regards,
    Rohini.

  • Flash CS4 - how to create event flow from children to parents?

    In my opinion natural event flow direction is from children
    to its parants.
    E.g. when in dialog box buttons are pressed it is natural to
    inform only
    this dialog box about these actions. When dialog box can't
    handle particular
    event then passes it to its parent and so on .
    Unfortunately this direction is not well supported by Flash.
    To achieve
    support for this event direction it is necessary to call
    parent.dispatchEvent() with bubbling option off. This
    solution is
    inconvenient because sometimes I can't predict what event
    types will be
    triggered inside dialog components. Most likely there is no
    function to
    catch all events which have no defined handlers in dialog in
    order to be
    possible to pass them one level higher.
    Have you got any experience with building communication model
    between
    objects in Flash applications?
    Regards,
    Marek

    XML shema is basically an XML file. So u need to know how to create an XML,
    provided u know how the shema file should be.
    Creating an XML :
    http://forum.java.sun.com/thread.jspa?threadID=5181031&messageID=9705786#9705786

  • Calling Portal event from ABAP class

    Hi Experts,
    I need a following clarificatrion, Please help,
    1. Is it possible to call a webdynpro method from a normal ABAP class?
    2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    3. Is there any ways with which we can call portal event from ABAP class?
    Thanks,
    Shabir

    >1. Is it possible to call a webdynpro method from a normal ABAP class?
    I wouldn't necessarily recommend this approach. You shouldn't try to trigger events or any of the standard WDDO* methods from outside the WD Component itself.  That said, you can pass the object reference (like the WD_COMP_CONTROLLER object reference or the View Object Reference) into methods of normal classes.  Be careful if you are finding yourself calling a lot of your added methods from outside WD.  This is probably a sign that these methods should be in the Assistance Class or some other Class functioning as a Model Object.
    >2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    What exactly do you want to do here?  Do you just want to get the relaxation script?  For what purpose?  You should never need to inject the relaxation script into WDA. 
    >3. Is there any ways with which we can call portal event from ABAP class?
    To what purpose.  Do you just want to delegate the triggering of the event that is inside WD Component to be called from a class?  If so you can pass the portal API object reference into a class from the WD Component.  However this only works while running within WD.
    How is this class used?  Are you running in WD?  Are you trying to generate some HTML code that runs in the portal independent of WD?

  • Use method from father class for event

    Hi,
    I want to use a preDelete event in my class, but the method I would like to call for the event is not in the class itself, but in the (abstract) predecessor class. Any chance to do this? At the moment I can't select the method in the event tab page (it's not in the list to choose from ...)
    Thank you!
    J.F.

    In 9.0.4 you will need to add the parent class as a descriptor and choose to deactivate it. This will allow you to choose methods from that class in the subclass descriptors.
    In 10.1.3 there is a dialog for specifying classes that are not persistent, but necessary in other persistent classes: http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/mw007.htm#sthref629
    A good explanation of why we don't store the parent and referenced classes unless explictly asked can be found here: Re: Mapping Workbench  10.1.3.0 Bug - Cannot add Implemented Interfaces
    Hope this helps,
    Karen

  • Event triggering changes back to consumer class

    Hi all, newbie at Java and I hope you can give me a hand on this.
    Suppose I have 2 classes A and B. A has an instance of B, an event takes place in B and is caught by a listener in B.
    Can the listener call a method in A? I cant see how this can be done since B hasnt a handle to A.
    Many thanks...Peter

    It is cleaner to use an inner class if only the containing class will be using it. However, it's common to have listeners (especially those that are resued) as a separate class.
    You can either use reflection (see Class.getMethods()) or something like this:
    If all classes that can potentially have the method you're referring to implement an interface that declares the method, you can just blindly call the method. If it doesn't make sense for a given class to implement the behavior, you can leave the implementation blank.
    For example:
    public interface I {
        void doIt();
    // source of an event
    public class A implements I {
        public void doIt() {
            // do something special
            // code goes here
    // source of an event
    public class C implements I {
        public void doIt() {
            // do nothing
    // the listener
    public class B {
        public void actionPerformed( Event e ) {
            I source = (I) e.getSource();
            source.doIt();
    }In the above case, when the event originates from A, "code goes here" gets executed. When the event originates from C, doIt() still gets called, but the method doesn't do anything.
    From a responsibility point of view, deciding what to do lies with A and C, and when to do it with B.

  • How do you call a method from  another class without extending as a parent?

    How do you call a method from another class without extending it as a parent? Is this possible?

    Why don't you just create an instance of the class?
    Car c = new Car();
    c.drive("fast");The drive method is in the car class, but as long as the method is public, you can use it anywhere.
    Is that what you were asking or am I totally misunderstanding your question?
    Jen

  • Fire event from one class to another.

    I have a Login JFrame class that allows users to enter username and password. I then have another JFrame class which will monitor when someone logs in. I am trying to get the username and password to appear on the monitor login frame text area when the user presses enter on the login frame.
    I can get it ot work by passing the Monitor class into the Login classes constructor but I want to be able to open the classes separately.When I try to open separatley at present I get java.lang.NullPointerException
         at project.LoginGUI.actionPerformed(LoginGUI.java:70) which is referring to the following code:      
    if(listen.equals("OK")){
         GymMonitor.username.setText(username.getText());     
    Both classes are in the same package. What I want to know is how to fire an event from one class to another? when the class you are firing to is constructed separately.
    I hope this question is not too verbose.
    Thanks

    Generally for something like this you would use a listener.
    Your login window is its own entity--it has a user interface, and it gets some information which someone else could ask it for. It could even generate its own events, such as when the user presses "OK". You would first define an interface for anyone who wants to know when someone logs in:
    public interface ILoginListener extends java.util.EventListener
      public void login(LoginEvent event);
    }You would then define the LoginEvent class to contain information like what the user entered for username and password. You could give your login dialog a couple of methods:
      private Vector myListeners = new Vector();
      public void addLoginListener(ILoginListener listener) {
        myListeners.add(listener);
      public void removeLoginListener(ILoginListener listener) {
        myListeners.remove(listener);
      protected void fireLogin(LoginEvent event) {
        for (Iterator it = myListeners.iterator(); it.hasNext(); ) {
          ILoginListener listener = (ILoginListener)it.next();
          listener.login(event);
      }You'd have your login dialog call fireLogin every time the user logged in.
    Then, you could implement ILoginListener in your monitor window:
      public void login(LoginEvent event) {
        // now do something with the event you just got.
      }All the code I put in here is really generic stuff. You'll write this kind of stuff hundreds of times probably during your career. I haven't tested it though.
    Hope this helps. :)

  • I am running Mac OS 10.6.7 I cannot run a java based program from the net when parental controls are set the error is The error is Load: class installer.CheckVersion 13. class not found  Help!

    I am running Mac OS 10.6.7 I cannot run a java based program from the net when parental controls are set the error is The error is Load: class installer.CheckVersion 13. class not found 

    Then, talk to the person running the lab.

  • Class or method needed to capture the event triggered

    Hi All,
           Help needed in finding the event triggered in ALV container.
    As per my requirement , I am registering the event mc_evt_modify for getting the search help(MEKK) in a ALV container . However it is triggered when ever I am inserting a row in ALV container and also the method data_changed is also triggered with that. But I don't want the method data_changed to be triggered.
    Is there any method or class which captures the event triggered so that I can put a condition on mc_evt_modify event.
    Please help me to resolve this issue.
    Regards,
    Srinivas

    Hi,
    You can check event ONF4
    "1 . --------------------   first register it
      DATA: it_f4 TYPE lvc_t_f4,
            wa_f4 TYPE lvc_s_f4.
      wa_f4-fieldname = 'CONNID'.
      wa_f4-register = 'X'.
      wa_f4-CHNGEAFTER = 'X'.
      APPEND wa_f4 TO it_f4.
    CALL METHOD g_alv_grid_ref->register_f4_for_fields
        EXPORTING
          it_f4 = it_f4.
    "2. --------------------------- now handle it
    handle_on_f4 FOR EVENT onf4 OF cl_gui_alv_grid
                               IMPORTING e_fieldname e_fieldvalue er_event_data,
    METHOD handle_on_f4.
        DATA: repid LIKE sy-repid,
              dynnr LIKE sy-dynnr,
              field TYPE help_info-dynprofld.
        repid = sy-repid.
        dynnr = sy-dynnr.
        field = e_fieldname.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
          EXPORTING
            tabname           = 'SFLIGHT'
            fieldname         = 'CONNID'
            searchhelp        = "give search help here
            dynpprog          = repid
            dynpnr              = dynnr
            dynprofield       = field.  "return picked value to the one you are in
        "prevent furhter standard processing
        er_event_data->m_event_handled = 'X'.
      ENDMETHOD.                  
    Regards
    Marcin

  • Catching event from canvas class

    Hi,
    I want to catch an event from MyCanvas class/obect to MyMidlet class/object. I have implemented keypressed method in MyCanvas. can i use it pr do i have to do something else..
    Any ideas?
    Cheers
    Indy

    hi mlk!
    well, i want to catch Canvas.Fire event. sorry but i should have given you an idea of the code. well here it is:
    public class MyMIDlet extends MIDlet implements CommandListener {
    private Display display;
    private MyCanvas canvas;
    private Command exitCommand = new Command("Exit", Command.SCREEN, 1 );
    public MyMIDlet(){
    canvas = new MyCanvas(this);
    protected void startApp(){
    display.setCurrent(canvas);
    canvas.addComman(exitCommand);
    canvas.setCommandListener(this);
    public void commandAction( Command c, Displayable d ){      
         if( c == exitCommand ){
         exit();
    public class MyCanvas extends Canvas{
    protected void keyPressed(int keyCode) {
         if(keyCode < 0)
         int key = getGameAction(keyCode);
    if(key == Canvas.FIRE){
         System.out.println("FIRE");
    So, when Canvas.FIRE is 'pressed' i want MyMIDLET to know that it happend..
    thanks again
    indy

  • Need help with custom event from Main class to an unrelated class.

    Hey guys,
    I'm new to Flash and not great with OOP.  I've made it pretty far with google and lurking, but I've been pulling my hair out on this problem for a day and everything I try throws an error or simply doesn't hit the listener.
    I'm trying to get my Main class to send a custom event to an unrelated class called BigIcon.  The rest of the code works fine, it's just the addEventListener and dispatchEvent that isn't working.
    I've put in the relevant code in below.  Let me know if anything else is needed to troubleshoot.  Thank you!
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                placeIcons();
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 4; i++)
                    for (j = 0; j < 5; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i,j);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
            function twitchUp(e:Event)
                this.y +=  10;

    Ned Murphy wrote:
    You should be getting an error for the Main.as class due to missing a line to import the Event class...
    import flash.events.Event;
    My apologies, I should attempt to compile my example code before I ask for help...
    Alright, this compiles, gives me no errors, shows my 'book' and 'flowers' icons perfectly when ran, and prints 'addEventListener' to the output window as expected.  I get no errors when I press the button, 'dispatchEvent' is output (good), but the 'twitchUp' function is never called and 'EventTriggered' is never output. 
    How do I get the 'twitchUp' event to trigger?
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.*;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            var iconString_array:Array = new Array(2);
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                buildStringArray();
                placeIcons();
            function buildStringArray():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    iconString_array[i] = new Array(3);
                    for (j = 0; j < 3; j++)
                        if (Math.random() > .5)
                            //'flowers' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "flowers";
                        else
                            //'book' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "book";
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    for (j = 0; j < 3; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i*50,j*50);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
                trace("dispatchEvent");
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.*;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
                trace("addEventListener");
            function twitchUp(e:Event)
                this.y +=  10;
                trace("EventTriggered");
    Output:
    [SWF] Untitled-1.swf - 40457 bytes after decompression
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    dispatchEvent
    [UnloadSWF] Untitled-1.swf
    Test Movie terminated.

Maybe you are looking for

  • Flash Player 13.0.0.206 not working with Firefox 28 or IE, using Windows 7 64 bit

    Hi, I've been having problems with Flash Player all week, and I've tried everything I've found so far, including completely uninstalling and reinstalling Flash multiple times, reverting to previous versions of flash (Flash 11.7 or something similar)

  • Can't connect to Powerbook via wireless network......

    I have an iMac and a Powerbook and a wireless router. From the Powerbook, I can connect to the iMac's hard drive wirelessly by going to the network pane then clicking on Jason's iMac G5, entering the password, etc. But, I can't do the oppostite. I wo

  • Inbound IDOC for sales orders not posting the configuration data

    Hi all, I am facing a problem in posting the inbound IDOC (message type ORDERS). The configuration data maintained in the parent segment E1CUCFG and in the segment E1CUVAL is not getting posted though i am passing the data in these segments which is

  • Can't download music in anything but protected AAC audio file.

    When I download music it always comes as a protected AAC audio file. Previously I could download as AAC audio file and copy to a CD to play on Car Stereo. Can't seem to do that any more. All protected AAC audio files will only play on itunes and will

  • If condition exit program

    i want the user to input two dates, start and end date, in the format (MM/DD/YYYY) how can i add validation so that if end date < start date then exit program here's a sample set verify off accept start prompt 'Enter start time' accept end prompt 'En