Drag and Drop with Calendar functionality in BSP/WebDynpro

Hi,
I am not sure where to ask this information. First trying in this forum.
We are looking for a  scheduling software-kind of functionality within SAP. We get service calls from customers if there is any leak on the roof. We would like to know if we can provide drag and drop functionality in BSP/Webdynpro. We are envisioning left pane with Leak Notification # (could be 25-30 Notification calls per office) and calendar(month or week) functionality on right pane of the page. The service manager can drag and drop Leak Notification # into Calendar on the right pane OR move around within Calendar. When they do that, we want to update certain custom table fields in SAP. Do you think this can be done in BSP or Webdynpro for ABAP easily. If so, can you point us in the right direction ?
Regards,
Niranjan

Thanks once again for the reply Thomas.
Yes, we have used XHTMLB and PHTMLB extensively.
One last question if you don't mind since you now work for SAP. We have 1-2 BSP applications written without MVC pattern. We are thinking to convert that to MVC using Webdynpro ABAP. Do you suggest that for any new applications we should start using Webdynpro ABAP and not BSP ? I look at Webdynpro as ABAP query(with not much flexibility) and BSP as normal ABAP coding (which offers more flexibility). Is my assumption correct ? I want to know where SAP is investing in future; is it Webdynpro OR BSP ?
Also, do you know if SAP has come out with new themes like Design2009 or Design2010 or Design2011. We currently use Design2003 and it does not work well with Firefox or Chrome.
Thanks once again for writing that book. In fact, I will be training one of my colleague next week on BSP and I am planning to go throu your book this weekend to refresh my memory before training her.
Niranjan

