Writing a custom event for mouseenter in ActionScript 2.0

Hi All,
I am trying to implemetn one functionality based on the mouseenter
Unlike the mouseover() event, the mouseenter() event only  triggers when the the mouse pointer enters the selected element. The mouseover()  event is triggered if a mouse pointer enters any child elements as well.
In jquery latest they added support for mouseenter , i want to do the same in Flash AS2.0
There are only RollOver,RollOut, mousedown, so i want to add mouseEnter event Just like Jquery which is done below
Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function( event ) {
     // Check if mouse(over|out) are still within the same parent element
     var parent = event.relatedTarget;
     // Firefox sometimes assigns relatedTarget a XUL element
     // which we cannot access the parentNode property of
     try {
          // Traverse up the tree
          while ( parent && parent !== this ) {
               parent = parent.parentNode;
          if ( parent !== this ) {
               // set the correct event type
               event.type = event.data;
               // handle event if we actually just moused on to a non sub-element
               jQuery.event.handle.apply( this, arguments );
     // assuming we've left the element since we most likely mousedover a xul element
     } catch(e) { }
// In case of event delegation, we only need to rename the event.type,
// liveHandler will take care of the rest.
delegate = function( event ) {
     event.type = event.data;
     jQuery.event.handle.apply( this, arguments );
// Create mouseenter and mouseleave events
jQuery.each({
     mouseenter: "mouseover",
     mouseleave: "mouseout"
}, function( orig, fix ) {
     jQuery.event.special[ orig ] = {
          setup: function( data ) {
               jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
          teardown: function( data ) {
               jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
So please help me in implemeting the customevent mouseenter  I am using AS2.0
Regards
Ramakrishna
[email protected]

remove the stop() from frame 1.  and use tl.play() in the onRelease
and yes, you can use another loop (enterframe) to update the drag_mc position as the timeline plays.  that new code would look like:
var tl:MovieClip = this;
tl.onEnterFrame = playF;
paramF(tl,1,0,tl._totalframes,sb_mc._width-sb_mc.drag_mc._width);
paramF(sb_mc.drag_mc,0,1,sb_mc._width-sb_mc.drag_mc._width,tl._totalframes);
sb_mc.drag_mc.onPress = function(){
    this.startDrag(false,0,this._y,sb_mc._width-sb_mc.drag_mc._width,this._y);
    this.onEnterFrame = scrollTL;
    delete tl.onEnterFrame;
sb_mc.drag_mc.onRelease = sb_mc.drag_mc.onReleaseOutside = function(){
    this.stopDrag();
    delete this.onEnterFrame;
    tl.onEnterFrame = playF;
    tl.play();
function playF():Void{
    sb_mc.drag_mc._x = this._currentframe*this.m+this.b;
function scrollTL():Void{
    tl.gotoAndStop(Math.round(this._x*this.m+this.b));
function paramF(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):Void{
    mc.m = (y1-y2)/(x1-x2);
    mc.b = y1-mc.m*x1;
p.s.  please mark helpful/correct responses.

Similar Messages

  • Custom Event for Purchase Requisition Create, Change & Delete

    Hello Experts,
    I want to create a custom event which triggers on Purchase Requisition Create, SAP provide's standard event's for purchase requisition release but not for create.
    What are all the steps and how to create a new event.
    Thanks in Adavance,
    Sandhya.

    Hi Sandhya,
    may i know the reason why you are trying to create custom methods.
    You have business object BUS2009(for PR line item wise release) and BUS2105(for PR overall release).
    Both those business object have events RELEASESTEPCREATED (for PR creation) and SIGNIFICANTLYCHANGED(For PR change).
    Even then if you want to create custom events, create a subtype of the standard business object, then click on events, and then select create. Now create your Z-events, say ZCREATED (For creation), ZCHANGED (for changed) and ZDELETED (for deleted). Now select each event, click on edit -> Change release status -> object type component -> to be implemented. Follow the same for all the events. Then select each event, click on edit -> Change release status -> object type component -> to be released.
    Now click on your custom object, click on edit -> Change release status -> object type component -> to be implemented.Then click on your custom object, click on edit -> Change release status -> object type component -> to be released.
    After this in SWEC tcode, click on new entries. Select change document object as BANF, business object as say ZBUS2105 and event as ZCREATED. make sure radio button on create is checked.
    Similary create entries for ZCHANGED event and ZDELETED.
    Select on change and on delete radio button for event ZCHANGED and ZDELETED event respectively.
    let me know if you have any queries.
    Regards,
    Raj

  • Custom Event for buttom Item Click in Collections

    I get this good example of dynamic menu with button, but I
    need example of implementation of custom event when end-user click
    a particular button and use it event in Flex application.
    If my end-user clicks on a bottom-level menu item, how do i
    catch this so i can react? When a user chooses a bottom-level item,
    i’d like to change state and display information of xml
    source file tag, like trace(event.item).
    Thank in advance.

    worked for me once I fixed the handler
    protected function itemRendererButtonClickHandler(event:Event):void
         Alert.show("button is clicked and event is listened in main application ");

  • Query in writing  a Custom Event class

    Hi ,
    I am trying to work with the Events for pratic epurposes , when i am copying , pasting the code from web tutorilas they are working finr , but whne i tries myself they aren't working .
    Please help me
    This is my Custom Event .
    I want to pass the VO Object through Event . PLease see this below code and let me know as where i am doing wrong .
    package events
        import flash.events.Event;
        import vo.User;
        public class LoginEvent extends Event
            public static const LOGIN_EVENT:String = "LoginEvent";
            public var user : User;
             public function LoginEvent(type:String,user:User)
                 super(type,user);
                  this.user = user;
    PLease let me  know
    what are the parameters to be passed inside the Constructor of the Event class , and the Parameters inside the super()
    Waiting for your replies .

    Hi Kiran
                Try this
                                      package events
        import flash.events.Event;
        import vo.User;
        public class LoginEvent extends Event
            public static const LOGIN_EVENT:String= "loginEvent";
            public var userDtl:User;
            public function LoginEvent(type:String,userObj:User)
                //TODO: implement function
                super(type);
                this.userDtl = userObj;
            override public function clone():Event{
                return new LoginEvent(type,userDtl);
    Thanks
    Ram

  • Writing a custom renderer for the component  "af:processTrain" in 10g

    Hello,
    I have a requirement where we need to customize the way the af:processTrain is rendered. For this, the simpler and the more generic way would be to write a custom renderer for the af:processTrain component. Is there any documentation or examples that could help in accomplishing this as I could not get any relevant examples or documents.
    Thanks,
    Swapna

    Hi,
    Thanks for the quick response. Could you please suggest me a way to go about writing your own custom renderers?
    Thanks.

  • Creating a Custom event for my Component

    Hi All,
    im currently working in a swing component, and i would like to know how to give to my component the ability to react to some user changes.
    Basically im creating a DateTime Picker using NetBeans, im able to see any new property justed created on the Property Editor but i would like to know how to add my custom events on the Event Editor as well, i.e:
    monthChanged - (when the user just change the month dropdown)
    yearChanged - (when the user just change the year box)
    dayChanged - (when the user just change the selection day)
    Thanks in advance

    Thanks, i just found it also here:
    http://www.exampledepot.com/egs/java.util/CustEvent.html
    i need to define the following class:
    - Custom Listener extending the EventListener interface
    - Custom Event extending EventObject class
    and then finally add the corresponding:
    addXXXListener
    removeXXXListener
    fireXXXEvent
    in my component.
    This work Great in the NetBeans GUI Builder.
    Thanks,

  • Custome Event for the Result Set iView

    Hi,
    does anybody know how to set up the Custom Event on the Result Set iView in order to trigger an event when a record is selected?
    I know how to do it using an event Type = EPCF + Event Name + Namespace, but this creates an extra colum on the Result Set iView with the Custom Event name on it, that has to be click in order to trigger the event. I do not want click on this column, i just want to create the event when the record is selected.
    Regards
    Diego.

    Hi Diego,
    We are also implementing similar scenario.
    We also want to open a window on the clik of any column of the result and if the result is zero we want to trigger some another iView.
    So if u have found any solution can u just let me know.
    OR else can u  just elaborate on ur current scenario using EPCF and custom event.
    Thanks in Advance.
    Regards Shruti.

  • Custom eventing  for reporting --- am i using the correct ResourceEvent?

    Hi All,
    I am using a web content management tool which stores all the content created through the tool in /documents repository . This content is published in the portal under various roles  . I am working on a report to generate and report the hit counts for the pages in this repository . I have written a Km service that subscribes to GET_TEMPLATE event to generate these statistics.
    The problem i am facing is this . When i navigate through the KM folder structure to a given page in a subfolder and do a preview of the page content , the hitcount is incremented and the report reflects this increase . However if i navigate to the role where the content is published and view the content from the role , the page hit count is not incremented and the report does not show the increment .
    My questions are
    1) Do i need to write a custom KM event that notifies the repository broker about
        the page access through the roles?
    2) Is there any other standard event to which i can subscribe to get this page hit count.
    Any helpful answers will be rewarded.
    regards
    Subra

    Hi Subra,
    > is there any way to know if the tool is raising any event
    As I have been one of the developers, I can report that the tool definitely does not raise such an event explicitely. But as said above, it also shouldn't do this, as it shouldn't be needed. In addition, for the display the tool redirects to a KM navigation iView, which normally should lead to the expected event risen anyhow.
    But if it really doesn't work, you still have the option to ask btexx to check if this is a shortcoming on SAP side - which in the interest of a smooth working product should be tracked, maybe worked around...
    About the caching I can report that there is also no caching used at the moment for the display. This may change one day, for this in fact it would make sense to raise the event (even if the resource isn't called from the framework, but to enable such kind of statistics, if they won't be part of the product one day anyhow).
    Hope it helps
    Detlev
    Message was edited by:
            Detlev Beutner
    One additional remark for all people involved: I just remember to have read about the same "missing" event on SDN, but I never checked this in the end. It <i>might</i> be that the navigation iView only throws the getChildren event, as for other resources than XML forms elements, it only renders the name of the resource, not it's (or part of it's) content (so the content doesn't get accessed). This also would make sense as normally the access to the <i>Show</i> form could be differentiated from the access to the <i>RenderListItem</i> form.

  • Need help in writing code Customer Exit for reporting Variable

    Hello Gurus,
           I have a requirement.When a authorized user logins to view the report, he should see only customers available in the value help screen.In the value help screen it is displaying all the customers, but data is displayed perfectly fine for the authorized sales rep. By default, Value help screen displaying all the customer numbers.
    How can I restrict in the value help screen?
    Any help appreciated with points.
    Regards,
    PNK

    Hello PNK,
    You can use a variable with Process type Authorization. This enables variables to be filled with values automatically from the user authorization.
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/44/599b3c494d8e15e10000000a114084/content.htm
    Thanks
    Chandran

  • Writing a custom plugin for Crystal Report Designer

    Hi,
    I need to add a custom functionality to Crystal Report Designer so that itu2019s available as a menu option is the CRD and should able to be selected by the Report Designer when they design a report using CRD. Is it possible to write and add custom plugins to the CRD? Is there a SDK available to do this or is there a specific method that I could use? Is this supported at all? I need to add the to Crystal Report Designer XI R2 but I could use Crystal 2008 is this is available in that version.
    Thank you in advance,
    Regards,
    Chanaka

    Hi Jamie,
    This sure looks promising  information for me this is exactly what I want to do. Can you direct me to a working Crystal Report 2008 .net Developer Guide and API reference? The chm files I got from searching doesn't seems to work
    [http://www.sdn.sap.com/irj/boc/crystalreports-sdk]
    [http://www.sdn.sap.com/irj/boc/sdklibrary#section7]
    [http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm]
    [http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm]
    Thanks,
    Regards,
    Chanaka

  • Custom events for custom classes

    So what I'm trying to build is a custom class wich connects
    to a php socket server using an XML socket.
    I don't know how I can broadcast an event so I can write
    something like the code below. Anyone can help ?

    To be more specific my class looks something like this
    :

  • SlideShowpro, custom event, cursor doesn't change in hand

    I using the SSP component, and I scripted a custom event for clicking on loaded images to go to the next image.
    This is working very fine except for that the hand-cursor won't show up on roll-over on the image.
    I'd like this to happen, but dont't know how to.
    This is ths scrip I use now:
    listenerObject = new Object();
    listenerObject.onImageClick = function(eventObject):Void {
       my_ssp.nextImage();
    my_ssp.addEventListener("onImageClick", listenerObject);
    I tried to add this, but with no succes (mayby on the wrong place?)
    my_ssp.useHandCursor = true;

    You need to have the invisible button take over the role that your listener played, getting rid of the listener.
    invisibleBtn.onRelease = function(){
         my_ssp.nextImage();

  • Custom code for Target Source Reconciliation from a flat file

    Hi Experts,
    I need help in writing a custom code for Target Source Reconciliation from a flat file to OIM. The flat file will contain account details for different application instances. I am working on 11gr2.
    Thanks,
    Subin

    All right, all right, not so quickly.
    I am at the stage of trying to put one dimension
    array. But I stuck in one place, this is the program:
    import java.io.*;
    public class FromFile {
    public static void main(String[] args) throws IOException {
    File inputFile = new File("mac.txt");
    FileReader in = new FileReader(inputFile);
    int c;
    for(int i = 0; i < 10; i++) {
         c = in.read();
    System.out.println(c);
    and I try to read: 1 2 3 4 from text file
    This is the result so far...
    49
    32
    50
    32
    51
    32
    52
    -1
    -1
    -1
    well,
    I think I know what's wrong. I must change ASCII numbers into
    ints. But I dont' know how to do it. Some nice book, or
    tutorial on streams would come in handy. Could you correct
    it?.

  • Writing own event for Reservation creation BUS object

    I am trying to create a workflow that should get triggered when a new reservation is created for approval. I am using the BOR object for material reservation but it does not contain an event of creation. I wish to create a new event and then add code to the event so that a mail to an approver can be sent. Using the approval received I need to confirm the reservation else render it cancelled.
    I require help in creating the event and writing the event code for it.
    Thanks for taking time to go through my query
    Zankruti Parikh

    Hello Zankruti,
        Indeed, there's no such event for BUS2093. And if you try to do this to object BUS2093, you will come across error: "No change document object for business object type BUS2093".
        Given this, in your case, I am afraid that you will have to extend object BUS2093 by using delegation - then you will be able to add events CREATED or CHANGED, if necessary. Use transaction SWO1 to this, click on "settings" delegate, delegation type = ZBUS2093(for example) - you will delegate your ZBUS2093 type to BUS2093. After that, you will be able to create the events.                                                                               
    Following the idea, I believe that the easiest way to do this is thorugh enhancement MBCF0007 (Customer function exit: Updating a reservation). Click on components, and then you will see EXIT_SAPMM07R_001. Within this exit, you can call SWE_EVENT_CREATE_IN_UPD_TASK (you trigger the events you will have created above).  
    Regards,
    Andre Sousa
    Edited by: Andre Sousa on Jan 4, 2008 9:35 PM

  • How to create custom infotype for training and event management

    hai freinds can any one tell me how to create custom infotype for training and event managment with following fields
    PS No – PA0000-> PERNR
    Name   - PA0001 -> ENAME
    IS PS.No. – PA0001-> PS no. of Immediate Superior
    IS name PA0001 -> ENAME
    thanx in advance
    afzal

    Hi,
    Your question is not clear for me. Since it is a TEM infotype, it could be a PD infotype.
    If you wish to create a PD infotype, use transaction PPCI to create the infotype.
    But before that you need to create a structure HRInnnn (where nnnn is the infotype number) with all the fields relevant for the infotype.
    If you wish to create a PA infotype, use transaction PM01 to create the infotype.
    But before that you may be required to create a strcuture PSnnnn  (where nnnn is the infotype number) with all the fields relevant for the infotype.
    Regards,
    Srini

Maybe you are looking for