Custom Cursors with rollovers.

So I know how to make a custom Cursor in flash Pro CS5 but if I want that custom cursor to change to something else of my own design when it's over specific objects how would I go about doing that?

So here's the code for both both buttons and their rollover actions.  Like I said it works fine for one but not the other.  The forward button is fine, but when the back button is clicked it leaves behind a stamp of the rollover cursor.
/* Mouse Over Event
Mousing over the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
   The code will execute when the symbol instance is moused over.
backbtn.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_2);
function fl_MouseOverHandler_2(event:MouseEvent):void
parent.addChild(backphoto);
backphoto.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor_2);
function fl_CustomMouseCursor_2(event:Event)
          backphoto.x = stage.mouseX;
          backphoto.y = stage.mouseY;
Mouse.hide();
/* Mouse Out Event
Mousing out of the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
   The code will execute when the symbol instance is moused out of.
backbtn.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_2);
function fl_MouseOutHandler_2(event:MouseEvent):void
parent.removeChild(backphoto);
Mouse.show();
/* Mouse Over Event
Mousing over the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
   The code will execute when the symbol instance is moused over.
Forwardbtn.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler);
function fl_MouseOverHandler(event:MouseEvent):void
{stage.addChild(nextphoto);
nextphoto.mouseEnabled = false;
nextphoto.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
function fl_CustomMouseCursor(event:Event)
          nextphoto.x = stage.mouseX;
          nextphoto.y = stage.mouseY;
Mouse.hide();
/* Mouse Out Event
Mousing out of the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
   The code will execute when the symbol instance is moused out of.
Forwardbtn.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler);
function fl_MouseOutHandler(event:MouseEvent):void
stage.removeChild(nextphoto);
Mouse.show();

Similar Messages

  • Can you use a custom cursor with drag and drop?

    Hi there! I'm a newbie flash user and working on a simulation for a graduate course in instructional design. I'm using Flash Professional CC on Mac. Here's what I'm trying to do. I have several draggable sprites on the stage and three target sprites. I have specified the original x,y locations of the sprites and have set the end x,y locations as those of each of the three targets. Items must be dragged to one of the three targets.
    Some questions:
    1. Can I specify more than one End x,y location for a draggable sprite? I'm creating a lesson to teach kindergartners how to sort lunchroom waste. If they have a napkin, for example, it could either go into the compost OR into the recycling. In cases like this where an item could really be placed into more than one bin, I want them to get it right if they do either of those things, rather than forcing them to choose which one.
    2. To make my project more "fun" for kids, I wanted to customize the cursor with a graphic of  hand. When I tried this in the flash file it works perfectly until I add the drag and drop functionality for the wasted items. Then the cursor will more around  but not pick up any items. Once I revert back to the standard pointer, the correct drag and drop functionality is restored.
    3. I have it set to snap back to the original location if learner attempts to drop the item on the wrong target. I want to be able to play a sound file when that happens, as well as play a sound file when it lands on the correct target, as well as shrink the item and change its opacity so that it appears invisible. I want to give the illusion of it being placed into the bin. I have no idea as to the proper way to code these events so that they happen.
    4. I've watched dozens of hours of youtube tutorials before coming here. I'm a quick study, but am very new to action script. In one of the videos the developer showed referencing an external action script file which I don't think is an option in CC. The coding method he used seemed much more streamlined and "clean" than the chunks I'm working with now. Is there an easy way for me to code information about these objects  than the way I've got it here now? I hate starting new things with bad habits. The perils of self-teaching.
    Thanks!
    I'm pasting my code from the actions panel below so you can see what's going on:
    stop();
    /* Custom Mouse Cursor
    Replaces the default mouse cursor with the specified symbol instance.
    stage.addChild(customcursor);
    customcursor.mouseEnabled = false;
    customcursor.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
    function fl_CustomMouseCursor(event:Event)
      customcursor.x = stage.mouseX;
      customcursor.y = stage.mouseY;
    Mouse.hide();
    //To restore the default mouse pointer, uncomment the following lines:
    customcursor.removeEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
    stage.removeChild(customcursor);
    Mouse.show();
    //set up variables and objects for dragging
    var offset:int = 10;
    var appleStartX:int = 243;
    var appleStartY:int = 156;
    var appleEndX:int = 522;
    var appleEndY:int = 22;
    apple.buttonMode = true;
    apple.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    apple.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var cupStartX:int = 39;
    var cupStartY:int = 266;
    var cupEndX:int = 520;
    var cupEndY:int = 175;
    cup.buttonMode = true;
    cup.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    cup.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var barStartX:int = 178;
    var barStartY:int = 234;
    var barEndX:int = 522;
    var barEndY:int = 22;
    bar.buttonMode = true;
    bar.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    bar.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var orangeStartX:int = 284;
    var orangeStartY:int = 102;
    var orangeEndX:int = 522;
    var orangeEndY:int = 22;
    orange.buttonMode = true;
    orange.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    orange.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var bottleStartX:int = 172;
    var bottleStartY:int = 303;
    var bottleEndX:int = 520;
    var bottleEndY:int = 175;
    bottle.buttonMode = true;
    bottle.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    bottle.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var bananaStartX:int = 113;
    var bananaStartY:int = 123;
    var bananaEndX:int = 522;
    var bananaEndY:int = 22;
    banana.buttonMode = true;
    banana.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    banana.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var napkinStartX:int = 248;
    var napkinStartY:int = 271;
    var napkinEndX:int = 520;
    var napkinEndY:int = 175;
    napkin.buttonMode = true;
    napkin.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    napkin.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var yogurtStartX:int = 27;
    var yogurtStartY:int = 136;
    var yogurtEndX:int = 518;
    var yogurtEndY:int = 329;
    yogurt.buttonMode = true;
    yogurt.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    yogurt.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var strawberryStartX:int = 120;
    var strawberryStartY:int = 285;
    var strawberryEndX:int = 522;
    var strawberryEndY:int = 22;
    strawberry.buttonMode = true;
    strawberry.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    strawberry.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var sandwichStartX:int = 7;
    var sandwichStartY:int = 364;
    var sandwichEndX:int = 522;
    var sandwichEndY:int = 22;
    sandwich.buttonMode = true;
    sandwich.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    sandwich.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var juiceStartX:int = 88;
    var juiceStartY:int = 347;
    var juiceEndX:int = 518;
    var juiceEndY:int = 329;
    juice.buttonMode = true;
    juice.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    juice.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var foilStartX:int = 39;
    var foilStartY:int = 416;
    var foilEndX:int = 520;
    var foilEndY:int = 175;
    foil.buttonMode = true;
    foil.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    foil.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    var waxbagStartX:int = 235;
    var waxbagStartY:int = 342;
    var waxbagEndX:int = 522;
    var waxbagEndY:int = 22;
    waxbag.buttonMode = true;
    waxbag.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
    waxbag.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
    function startDragging (e:MouseEvent) {
      e.currentTarget.startDrag();
    function stopDragging (e:MouseEvent) {
      e.currentTarget.stopDrag();
      switch (e.currentTarget) {
      case apple:
      if (apple.x < appleEndX - offset || apple.x > appleEndX + offset || apple.y < appleEndY - offset || apple.y > appleEndY + offset) {
      apple.x = appleStartX;
      apple.y = appleStartY;
      else {
      apple.x = appleEndX;
      apple.y = appleEndY;
      //checkGame();
      break;
      case sandwich:
    if (sandwich.x < sandwichEndX - offset || sandwich.x > sandwichEndX + offset || sandwich.y < sandwichEndY - offset || sandwich.y > sandwichEndY + offset) {
      sandwich.x = sandwichStartX;
      sandwich.y = sandwichStartY;
      else {
      sandwich.x = sandwichEndX;
      sandwich.y = sandwichEndY;
      //checkGame();
      break;
      case orange:
    if (orange.x < orangeEndX - offset || orange.x > orangeEndX + offset || orange.y < orangeEndY - offset || orange.y > orangeEndY + offset) {
      orange.x = orangeStartX;
      orange.y = orangeStartY;
      else {
      orange.x = orangeEndX;
      orange.y = orangeEndY;
      //checkGame();
      break;
      case strawberry:
    if (strawberry.x < strawberryEndX - offset || strawberry.x > strawberryEndX + offset || strawberry.y < strawberryEndY - offset || strawberry.y > strawberryEndY + offset) {
      strawberry.x = strawberryStartX;
      strawberry.y = strawberryStartY;
      else {
      strawberry.x = strawberryEndX;
      strawberry.y = strawberryEndY;
      //checkGame();
      break;
      case napkin:
    if (napkin.x < napkinEndX - offset || napkin.x > napkinEndX + offset || napkin.y < napkinEndY - offset || napkin.y > napkinEndY + offset) {
      napkin.x = napkinStartX;
      napkin.y = napkinStartY;
      else {
      napkin.x = napkinEndX;
      napkin.y = napkinEndY;
      //checkGame();
      break;
      case bar:
    if (bar.x < barEndX - offset || bar.x > barEndX + offset || bar.y < barEndY - offset || bar.y > barEndY + offset) {
      bar.x = barStartX;
      bar.y = barStartY;
      else {
      bar.x = barEndX;
      bar.y = barEndY;
      //checkGame();
      break;
      case juice:
    if (juice.x < juiceEndX - offset || juice.x > juiceEndX + offset || juice.y < juiceEndY - offset || juice.y > juiceEndY + offset) {
      juice.x = juiceStartX;
      juice.y = juiceStartY;
      else {
      juice.x = juiceEndX;
      juice.y = juiceEndY;
      //checkGame();
      break;
      case foil:
    if (foil.x < foilEndX - offset || foil.x > foilEndX + offset || foil.y < foilEndY - offset || foil.y > foilEndY + offset) {
      foil.x = foilStartX;
      foil.y = foilStartY;
      else {
      foil.x = foilEndX;
      foil.y = foilEndY;
      //checkGame();
      break;
      case banana:
    if (banana.x < bananaEndX - offset || banana.x > bananaEndX + offset || banana.y < bananaEndY - offset || banana.y > bananaEndY + offset) {
      banana.x = bananaStartX;
      banana.y = bananaStartY;
      else {
      banana.x = bananaEndX;
      banana.y = bananaEndY;
      //checkGame();
      break;
      case bottle:
    if (bottle.x < bottleEndX - offset || bottle.x > bottleEndX + offset || bottle.y < bottleEndY - offset || bottle.y > bottleEndY + offset) {
      bottle.x = bottleStartX;
      bottle.y = bottleStartY;
      else {
      bottle.x = bottleEndX;
      bottle.y = bottleEndY;
      //checkGame();
      break;
      case waxbag:
    if (waxbag.x < waxbagEndX - offset || waxbag.x > waxbagEndX + offset || waxbag.y < waxbagEndY - offset || waxbag.y > waxbagEndY + offset) {
      waxbag.x = waxbagStartX;
      waxbag.y = waxbagStartY;
      else {
      waxbag.x = waxbagEndX;
      waxbag.y = waxbagEndY;
      //checkGame();
      break;
      case cup:
    if (cup.x < cupEndX - offset || cup.x > cupEndX + offset || cup.y < cupEndY - offset || cup.y > cupEndY + offset) {
      cup.x = cupStartX;
      cup.y = cupStartY;
      else {
      cup.x = cupEndX;
      cup.y = cupEndY;
      //checkGame();
      break;
      case yogurt:
    if (yogurt.x < yogurtEndX - offset || yogurt.x > yogurtEndX + offset || yogurt.y < yogurtEndY - offset || yogurt.y > yogurtEndY + offset) {
      yogurt.x = yogurtStartX;
      yogurt.y = yogurtStartY;
      else {
      waxbag.x = waxbagEndX;
      waxbag.y = waxbagEndY;
      //checkGame();

    Some questions:
    1. Can I specify more than one End x,y location for a draggable sprite?
    yes, use an if-else statement
    I'm creating a lesson to teach kindergartners how to sort lunchroom waste. If they have a napkin, for example, it could either go into the compost OR into the recycling. In cases like this where an item could really be placed into more than one bin, I want them to get it right if they do either of those things, rather than forcing them to choose which one.
    2. To make my project more "fun" for kids, I wanted to customize the cursor with a graphic of  hand. When I tried this in the flash file it works perfectly until I add the drag and drop functionality for the wasted items. Then the cursor will more around  but not pick up any items. Once I revert back to the standard pointer, the correct drag and drop functionality is restored.
    assign your cursor's mouseEnabled property to false:
    yourcursor.mouseEnabled=false;
    3. I have it set to snap back to the original location if learner attempts to drop the item on the wrong target. I want to be able to play a sound file when that happens, as well as play a sound file when it lands on the correct target, as well as shrink the item and change its opacity so that it appears invisible. I want to give the illusion of it being placed into the bin. I have no idea as to the proper way to code these events so that they happen.
    use the sound class to create a sound:
    // initialize your correct sound once with
    var correctSound:Sound=new CorrectSound();  // add an mp3 sound to your library and assign it class = CorrectSound
    // apply the play() method everytime you want your sound to play:
    correctSound.play();
    // change an object's opacity:
    someobject.alpha = .3;  // partially visible
    someobject.alpha = 1;  // fully visible
    someobject.visible=false;  // not visible, at all.
    // change an object's scale
    someobject.scaleX=someobject.scaleY=.5;  // shink width and height by 2
    someobject.scaleX=someobject.scaleY=1;  // resize to original
    4. I've watched dozens of hours of youtube tutorials before coming here. I'm a quick study, but am very new to action script. In one of the videos the developer showed referencing an external action script file which I don't think is an option in CC. The coding method he used seemed much more streamlined and "clean" than the chunks I'm working with now. Is there an easy way for me to code information about these objects  than the way I've got it here now? I hate starting new things with bad habits. The perils of self-teaching.
    you could google: 
    actionscript 3 class coding
    actionscript 3 object oriented programming
    p.s.  you can simplify and streamline your coding by learning about arrays and using hitTestObject.

  • Custom Cursors with AS3

    I used the code snippets to create a custom cursor and it works well.  What if I want that cursor to change when it's clicked?  Can I do that easy enough?  Thanks.

    you can use a stage mousedown listener to make it appear your cursor was clicked.

  • How to make a custom cursor

    How do you make a custom Cursor with the Cursor class, so that I can use it in my program.
    And also, how do you make a LookAndFeel??

    To make a cursor use:
    createCustomCursor public Cursor createCustomCursor(Image cursor,
                                     Point hotSpot,
                                     String name)
                              throws IndexOutOfBoundsException, HeadlessException
    Creates a new custom cursor object. If the image to display is invalid, the cursor will be hidden
    (made completely transparent), and the hotspot will be set to (0, 0). Parameters:hotSpot - the X
    and Y of the large cursor's hot spot. The hotSpot values must be less than the Dimension returned
    by getBestCursorSize().name - a localized description of the cursor, for Java Accessibility use.
    Throws: IndexOutOfBoundsException - if the hotSpot values are outside the bounds of the cursor.

  • Need to increase performance-bulk collect in cursor with limit and in the for loop inserting into the trigger table

    Hi all,
    I have a performance issue in the below code,where i am trying to insert the data from table_stg into target_tab and in parent_tab tables and then to child tables via cursor with bulk collect .the target_tab and parent_tab are huge tables and have a row wise trigger enabled on it .the trigger is mandatory . This timetaken for this block to execute is 5000 seconds.Now my requirement is to reduce it to 5 to 10 mins.
    can someone please guide me here.Its bit urgent .Awaiting for your response.
    declare
    vmax_Value NUMBER(5);
      vcnt number(10);
      id_val number(20);
      pc_id number(15);
      vtable_nm VARCHAR2(100);
      vstep_no  VARCHAR2(10);
      vsql_code VARCHAR2(10);
      vsql_errm varchar2(200);
      vtarget_starttime timestamp;
      limit_in number :=10000;
      idx           number(10);
              cursor stg_cursor is
             select
                   DESCRIPTION,
                   SORT_CODE,
                   ACCOUNT_NUMBER,
                     to_number(to_char(CORRESPONDENCE_DATE,'DD')) crr_day,
                     to_char(CORRESPONDENCE_DATE,'MONTH') crr_month,
                     to_number(substr(to_char(CORRESPONDENCE_DATE,'DD-MON-YYYY'),8,4)) crr_year,
                   PARTY_ID,
                   GUID,
                   PAPERLESS_REF_IND,
                   PRODUCT_TYPE,
                   PRODUCT_BRAND,
                   PRODUCT_HELD_ID,
                   NOTIFICATION_PREF,
                   UNREAD_CORRES_PERIOD,
                   EMAIL_ID,
                   MOBILE_NUMBER,
                   TITLE,
                   SURNAME,
                   POSTCODE,
                   EVENT_TYPE,
                   PRIORITY_IND,
                   SUBJECT,
                   EXT_PRD_ID_TX,
                   EXT_PRD_HLD_ID_TX,
                   EXT_SYS_ID,
                   EXT_PTY_ID_TX,
                   ACCOUNT_TYPE_CD,
                   COM_PFR_TYP_TX,
                   COM_PFR_OPT_TX,
                   COM_PFR_RSN_CD
             from  table_stg;
    type rec_type is table of stg_rec_type index by pls_integer;
    v_rt_all_cols rec_type;
    BEGIN
      vstep_no   := '0';
      vmax_value := 0;
      vtarget_starttime := systimestamp;
      id_val    := 0;
      pc_id     := 0;
      success_flag := 0;
              vstep_no  := '1';
              vtable_nm := 'before cursor';
        OPEN stg_cursor;
              vstep_no  := '2';
              vtable_nm := 'After cursor';
       LOOP
              vstep_no  := '3';
              vtable_nm := 'before fetch';
    --loop
        FETCH stg_cursor BULK COLLECT INTO v_rt_all_cols LIMIT limit_in;
                  vstep_no  := '4';
                  vtable_nm := 'after fetch';
    --EXIT WHEN v_rt_all_cols.COUNT = 0;
        EXIT WHEN stg_cursor%NOTFOUND;
    FOR i IN 1 .. v_rt_all_cols.COUNT
      LOOP
       dbms_output.put_line(upper(v_rt_all_cols(i).event_type));
        if (upper(v_rt_all_cols(i).event_type) = upper('System_enforced')) then
                  vstep_no  := '4.1';
                  vtable_nm := 'before seq sel';
              select PC_SEQ.nextval into pc_id from dual;
                  vstep_no  := '4.2';
                  vtable_nm := 'before insert corres';
              INSERT INTO target1_tab
                           (ID,
                            PARTY_ID,
                            PRODUCT_BRAND,
                            SORT_CODE,
                            ACCOUNT_NUMBER,
                            EXT_PRD_ID_TX,         
                            EXT_PRD_HLD_ID_TX,
                            EXT_SYS_ID,
                            EXT_PTY_ID_TX,
                            ACCOUNT_TYPE_CD,
                            COM_PFR_TYP_TX,
                            COM_PFR_OPT_TX,
                            COM_PFR_RSN_CD,
                            status)
             VALUES
                            (pc_id,
                             v_rt_all_cols(i).party_id,
                             decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                             v_rt_all_cols(i).sort_code,
                             'XXXX'||substr(trim(v_rt_all_cols(i).ACCOUNT_NUMBER),length(trim(v_rt_all_cols(i).ACCOUNT_NUMBER))-3,4),
                             v_rt_all_cols(i).EXT_PRD_ID_TX,
                             v_rt_all_cols(i).EXT_PRD_HLD_ID_TX,
                             v_rt_all_cols(i).EXT_SYS_ID,
                             v_rt_all_cols(i).EXT_PTY_ID_TX,
                             v_rt_all_cols(i).ACCOUNT_TYPE_CD,
                             v_rt_all_cols(i).COM_PFR_TYP_TX,
                             v_rt_all_cols(i).COM_PFR_OPT_TX,
                             v_rt_all_cols(i).COM_PFR_RSN_CD,
                             NULL);
                  vstep_no  := '4.3';
                  vtable_nm := 'after insert corres';
        else
              select COM_SEQ.nextval into id_val from dual;
                  vstep_no  := '6';
                  vtable_nm := 'before insertcomm';
          if (upper(v_rt_all_cols(i).event_type) = upper('REMINDER')) then
                vstep_no  := '6.01';
                  vtable_nm := 'after if insertcomm';
              insert into parent_tab
                 (ID ,
                 CTEM_CODE,
                 CHA_CODE,            
                 CT_CODE,                           
                 CONTACT_POINT_ID,             
                 SOURCE,
                 RECEIVED_DATE,                             
                 SEND_DATE,
                 RETRY_COUNT)
              values
                 (id_val,
                  lower(v_rt_all_cols(i).event_type), 
                  decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                  'Email',
                  v_rt_all_cols(i).email_id,
                  'IADAREMINDER',
                  systimestamp,
                  systimestamp,
                  0);  
         else
                vstep_no  := '6.02';
                  vtable_nm := 'after else insertcomm';
              insert into parent_tab
                 (ID ,
                 CTEM_CODE,
                 CHA_CODE,            
                 CT_CODE,                           
                 CONTACT_POINT_ID,             
                 SOURCE,
                 RECEIVED_DATE,                             
                 SEND_DATE,
                 RETRY_COUNT)
              values
                 (id_val,
                  lower(v_rt_all_cols(i).event_type), 
                  decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                  'Email',
                  v_rt_all_cols(i).email_id,
                  'CORRESPONDENCE',
                  systimestamp,
                  systimestamp,
                  0); 
            END if; 
                  vstep_no  := '6.11';
                  vtable_nm := 'before chop';
             if (v_rt_all_cols(i).ACCOUNT_NUMBER is not null) then 
                      v_rt_all_cols(i).ACCOUNT_NUMBER := 'XXXX'||substr(trim(v_rt_all_cols(i).ACCOUNT_NUMBER),length(trim(v_rt_all_cols(i).ACCOUNT_NUMBER))-3,4);
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 'IB.Correspondence.AccountNumberMasked',
                 v_rt_all_cols(i).ACCOUNT_NUMBER);
             end if;
                  vstep_no  := '6.1';
                  vtable_nm := 'before stateday';
             if (v_rt_all_cols(i).crr_day is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Day',
                 'IB.Crsp.Date.Day',
                 v_rt_all_cols(i).crr_day);
             end if;
                  vstep_no  := '6.2';
                  vtable_nm := 'before statemth';
             if (v_rt_all_cols(i).crr_month is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Month',
                 'IB.Crsp.Date.Month',
                 v_rt_all_cols(i).crr_month);
             end if;
                  vstep_no  := '6.3';
                  vtable_nm := 'before stateyear';
             if (v_rt_all_cols(i).crr_year is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Year',
                 'IB.Crsp.Date.Year',
                 v_rt_all_cols(i).crr_year);
             end if;
                  vstep_no  := '7';
                  vtable_nm := 'before type';
               if (v_rt_all_cols(i).product_type is not null) then
                  insert into child_tab
                     (COM_ID,                                            
                     KEY,                                                                                                                                        
                     VALUE)
                  values
                    (id_val,
                     'IB.Product.ProductName',
                   v_rt_all_cols(i).product_type);
                end if;
                  vstep_no  := '9';
                  vtable_nm := 'before title';         
              if (trim(v_rt_all_cols(i).title) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE )
              values
                (id_val,
                 'IB.Customer.Title',
                 trim(v_rt_all_cols(i).title));
              end if;
                  vstep_no  := '10';
                  vtable_nm := 'before surname';
              if (v_rt_all_cols(i).surname is not null) then
                insert into child_tab
                   (COM_ID,                                            
                   KEY,                                                                                                                                          
                   VALUE)
                values
                  (id_val,
                  'IB.Customer.LastName',
                  v_rt_all_cols(i).surname);
              end if;
                            vstep_no  := '12';
                            vtable_nm := 'before postcd';
              if (trim(v_rt_all_cols(i).POSTCODE) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Customer.Addr.PostCodeMasked',
                  substr(replace(v_rt_all_cols(i).POSTCODE,' ',''),length(replace(v_rt_all_cols(i).POSTCODE,' ',''))-2,3));
              end if;
                            vstep_no  := '13';
                            vtable_nm := 'before subject';
              if (trim(v_rt_all_cols(i).SUBJECT) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Correspondence.Subject',
                  v_rt_all_cols(i).subject);
              end if;
                            vstep_no  := '14';
                            vtable_nm := 'before inactivity';
              if (trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) is null or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '3' or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '6' or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '9') then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Correspondence.Inactivity',
                  v_rt_all_cols(i).UNREAD_CORRES_PERIOD);
              end if;
                          vstep_no  := '14.1';
                          vtable_nm := 'after notfound';
        end if;
                          vstep_no  := '15';
                          vtable_nm := 'after notfound';
        END LOOP;
        end loop;
                          vstep_no  := '16';
                          vtable_nm := 'before closecur';
        CLOSE stg_cursor;
                          vstep_no  := '17';
                          vtable_nm := 'before commit';
        DELETE FROM table_stg;
      COMMIT;
                          vstep_no  := '18';
                          vtable_nm := 'after commit';
    EXCEPTION
    WHEN OTHERS THEN
      ROLLBACK;
      success_flag := 1;
      vsql_code := SQLCODE;
      vsql_errm := SUBSTR(sqlerrm,1,200);
      error_logging_pkg.inserterrorlog('samp',vsql_code,vsql_errm, vtable_nm,vstep_no);
      RAISE_APPLICATION_ERROR (-20011, 'samp '||vstep_no||' SQLERRM:'||SQLERRM);
    end;
    Thanks

    Its bit urgent
    NO - it is NOT urgent. Not to us.
    If you have an urgent problem you need to hire a consultant.
    I have a performance issue in the below code,
    Maybe you do and maybe you don't. How are we to really know? You haven't posted ANYTHING indicating that a performance issue exists. Please read the FAQ for how to post a tuning request and the info you need to provide. First and foremost you have to post SOMETHING that actually shows that a performance issue exists. Troubleshooting requires FACTS not just a subjective opinion.
    where i am trying to insert the data from table_stg into target_tab and in parent_tab tables and then to child tables via cursor with bulk collect .the target_tab and parent_tab are huge tables and have a row wise trigger enabled on it .the trigger is mandatory . This timetaken for this block to execute is 5000 seconds.Now my requirement is to reduce it to 5 to 10 mins.
    Personally I think 5000 seconds (about 1 hr 20 minutes) is very fast for processing 800 trillion rows of data into parent and child tables. Why do you think that is slow?
    Your code has several major flaws that need to be corrected before you can even determine what, if anything, needs to be tuned.
    This code has the EXIT statement at the beginning of the loop instead of at the end
        FETCH stg_cursor BULK COLLECT INTO v_rt_all_cols LIMIT limit_in;
                  vstep_no  := '4';
                  vtable_nm := 'after fetch';
    --EXIT WHEN v_rt_all_cols.COUNT = 0;
        EXIT WHEN stg_cursor%NOTFOUND;
    The correct place for the %NOTFOUND test when using BULK COLLECT is at the END of the loop; that is, the last statement in the loop.
    You can use a COUNT test at the start of the loop but ironically you have commented it out and have now done it wrong. Either move the NOTFOUND test to the end of the loop or remove it and uncomment the COUNT test.
    WHEN OTHERS THEN
      ROLLBACK;
    That basically says you don't even care what problem occurs or whether the problem is for a single record of your 10,000 in the collection. You pretty much just throw away any stack trace and substitute your own message.
    Your code also has NO exception handling for any of the individual steps or blocks of code.
    The code you posted also begs the question of why you are using NAME=VALUE pairs for child data rows? Why aren't you using a standard relational table for this data?
    As others have noted you are using slow-by-slow (row by row processing). Let's assume that PL/SQL, the bulk collect and row-by-row is actually necessary.
    Then you should be constructing the parent and child records into collections and then inserting them in BULK using FORALL.
    1. Create a collection for the new parent rows
    2. Create a collection for the new child rows
    3. For each set of LIMIT source row data
      a. empty the parent and child collections
      b. populate those collections with new parent/child data
      c. bulk insert the parent collection into the parent table
      d. bulk insert the child collection into the child table
    And unless you really want to either load EVERYTHING or abandon everything you should use bulk exception handling so that the clean data gets processed and only the dirty data gets rejected.

  • Custom cursor using image gets resized bigger

    I have created a custom cursor using the following code:
    ClassLoader cl = this.getClass().getClassLoader();     
    Toolkit tk = Toolkit.getDefaultToolkit();
    Image im = tk.getImage( cl.getResource("images/wallcursor.gif"));
    Cursor Custom_Cursor = tk.createCustomCursor(im,new Point(9,9),"Drawing wall");
    draftGrid.setCursor( Custom_Cursor );The cursor is loaded and it works, however - the image I use for the cursor is resized so it gets too big. Any clues on why this happens?
    btw; draftGrid is one of my own classes that extends JComponent.
    - bjorn

    Thanks for your replies guys.
    I tried your code KPSeal, and it works in resizing the cursor image back to its original size. However, a gray square of size 32,32 (which is returned by getBestCursorSize()) is shown round the cursor.
    Here is the updated code (yours hade some minor bugs)
    Image im = tk.getImage( cl.getResource("images/wallcursor.gif"));
    try {
           tracker.addImage(im, 0 );
           tracker.waitForID(0);
    } catch( InterruptedException ie ) {
           ie.printStackTrace();
    int w = im.getWidth(this);
    int h = im.getHeight(this);
    int pw = Toolkit.getDefaultToolkit().getBestCursorSize(w, h).width;
    int ph = Toolkit.getDefaultToolkit().getBestCursorSize(w, h).height;
    System.out.println("w="+w+", h="+h+" - pw="+pw+", ph="+ph);
    Image cim = createImage(pw, ph);
    cim.getGraphics().drawImage(im,0,0, this);                     
    Cursor Custom_Cursor = tk.createCustomCursor(cim,new Point(0,0),"Drawing wall");
    draftGrid.setCursor( Custom_Cursor );The System.out.println statement prints: w=18, h=13 - pw=32, ph=32
    If I try to do the createImage with w and h instead of pw and ph the same gray square (32,32) is created, and in addition the cursor's size is too big which was the probem to begin with ...
    - bjorn

  • How to load and increase size of a custom cursor on a certain monitor (1st or 2nd)?

    In my application I need to load a custom cursor, make it big and display it on the my second monitor in a dual monitor setup to let user click with an additional mouse. I found this thread able to solve the first 2 questions, however the cursor only changes within the VI panel. I had tried but couldn't get a handle to the second monitor, in face, not my primary one as well since I'm not familiar with winapi. I also want to restrict when the user can use the second mouse and only in the second monitor if possible. By the way I am using windows 7 64 bit with Labview 9 32 bit.
    Thanks,

    Ishi,
    More than likely, you are going to have to use Windows OS APIs for this. It sounds like you would like to integrate your program at the operating system level, and will have to make calls to Windows to accomplish this in the proper manner.  You can make calls to Windows in LabVIEW through several methods. Check out this example that sets the position of the cursor via a Call Library Function Node to the Windows SDK.  
    http://zone.ni.com/devzone/cda/epd/p/id/2315
    Cheers,
    Aaron
    National Instruments

  • CS6 - Custom Cursor & Button's icon

    I am trying to display a custom cursor when mouse is moving on a button which has icon.
    But the button's icon is always in front of my cursor image.
    How to make my cursor image on top?
    Belows is my code. Please tell me what's wrong.
    Thank you!
    <mx:Application... creationComplete = "init()>
    private var MyCursor:Shape = new Shape();
    private function init():void{
        // draw custom cursor
        MyCursor.graphics.clear();
        MyCursor.graphics.lineStyle(2, 0xFF0000, 1,true);
        MyCursor.graphics.drawCircle(0,0,6);
        MyCursor.graphics.moveTo(-3,-3);
        MyCursor.graphics.lineTo(4,4);
        MyCursor.visible = false;
        // add to the layer
        CursorLayer.addChild(MyCursor);
    private function ShowCustomCursor(e: MouseEvent):void
        Mouse.hide();
        MyCursor.x = e.stageX;
        MyCursor.y = e.stageY;
        MyCursor.visible = true;
    private funtion HideCustomCursor(e:MouseEvent):void
        Mouse.show();
        MyCursor.visible = false;
    <mx:UIComponent id = "CursorLayer" x ="0' y="0" width ="1000" height = "1000" blendMode="layer">
    <mx:Button id="btnTest" x="50" y="5" width="28" height="20" buttonMode="true"
    icon="@Embed(source='assets/btnTest.png')"
    mouseFocusEnabled="true"
    mouseMove="ShowCustomCursor(event)"
    mouseOut="HideCustomCursor(event)"
    tabEnabled="false"
    useHandCursor="true"/>

    that's because your cursor is sporadically moving over your interactive objects interfering with their mouseevents.
    to remedy, disable the mouseEnabled property of your cursor.

  • Custom infotype with table

    Hi Guyz,
    i have to create a custom infotype with a table in it.i have created the PS structure (PM01)with fields a,b,c,d,e. i gave the infotype charac, techn attr, activated the PA table and P structure . In the lay out editor i created a table and put the fields a, b and c. i dragged the input/output field on the table and then dragged the text fileds above them. when i check the layout i get the following error in the flow logic.
    Program MP988800 Screen 2000
    The field P9888-ZA is not assigned to a loop. "LOOP............ENDLOOP" must
    appear in "PBO" and "PAI"
    can anyone tell me how and where should i write the code for the table to get activated. Thanks a lot.

    HI Ranjeth,
      i have tried the code you provided. I am getting errors.can you please tell me what IT_TBCTRL_BEHAVIOR and IS_TBCTRL_BEHAVIOR are.
    i am getting the following errors.
    Statement CONTROLS is not defined.
    IS_TBCTRL_BEHAVIOR-CODETXT not defined
    IS_TBCTRL_BEHAVIOR-RATE not defined.
      i have replaced i_bc_tbctrl with the table name which i defined in the layout editor.  i have put your code in the flow logic. check the code below
    CONTROL: options TYPE TABLEVIEW USING SCREEN 2000.
    PROCESS BEFORE OUTPUT.
    LOOP AT IT_TBCTRL_BEHAVIOR
    INTO IS_TBCTRL_BEHAVIOR
    WITH CONTROL options
    CURSOR options-CURRENT_LINE.
    MODULE options_GET_LINES.
    ENDLOOP.
            general infotype-independent operations
      MODULE BEFORE_OUTPUT.
      CALL SUBSCREEN subscreen_empl   INCLUDING empl_prog empl_dynnr.
      CALL SUBSCREEN subscreen_header INCLUDING header_prog header_dynnr.
            infotype specific operations
      MODULE P9111.
      MODULE HIDDEN_DATA.
    PROCESS AFTER INPUT.
    LOOP AT IT_TBCTRL_BEHAVIOR.
    CHAIN.
    FIELD IS_TBCTRL_BEHAVIOR-CODETXT.
    FIELD IS_TBCTRL_BEHAVIOR-RATE.
    MODULE options_MODIFY ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    process exit commands
      MODULE EXIT AT EXIT-COMMAND.
            processing after input
            check and mark if there was any input: all fields that
            accept input HAVE TO BE listed here

  • Custom Cursor point style on XY graph

    Is there is a way you can change the point style of a cursor on an xy graph to somthing custom, possibly an image or somthing else. Basicly Id like to have very many point styles, but more then just whats in LV, Id want some that actually look different.
    Thanks,
    -Mark

    Hi Mark,
    You can use an event structure to detect when the mouse enters or leaves the XY graph. When the mouse enters you can set the cursor using the "Set Cursor" VI and when it leaves you can unset the cursor using the "Unset Busy" VI. You can create a reference to a custom cursor beforehand using the "Create Cursor from file" VI. Unfortunately none of the VIs that I mention here are available with the base package.
    I've attached an example program written in LV7 on Windows. (note: you need a .ani or .cur file for the cursor you wish to use)
    Hope this helps,
    Neil
    Attachments:
    XY_Cursor.vi ‏83 KB

  • How would I create a layer ABOVE a custom cursor? [CS5 Pro]

    ...so the custom cursor would disappear behind the layer when moved across it.
    Currently if the layer is simply put at the top of the layer list [above the mouse cursor layer] when published the mouse cursor supersedes it and appears above all layers... not behind any
    Many many thanks for your help in advance oh Holy Whizzkids

    First, try removing that first line and see if it helps.
    Second, if it doesn't help, after that line do the same for whatever object you have in the layer you want to sit above the cursor... it'll need to be objects that you can target with code.
    What addChild() does is it takes the object being targeted and places at the top of the display list.  So that first line is essentially uprooting whytehand from the timeline and placing it above all other content planted in the timeline.  So either you don't use it, or you also use it to place the other content above the cursor.

  • Netbeans 6.1 won't use customized cursor .

    Hi , Have you guys tried the Netbeans 6.1 ?  If you have ever used netbeans ,you know what I am talking about.
    I wonder if anyone has encountered the same problem . when I expand the tree node in the project window or file window , the cursor changed into an waiting cursor , that normal ,but the waiting cursor isn't my customized cursor ,but the xorg's default black watch, I have the same problem when testing on windows , the waiting cursor in netbeans is the windows default large ugly one .
    why netbeans don't use my customized cursor instead of the system default one ? Do the developers of netbeans think all the linux users use the black watch cursor ?
    Have you encountered the same issue ?

    I just noticed the same issue with an Airport Express 802.11n (2nd) with version 7.6.3. I configured the primary and the secondary radius server on the Airport Express.
    With the primary radius server running WLAN login with WPA2/Enterprise worked fine.
    I then stopped the primary radius server and tried to repeat the WLAN login again and it failed. In the secondary radius server log there was no trace at all even when I started the radius server in debug mode.
    Because the Airport Express is in another subnet than the two radius server I enabled logging on my router firewall. I found only four retries for the primary radius server.
    This proves your result that the secondary radius server is never used.

  • Custom Cursors- drawing bitmaps?

    Hello everyone,
    I went on to www.youtube.com and found a tutorial to set up
    custom cursor using the actionscript(2.0) on the actualt movie
    clip(which was my cursor):
    onClipEvent(enterFrame)
    _x=_root._xmouse
    _y=_root._ymouse
    And the actionscript on the acutal frame:
    Mouse.hide()
    This code sufficiantly replaced my mouse with my movie clip,
    but I noticed when i moused over my button, they did not show the
    same mouse over that I had with the normal mouse.
    Another thing I could like to acomplish is, when my custom
    cursor click anywhere in the flash movie, it overlays a bitmap(an
    image(a .jpeg)) on that instance of that flash movie. I've seen it
    done before in flash sites that allow that user to create things
    such as characters or art. I know it's posible, but I've searched
    all of the internet and have gained no fruit from it.
    If anyone would be so kind as to show me how to go this, or
    even simply point me to a link. I would be very greatful. If I do
    get it working, I'll be sure to share it with the community, as
    what I'm gonna use it for is pretty cool in my opinion.
    Thanks for your time and consideration.
    Peace,
    Mike.

    So I put the code clbeech seggusted in the actions frame and
    it didn't work.
    How do I insert a link to download my flash file so that
    someone can see waht's actually going on?
    Also,
    I'm having trouble with button events.
    I entered some code in the actions palette after clicking on
    the button in the stage. The code was:
    on (release) {
    gotoAndPlay(36);
    Simple enough right?
    Well the frames didn't play, it glitched for a second,
    teasing me as if it would, but didn't.
    I got this compilke error:
    Mouse events are premitted only for button instances.
    This was the error I got from clbeech's code after inserting
    it on the first frame in the actions layer.
    Expected a feild name '.' operator.

  • Custom cursor - dynamically change colour

    Since I failed to gain access to [Embed]ed SWF file to change
    its properies from within Flex :-(
    has anyone got any ideas how to create a custom cursor and
    dynamically change its colour.
    Let's say we have a brush or a pencil cursor and we want to
    change the colour of its tip, when a certain coloured button is
    pressed with it.
    Thank you.

    Use sym for your element.
    sym.$("button").css({'cursor':'pointer'});

  • CS3 Custom cursor acting wierd

    Hello, I am a student in an animation class; our current project is making a website portfolio.  I have discovered some sort of bug or something to that effect, inside of my custom cursor is a button, this button contains a click function.  When I click with the cursor the animation does play, but to a point.  The error occurs when the layer with the custom cursor is above the layer with the buttons.  Neither the rollover, nor the "go to" function work when the timeline's layers is arranged like so.  BUT when the custom cursor is in a layer below the buttons the buttons work fine, but the cursor's animation doesn't play when you click on them, and becaue the cursor is on a layer below the buttons it appears below the buttons when rendered out.
    Please help if you can,
    Thanks!~

    that's normal behavior.  mouse events are intercepted by the top-most interactive object.
    if you want help working-around that behavior, are you using as2 or as3?

Maybe you are looking for

  • Calling an ABAP program from a document list

    Hi, we have the following problem with a custom ABAP program. This program executes a lot of user's functions, such as documents creation, material movements creation, and so on.. from a single dynpro. We would like to call this program from a list o

  • Hyperion Planning 11.1.2.4

    Dears, I created an epma application but I am not able to see the application when i login from HyperionPlanning url. Please some one suggest something. Thanks.

  • Can't load Mandrake 9 with onBoard sound enabled.

    Any ideas as to why? I can not boot into Mandrake 9 when I have onBoard sound enabled, it always freezes when it tries to load the i810 sound interface system. Yet when I disable it in the bios it loads perfectly. I've already installed the nForce sy

  • Old iMessages not showing on iPhone 6 after upgrade from iP5

    Hey guys, I've picked up my iP6 today and I can't see any of the old iMessages I've had. They are still showing on my MBP but not on the new iPhone (MBP is still running Mavericks as I don't want to upgrade before I submit the project for work next w

  • Image processor script and image interpolation setting (cs3)

    Hi all, I'm using Bridge & Photoshop CS3 (mac) to process batches of photographs. I've discovered that the script "Image Processor" does not take into account the "image interpolation" setting of my General Preferences in Photoshop. It's very painful