Similar Messages

  • What is the correct way to add styling to drag-and-drop created calendars?

    I have a working instance of a rich client calendar. I generated the view with the required fields (start, stop, provider, ...), put it into the App Module, and dragged it onto a JSF page to create a calendar.
    Next I created an activityScope object in a class called CalendarBean (no inheritance)
    Class CalendarBean()
    private HashMap<Set<String>, InstanceStyles> activityColorMap;
    +..+
    +public CalendarBean() {+
    super();
    activityColorMap = new HashMap<Set<String>, InstanceStyles>();
    HashSet setEd = new HashSet<String>();
    HashSet setLen = new HashSet<String>();
    setEd.add("Work");
    setLen.add("Home");
    activityColorMap.put(setEd, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityColorMap.put(setLen, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.RED));
    +}+
    +}+
    Next, I linked this up as a backing bean and associated the ActivityStyles of CalendarBean to it:
    +#{backingBeanScope.calendarBean.activityColorMap}+
    I populated some records in the database with properties "Work" and "Ed', but they show default blue.
    As I understand it, I need to do something with the getTags() method of the underlying CalendarActivity class, but I'm not quite sure how to do that.
    Took a stab at creating a class, CalendarActivityBean, that extended CalendarActivity, and pointed all the CalendarActivity references I had to the new class, but it didn't seem to fire (in debug), and I got into trouble, when inserting records, with
    public void calendarActivityListener(CalendarActivityEvent calendarActivityEvent) {
    currActivity = (CalendarActivityBean) calendarActivityEvent.getCalendarActivity();
    being an illegal cast
    What is the correct way to add provider-based styling to drag-and-drop create calendars?
    Ed Schechter

    A colleague of mine was kind enough to solve this:
    The calendar has ActivityStyles property = #{calendarBean.activityStyles}
    CalendarBean looks something like this:
    package com.hub.appointmentscheduler.ui.schedule;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Set;
    import oracle.adf.view.rich.util.CalendarActivityRamp;
    import oracle.adf.view.rich.util.InstanceStyles;
    +public class CalendarBean {+
    private HashMap activityStyles;
    private String dummy;
    +public CalendarBean() {+
    +// Define colors+
    activityStyles = new HashMap<Set<String>, InstanceStyles>();
    HashSet setPending = new HashSet<String>();
    HashSet setArrived = new HashSet<String>();
    HashSet setApproved = new HashSet<String>();
    HashSet setCompleted = new HashSet<String>();
    setApproved.add("APPROVED");
    setPending.add("PENDING");
    setArrived.add("ARRIVED");
    setCompleted.add("COMPLETED");
    activityStyles.put(setApproved, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.GREEN));
    activityStyles.put(setPending, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityStyles.put(setArrived, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.PLUM));
    activityStyles.put(setCompleted, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.LAVENDAR));
    +}+
    +public void setactivityStyles(HashMap activityStyles) {+
    this.activityStyles = activityStyles;
    +}+
    +public HashMap getactivityStyles() {+
    return activityStyles;
    +}+
    +}+
    Now, go into the Bindings tab on the calendar page, double click the calendar binding, and specify the column you've defined as the calendar's Provider in the Tags dropdown.
    Should show colors.

  • [SOLVED] Thunar 1.6 doesn't drag-and-drop with the right mouse button

    Hallo all.
    It might be something I've done (though I did delete my ~/.config/Thunar directory before upgrading), but Thunar doesn't let me drag-and-drop with the right mouse button, thus stopping me from copying something instead of moving it, etc. Has anyone else had that too?
    Last edited by GordonGR (2012-12-28 14:34:20)

    Joel wrote:
    anonymous_user wrote:Is it supposed to be with the right-mouse button? I always thought drag and drop was done with the left button?
    Could be right-hand user
    Come on! Read what GordonGR wrote!
    Microsoft Windows, Nautilus, the Haiku Tracker, and probably many other file managers have a feature where, when you right-click or middle-click and drag an icon to a new location, a pop-up menu appears and asks what you'd like to do (Move, Copy, Link). I thought I used to use this feature in Thunar too but it seems to have stopped working in recent versions. Has anyone else had any experience with it?
    EDIT: Here's random blogger talking about the feature in an older version of Thunar: http://jeromeg.blog.free.fr/index.php?p … and-tricks So that's good, I wasn't just imagining the feature.
    Last edited by drcouzelis (2012-12-12 03:45:05)

  • Can't Drag and Drop with a Double Tap using Single Finger in Lion?

    I installed the Mac OS X Lion two days. But I can't drag and drop with a Double tap using Single Finger, which I used to do in Snow Leopard.
    If I choose Three Finger Move, then Swap Between Pages goes back to "Scroll left or right with Two Fingers" that only works with Safari, but doesn't work with Chrome or Firefox.
    I tried literally every setting in Trackpad and also checked if there was a override settings and there is no overrride setting.
    Would be thankful, if you guys could suggest me what to do?
    ======================================
    My Machine Configuration:
    Macbook Pro 13" (mid 2010)
    Intel Core 2 Duo 2.4GHz
    4GB Ram
    Nvidia Geforce 320m
    Mac OS X Lion (Installe on a updated Snow Leopard 10.6.8)

    Hey Serge many thanks for telling me how to do. now its working like previously
    I just cheked the Dragging under Trackpad option and unchecked Three Finger Moves. now I can drag and drop with a double tap using single finger.
    Thank you guys. You are the best

  • Error in drag and drop with a Tree component

    Hello, everybody.
    I'm doing a drag and drop with two trees.
    But, when I drag from a tree to another show this error:
    "oracle.job.RowNotFoundException:JBO25020: View line of oracle.jbo.Key[4.4] key not found in ViewTreeNodeRepository13_71."
    Besides that, in my property SelectionListerner, when I have this line: "#{bindings.TreeNodeRepository.treeModel.makeCurrent}" there is a warning that says: "Reference makeCurrent not found".
    Anyone can help me?
    Thanks!

    Hi,
    +Besides that, in my property SelectionListerner, when I have this line: "#{bindings.TreeNodeRepository.treeModel.makeCurrent}" there is a warning that says: "Reference makeCurrent not found".+
    Don't worry, its a designtime warning because the EL cannot be resolved. MakeCurrent is a method on the FacesCtrl binding equivalent to ADF, which is applied at runtime and not available at design time
    +But, when I drag from a tree to another show this error: "oracle.job.RowNotFoundException:JBO25020: View line of oracle.jbo.Key[4.4] key not found in ViewTreeNodeRepository13_71."+
    In drag and drop, ADF Faces performs the drag. However, the rest of the drop handling is up to the developer. Without any more information of what yur drop handler is doing, this question cannot be answered
    Frank

  • HOW TO DRAG AND DROP IN CALENDAR ?

    Hi guys,
    Once again I rely on your infinite wisdom to help me out with a little question I'm having regarding the Drag and Drop Functionality in the new Calendar control of the new APEX 4.1 (pretty cool by the way).
    The thing is that I'm trying to create a simple little page for scheduling purposes, basically for having a centralized place in which the members of a team with a remote manager put the info of which days are they planning on working and when will they start their shift and when they gonna leave, for that purpose I made use of the new Calendar control (pretty neat) which is working fine and is being fed by the following query (note that the field "DISPLAY_COLUMN" is the value that is displayed on the calendar):
    SELECT
    CASE WHEN eas.IS_HOLIDAY = 1 THEN ea.FNAME || ' (OOTO Using a make up Holiday)'
    WHEN eas.IS_VPN = 1 THEN ea.FNAME || ' (' || to_char(eas.SHIFT_START,'HH:MIPM') || ' - ' || to_char(eas.SHIFT_END,'HH:MIPM') || ')' || ' on VPN '
    WHEN ( eas.IS_VPN = 1 AND eas.IS_HOLIDAY = 1 ) THEN ea.FNAME || ' (' || to_char(eas.SHIFT_START,'HH:MIPM') || ' - ' || to_char(eas.SHIFT_END,'HH:MIPM') || ')' || ' on VPN & its Holiday '
    ELSE ea.FNAME || ' (' || to_char(eas.SHIFT_START,'HH:MIPM') || ' - ' || to_char(eas.SHIFT_END,'HH:MIPM') || ')'
    END AS DISPLAY_COLUMN
    , ea.ID AS ea_ID
    , ea.NAME AS ea_NAME
    , ea.FNAME AS ea_FNAME
    , ea.EMAIL AS ea_EMAIL
    , eas.ID AS eas_ID
    , eas.ASSIGNEE_ID AS eas_ASSIGNEE_ID
    , eas.DATE_ENTRY AS eas_DATE_ENTRY
    , eas.SHIFT_START AS eas_SHIFT_START
    , eas.SHIFT_END AS eas_SHIFT_END
    , eas.IS_VPN AS eas_IS_VPN
    , eas.IS_HOLIDAY AS eas_IS_HOLIDAY
    , CASE WHEN eas.IS_VPN = 1 THEN 'VPN'
    ELSE NULL END AS VPN_TEXT
    , CASE WHEN eas.IS_HOLIDAY = 1 THEN 'HOLIDAY'
    ELSE NULL END AS HOLIDAY_TEXT
    FROM EBA_ASSIGNEES ea, EBA_ASSIGNEES_SCHEDULE eas
    WHERE ea.ID = eas.ASSIGNEE_ID
    ORDER BY DISPLAY_COLUMN
    Alright, so far so good, everything is working just fine, the pop up window is inserting the calendar entries in the correct table as expected, but now I'd like to make use of the "Drag and Drop" functionality of this amazing control, to be able to "Clone" calendar entries in different dates instead of having the employees inserting their daily schedule for every day, so I'd like to be able to drag an existing entry from a certain day in the calendar and drop it elsewhere and I'd like the OnDemand process to make an insert on the table but with minor changes (like the date of the entry, of course) ,and I'm currently getting stuck in what to put in the OnDemand PLSQL process for that to happen (and how to reference the info in the row I'm currently dragging in the PLSQL code).
    Here's the table in which I'm currently inserting the Calendar entries (and in which I want to insert the result of the drag and drop as well):
    CREATE TABLE "EBA_ASSIGNEES_SCHEDULE"
    (     "ID" NUMBER NOT NULL ENABLE,
         "ASSIGNEE_ID" NUMBER NOT NULL ENABLE,
         "DATE_ENTRY" DATE NOT NULL ENABLE,
         "SHIFT_START" DATE,
         "SHIFT_END" DATE,
         "IS_VPN" NUMBER,
         "IS_HOLIDAY" NUMBER,
         CONSTRAINT "EBA_ASSIGNEES_SCHEDULE_PK" PRIMARY KEY ("ID") ENABLE
    Please guys, help me out here, I think this might be a simple process I just don't know how to proceed.
    Thanks in advance.
    Daniel Villegas.

    Hi,
    There are 3 things which you need to be clear about Drop & Drop On Demand Process.
    1. Which Column is used as primary Key while creating the SQL Calendar, you can find this under calendar attributes, Since your SQL Query used for Creating Calendar does not have ROWID, I think you would have ID column "eas.ID AS eas_ID" from your query.
    2. Which Column is used as Date Column in the Calendar from your query i think it must be one of these "DATE_ENTRY" DATE NOT NULL ENABLE, "SHIFT_START" DATE, "SHIFT_END" DATE, for the on demand process i will take DATE_ENTRY as your date column, please change accordingly
    3. Which Table need to be updated with the new date value when the data is dragged. In your case the Table will be "EBA_ASSIGNEES_SCHEDULE"
    So the on demand process will look like this.
    declare
    l_date_value varchar2(32767) := apex_application.g_x01;
    l_primary_key_value varchar2(32767) := apex_application.g_x02;
    begin
    update EBA_ASSIGNEES_SCHEDULE set DATE_ENTRY= to_date(l_date_value,'YYYYMMDD HH24MISS')
    where ID = l_primary_key_value;
    end;
    http://sathishkumarjs.blogspot.com/2011/07/enabling-drag-drop-and-add-edit-data.html
    Hope this helps
    "JS"

  • Old Drag and Drop With Toast Issue:

    I found this link to an old discussion, but it does not resolve my issue:
    http://discussions.apple.com/message.jspa?messageID=9282890#9282890
    I burnt two nice LightScribe labels, (nice because I cooked 'em twice for extra darkness, which takes time,) and then, after assuming that if I dragged and dropped my iTunes files to the desk top and then to Toast, as the above thread recommended, that since the files were accepted by toast doing things that way, that things were back to normal. I finished two beautiful CD's (I had a lot of work into the design of the labels,) by burning the music on to the disks. Well, my car cd player wouldn't play them, that is not normal, and I have two beautifully useless CD's which were the product of a lot of time and labor not to mention the cost of the disks... I've always been able to play back using the old process, (without the desktop drag and drop step,) - I'm running an iTunes version way beyond when this bug was supposed to be fixed. What do I do? How do I get back to being able to go directly from iTunes to Toast with successful playback? Thanks for your help with this!
    Message was edited by: probassist

    To anselmo Stiffan:
    Which problem did you solve: the double click with one tap or three finger drag? I too have aluminum 2008 MacBook, and I found the preferences and accessibility section but seem to fail in finding the right combo of preferences I'm used to or like. Ok, so the three finger drag is good, but click or tab... drives me bonkers!!! Everything was fine for me even after updating to Mountin Lion back in July 2012, but then all of a sudden in October 'my trackpad doesn't work the same. I don't even want to get on the computer anymore, because I'm annoyed and I cannot click on my user account to login with plugging in a mouse or using keyboard shortcut functions. It's hit or miss with my trackpad working, it freezes after awhile, then I have to plug in the darn mouse. I checked my trackpad firmware, it said up to date....I may have to actually start a new discussion??? But to continue venting... Some menu's need one tap, some require double tap... I cannot use one click unless its set to left or right for alternate menu's. Its just bad in my carpel tunnel and frustrating... I've been searching discussions for similar issues and I saw this. I saw you had an older Mac? It's funny how I switched over 4 years to Mac and mine is almost obsolete? I'm afraid to take it in only to pay more money. I guess my real question besides double clicking option would be if other folks with "the older Aluminum" 2008  MacBook models are having similar problems?

  • Drag and Drop with a response in Flash..please help

    Hi
    I have just started with flash and actionscript3 about 5 weeks ago. I'm in my first year uni and I have a drag and drop assignment (for a kindergarten class). Its "little Red Hen" and they have place the correct picture in right holder.
    I have gotten the drag and drop working but I can't seem to figure out how to display a tick when they have place it in the correct holder.
    Please help....
    This is my script (it may seem messy...still new)
    import flash.events.MouseEvent;
    /*Mouse Event that ensures the function of hen movieclip to start dragging
      when mouse is pressed*/
    hen1_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen2_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen3_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen4_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen5_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen6_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    function dragStart (event: MouseEvent):void
        event.target.startDrag();
    /*Mouse Event that ensures the function of hen movieclip to drop
    when the mouse button is realeased with Condition statement, if
    hen = holder, hen snaps into place*/
    hen1_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop1);
    function dragStop1 (event:MouseEvent):void
        hen1_mc.stopDrag();
        if (hen1_mc.hitTestObject (holder1_mc)==true)
            hen1_mc.x=holder1_mc.x;
            hen1_mc.y=holder1_mc.y;
    hen2_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop2);
    function dragStop2 (event:MouseEvent):void
        hen2_mc.stopDrag();
        if(hen2_mc.hitTestObject (holder2_mc)==true)
            hen2_mc.x=holder2_mc.x;
            hen2_mc.y=holder2_mc.y;
    hen3_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop3);
    function dragStop3 (event:MouseEvent):void
        hen3_mc.stopDrag();
        if(hen3_mc.hitTestObject (holder3_mc)==true)
            hen3_mc.x=holder3_mc.x;
            hen3_mc.y=holder3_mc.y;
    hen4_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop4);
    function dragStop4 (event:MouseEvent):void
        hen4_mc.stopDrag();
        if(hen4_mc,hitTestObject (holder4_mc)==true)
            hen4_mc.x=holder4_mc.x;
            hen4_mc.y=holder4_mc.y;
    hen5_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop5);
    function dragStop5 (event:MouseEvent):void
        hen5_mc.stopDrag();
        if(hen5_mc.hitTestObject (holder5_mc)==true)
            hen5_mc.x=holder5_mc.x;
            hen5_mc.y=holder5_mc.y;
    hen6_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop6);
    function dragStop6 (event:MouseEvent):void
        hen6_mc.stopDrag();
        if(hen6_mc.hitTestObject (holder6_mc)==true)
            hen6_mc.x=holder6_mc.x;
            hen6_mc.y=holder6_mc.y;

    Ok so I figured it out, thank you Ned.
    I have made the tick_mc alpha 0 in the beginning of the script and then in my conditional I have made the alpha = 100
    So it works...yay!
    Now all I have left, if the piece is placed in the wrong holder then it needs to go back into its orignal position.
    I have tried
    Written above the script
    var startX:Number;
    var startY:Number;
    then just below my dragStart code
    startX = event.target.x = startX;
    startY = event.target.y = startY;
    then after each if statement I placed an else statement
    else
          hen1_mc.x = startX;
          hen1_mc.y = startY;
    Its clearly not working, please could you tell me what I am doing wrong?
    thank you

  • Drag and Drop with snap and response

    Ok, first of all I'm new to all of this as I'm just doing some parttime work. I'm trying to make a drag and drop game where the images (imported and made into movie clips with instance names "peg1 - peg7") are to be dragged onto targets (images, made into movie clips with instance names "targetpeg1-targetpet7").
    Here's my code and it comes up with two errors -
    ReferenceError: Error #1069: Property parent not found on builtin.as$0.MethodClosure and there is no default value.
    at Gametake1_fla::MainTimeline/fl_ReleaseToDrop()
    Please help!!! Thanks a bunch!
    Amy
    peg1.buttonMode = true;
    peg2.buttonMode = true;
    peg3.buttonMode = true;
    peg3.buttonMode = true;
    peg4.buttonMode = true;
    peg5.buttonMode = true;
    peg6.buttonMode = true;
    peg7.buttonMode = true;
    peg1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg3.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg4.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg5.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg6.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg7.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
    event.currentTarget.startDrag();
    reply_txt.text = "Drag the image to its correct location"
    peg1.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg2.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg3.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg4.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg5.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg6.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg7.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
    event.currentTarget.stopDrag();
    var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName("myTargetName");
    if (event.target.stopDrag != null && event.target.stopDrag.parent == myTarget){
        reply_txt.text = "Good Job!";
    } else {
        reply_txt.text = "Try Again!";
    function checkTarget(drag){
    if (drag.hitTest(targetpeg1)) {
    trace(drag+" has been dropped on greyCircle");
    } else {
    trace("you missed the target");

    use:
    peg1.buttonMode = true;
    peg2.buttonMode = true;
    peg3.buttonMode = true;
    peg3.buttonMode = true;
    peg4.buttonMode = true;
    peg5.buttonMode = true;
    peg6.buttonMode = true;
    peg7.buttonMode = true;
    peg1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg3.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg4.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg5.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg6.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg7.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
    event.currentTarget.startDrag();
    reply_txt.text = "Drag the image to its correct location"
    peg1.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg2.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg3.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg4.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg5.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg6.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg7.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
    event.currentTarget.stopDrag();
    var myTargetName:String = "target" + event.currentTarget.name;
    var myTarget:DisplayObject = getChildByName("myTargetName");
    if (event.currentTarget.dropTarget){
    if(event.currentTarget.dropTarget.parent == myTarget){
        reply_txt.text = "Good Job!";
    } else {
        reply_txt.text = "Try Again!";

  • Drag and Drop with mx.effects.SoundEffect

    I am trying to get a soundeffect to play after a successful
    drag and drop operation. Unfortunately, there is no dragDropEffect,
    so I cannot use mxml for adding sound when a drop is completed.
    (However a sound effect can be used when the user first clicks on
    something before drag occurs by using mouseDownEffect.)
    Below is my code which attempts doing this from one tile to
    another with an image. For debugging purposes I have added an Alert
    to show where the sound effect fails to play. Can anyone see what
    is wrong with my code?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="createSoundEffects();" layout="horizontal">
    <mx:Script>
    <![CDATA[
    import mx.managers.DragManager;
    import mx.core.DragSource;
    import mx.events.DragEvent;
    import mx.effects.SoundEffect;
    import mx.controls.Alert;
    [Embed(source="C:/FLEX_PROJECTS/photos/bin/openWind-Mark_E_B-8076_hifi.mp3")]
    private var soundFxOpenSwoosh:Class;
    [Embed(source="C:/FLEX_PROJECTS/photos/bin/closeWin-Mark_E_B-8077_hifi.mp3")]
    private var soundFxCloseSwoosh:Class;
    private var dropSound:SoundEffect;
    //create the sound effect when first loaded (see
    mx:Application tag) for the creationComplete attribute
    private function createSoundEffects():void {
    dropSound = new SoundEffect();
    dropSound.useDuration = false;
    dropSound.loops = 0;
    dropSound.source = soundFxCloseSwoosh;
    // Drag initiator event handler, called by
    // the image's mouseMove event.
    private function dragMe(event:MouseEvent, img1:Image,
    format:String):void {
    var dragInitiator:Image=Image(event.currentTarget);
    var ds:DragSource = new DragSource();
    ds.addData(img1, format);
    var imageProxy:Image = new Image();
    imageProxy.source = img1.source;
    imageProxy.height = img1.height;
    imageProxy.width = img1.width;
    imageProxy.alpha=.8;
    //Call the drag method from the manager
    DragManager.doDrag(dragInitiator, ds, event, imageProxy, 0,
    0, 1.00);
    private function doDragEnter(event:DragEvent):void {
    DragManager.acceptDragDrop(Tile(event.target));
    private function doDragDrop():void {
    dropSound.end(); //see page 569 in flex2_devguide.pdf for
    why .end() is called here
    dropSound.play();
    Alert.show("dropSound.source is:" + dropSound.source);
    ]]>
    </mx:Script>
    <mx:SoundEffect id="dragStartSound" useDuration="false"
    loops="0" source="{soundFxOpenSwoosh}"/>
    <mx:HDividedBox width="100%" height="100%">
    <mx:Tile width="100%" height="100%"
    backgroundColor="#999999">
    <mx:Image id="myimg" mouseDownEffect="{dragStartSound}"
    source=".\2.png" mouseMove="dragMe(event, myimg, 'img');" />
    </mx:Tile>
    <mx:Tile width="100%" height="100%"
    dragEnter="doDragEnter(event)" dragDrop="doDragDrop()"
    backgroundColor="#999999">
    </mx:Tile>
    </mx:HDividedBox>
    </mx:Application>

    Merci beaucoup!!
    it is also posible in AWT ?
    Message was edited by: roshca181
    [email protected]

  • ICal alarm won't "drag and drop" with changed dates?

    I frequently change appointments on my calendar from one date to the next, but the alarm time stays with the original date and time (so it never alarms or chimes on the new appointment date).
    Any ideas on how to get it to change along with my drag and drop. In other calendar systems, if you have an appointment on the 14th with a 15 minute warning alarm, and then change the date to the 17th, the alarm would then chime 15 minutes ahead of your appointment on the 17th. I know I can manually change it, but this should be automatic.
    Help?

    I just set an event for the 24th with a "2 minute before" alarm. I then dragged it to today 11/19 and the alarm went off 2 minutes before the new event time. I.e., the alarm time was automatically updated. Now if the alarm were set with the "on date" option, I wouldn't expect that to be updated. I'm using iCal Version 4.0.3 (1388).

  • Suggestion for a drag and drop schedule calendar from a database?

    Anyone suggest / help with a drag and drop task scheduler/calendar on an hour by hour day by day basis, from a database?
    thanks
    KL

    What parts are you finding inelegantI was a little worried about the possibility of the image lagging behind the mouse pointer. If the application was repainting every time it got a mouse motion event, it might not keep up. And, of course, there is a level-of-effort consideration for the implementation.
    Custom cursors?This was actually my first thought. It would certainly be the easiest solution. I've done custom cursors before, but I was a bit worried about the overhead... Not that I have any specific reason, it's just that the application would be changing cursors quite often and I'm used to thinking of cursors as a special system resource that an application shouldn't mess with... Of course, what was true 20 years ago, is not necessarily true today.
    Does anyone know if this would be an issue? Can I use custom cursors reasonably freely without serious impact on the graphics subsystem?

  • New and need help - drag and drop with dynamic text

    So I'm doing this project and as an animator I'm not familiar with the whole action script side of flash
    Okay so far I've managed to create the whole Drag and Drop feature and it works well, the thing is I want to make it so when you drag in object in the correct spot and new text appears, and I need like six different object with the dynamic text. but I have no idea how to integrated it in my code or where I should start!
    So i based myself on some tutorial so theres some code in there that had dynamic text, but not exactly what i wanted
    Your help would be much appreciated!
    This is my code:
    var counter:Number = 0;
    var startX:Number;
    var startY:Number;
    six_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    six_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    five_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    five_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    four_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    four_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    three_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    three_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    two_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    two_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    one_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    one_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
    reply_txt.text = "";
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    function dropIt(event:MouseEvent):void {
        event.target.stopDrag();
    var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName(myTargetName);
    if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
        reply_txt.text = "Good Job!";
    event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
    event.target.buttonMode = false;
    event.target.x = myTarget.x;
    event.target.y = myTarget.y;
    } else {
    reply_txt.text = "Try Again!";
    event.target.x = startX;
    event.target.y = startY;
        if(counter == 6){
            reply_txt.text = "Congrats, you're finished!";
    six_mc.buttonMode = true;
    five_mc.buttonMode = true;
    four_mc.buttonMode = true;
    three_mc.buttonMode = true;
    two_mc.buttonMode = true;
    one_mc.buttonMode = true;

    where you have
    xxx.text = ....
    is where you're assigning text.

  • Drag and drop with JPanel

    Hi there,
    I have JPanel which contains label and image icon and i want to drag them out to another panel and droped there.
    Is this really doable with swing.
    Please share your thoughts with me
    Thanks,
    - Prashant

    Thanks Daya,
    but I want something which gives me the feel of drag and drop, Dragging is good with your code but when i do drop and that doesn't fall in desired area, i am expecting that to go back on that's previous locaton.
    - Prashant

  • Drag and Drop with multiple targets

    I'm having a problem find a solution to my drag and drop problem.  Here is what this flash piece is basically supposed to do:
    9 dragable items on the stage
    5 targets, numbers 1 - 5, where the items can be placed
    5 of the 9 dragable items are the correct answer and the user needs to drag them to the correct target, and have to be in order from 1-5. (eg. let's say the instructions are:
    Please place the, in the correct order, the 5 steps to getting ready in the morning
    Drag items                                               Targets
    Brush teeth                                       1.                     
    Change oil in car                                2.                    
    Wash face                                         3.                   
    Put pants on                                      4.                    
    Shower                                              5.                     
    Get out of bed  
    Do tax's
    So far I have it so if you drop the correct answer into its correct target it snaps to it and disable it's eventListeners.  If you drop the drag item on the other targets they snap to it and disable it as well.  They only problem is if the user accidentally drops the item anywheres else on the stage it locks it in place.  Instead I want it to return to the orginal x and y position.  Can anyone help?!?
    Here is my code
    DragDrop.as
    package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.filters.DropShadowFilter;
    public class DragDrop extends MovieClip
      public var _targetPiece:*;
      public function DragDrop()
       this.addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
       this.addEventListener(MouseEvent.MOUSE_UP, dropMovie);
       this.buttonMode = true;
      private function dragMovie(event:MouseEvent):void
       this.startDrag();
       this.filters = [new DropShadowFilter(0.5)];
       this.parent.addChild(this);
      private function dropMovie(event:MouseEvent):void
       this.stopDrag();
       this.filters = [];
      public function disable():void
       this.buttonMode = false;
       this.removeEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
       this.removeEventListener(MouseEvent.MOUSE_UP, dropMovie);
    DragGame.as
    package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import DragDrop;
    import BL;
    import BR;
    import BM;
    import TL;
    import TR;
    import TM;
    import BC;
    import TC;
    import BA;
    public class DragGame extends MovieClip
      private var bl:BL;
      private var br:BR;
      private var bm:BM;
      private var tl:TL;
      private var tr:TR;
      private var tm:TM;
      private var bc:BC;
      private var tc:TC;
      private var ba:BA;
      private var _totalPieces:Number;
      private var _currentPieces:Number;
      private var _submit:Number;
      private var _reveal:Number;
      public function DragGame()
       _totalPieces = 5;
       _currentPieces = 0;
       createPieces();
       _submit = 6;
       _reveal = 1;
      private function createPieces():void
       bl = new BL();
       addChild(bl);
       bl._targetPiece = blt_mc;
       bl.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition1(bl);
       br = new BR();
       addChild(br);
       br._targetPiece = brt_mc;
       br.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition2(br);
       bm = new BM();
       addChild(bm);
       bm._targetPiece = bmt_mc;
       bm.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition3(bm);
       tl = new TL();
       addChild(tl);
       tl._targetPiece = tlt_mc;
       tl.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition4(tl);
       tr = new TR();
       addChild(tr);
       tr._targetPiece = trt_mc;
       tr.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition5(tr);
       tm = new TM();
       addChild(tm);
       tm._targetPiece = tmt_mc;
       tm.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition6(tm);
       bc = new BC();
       addChild(bc);
       bc._targetPiece = trt_mc;
       bc.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition7(bc);
       tc = new TC();
       addChild(tc);
       tc._targetPiece = trt_mc;
       tc.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition8(tc);
       ba = new BA();
       addChild(ba);
       ba._targetPiece = trt_mc;
       ba.addEventListener(MouseEvent.MOUSE_UP, checkTarget);
       piecePosition9(ba);
      private function checkTarget(event:MouseEvent):void
       if(event.currentTarget.hitTestObject(event.currentTarget._targetPiece))
        event.currentTarget.x = event.currentTarget._targetPiece.x;
        event.currentTarget.y = event.currentTarget._targetPiece.y;
        event.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, checkTarget);
        event.currentTarget.disable();
        _currentPieces ++;
        _submit --;
        if(_currentPieces >= _totalPieces)
         wrong_txt.visible = false;
         answer_txt.visible = true;
        if(_submit <= _reveal)
         submit_mc.visible = true;
         submit_mc.buttonMode = true;
       else
        event.currentTarget.x= event.currentTarget.dropTarget.parent.x;
        event.currentTarget.y= event.currentTarget.dropTarget.parent.y;
        event.currentTarget.disable();
        if(_submit <= _reveal)
         submit_mc.visible = true;
         submit_mc.buttonMode = true;
      private function piecePosition1(piece:*):void
       piece.x = 50.2;
       piece.y = 87.2;
       piece._origX = 50.2;
       piece._origY = 87.1;
      private function piecePosition2(piece:*):void
       piece.x = 50.2;
       piece.y = 109.2;
       piece._origX = 50.2;
       piece._origY = 109.2;
      private function piecePosition3(piece:*):void
       piece.x = 50.2;
       piece.y = 131.2;
       piece._origX = 50.2;
       piece._origY = 131.2;
      private function piecePosition4(piece:*):void
       piece.x = 50.2;
       piece.y = 153.3;
       piece._origX = 50.2;
       piece._origY = 153.3;
      private function piecePosition5(piece:*):void
       piece.x = 50.2;
       piece.y = 175.3;
       piece._origX = 50.2;
       piece._origY = 175.3;
      private function piecePosition6(piece:*):void
       piece.x = 50.2;
       piece.y = 197.3;
       piece._origX = 50.2;
       piece._origY = 197.3;
      private function piecePosition7(piece:*):void
       piece.x = 50.2;
       piece.y = 219.4;
       piece._origX = 50.2;
       piece._origY = 219.4;
      private function piecePosition8(piece:*):void
       piece.x = 50.2;
       piece.y = 241.4;
       piece._origX = 50.2;
       piece._origY = 241.4;
      private function piecePosition9(piece:*):void
       piece.x = 50.2;
       piece.y = 263.7;
       piece._origX = 50.2;
       piece._origY = 263.7;

    create an array of your droptargets (eg, droptargetA) and check if the object is dropped on a droptarget.  you don't even need the if-branch of the following if-else unless you do something that depends on whether the correct droptarget is hit.
    function checkTarget(event:MouseEvent):void
       if(event.currentTarget.hitTestObject(event.currentTarget._targetPiece ))
        event.currentTarget.x = event.currentTarget._targetPiece.x;
        event.currentTarget.y = event.currentTarget._targetPiece.y;
        event.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, checkTarget);
        event.currentTarget.disable();
       else
    var x:Number=event.currentTarget.dropTarget._origX;
    var y:Number=event.currentTarget.dropTarget._origY;
    for(var i:uint=0;i<droptargetNum;i++){
        if(event.currentTarget.hitTestObject(droptargetA[i] )){
    x=droptargetA[i].x;
    y=droptargetA[i].y;
    break
    event.currentTarget.x=x;
    event.currentTarget.y=y;

Maybe you are looking for

  • Change in sound quality

    Hello All Having researched previous threads various similar questins have been asked and I have tried all of the fixes including all those suggested on the help pages from Itunes already but still with no joy so I am posting this in the hope that so

  • How do you make a movie clip play in CS4

    Hello, I used Flash MX a long time ago (beginner level) then left it for years. I'm now using CS4 and am stuck. I have a stage with a movie clip placed onto it. I want to create a simple 'click to play' button so that the movie clip only plays on cli

  • Escaping the pipe (|) character in java

    Hi, I am trying to run the following command in java ps -ef -o pid,args | grep init | grep -v grep The code is        try {                 Runtime rt = Runtime.getRuntime();                 Process pr = rt.exec("ps -ef -o pid,args \\| grep init \\|

  • Acquire data from agilent dso 3104 in avraging mode

    Hi. I'm trying to use the Oscilloscope Agilent DSO-X-3104 A with the LabVIEW 2010. My problem it's about read a waveform for a channel, when I had configured the acquire mode on average. I.E. When I use the example code "Read Waveforms (Single).vi" l

  • How can I plug in my headphones with a microphone built-in to my macbook pro?

    I have some new headphones with a built in mic that I want to use to record commentary and also hear out of for making youtube videos. The headphones plug has 3 rings on it, I'm pretty sure this means 4 conductive sections, 2 for each speaker, 1 for