Drag and Drop symbol action issue! Help!

Hi,
I am constructing a risk radar and am looking for an object to change state when put on the middle of a target. And once removed from the middle of the target, to change back to its original state, I so far have this code:
// insert code to be run when the symbol is created here
yepnope({nope:['jquery-ui-1.10.0.custom.min.js','jquery.ui.touch-punch.min.js'], complete: init});
function init(){
          //Use the code! Draggable! Droppable!!
          sym.$('risk1').draggable();
          sym.$('risk2').draggable();
          sym.$('risk3_orange').draggable();
          sym.$('risk4').draggable();
          sym.$('risk5').draggable();
          sym.$('risk6').draggable();
          sym.$('risk7').draggable();
          sym.$('risk8').draggable();
          sym.$('risk9').draggable();
          sym.$('risk10').draggable();
          //Droppable... on the target!
          sym.$('Target').droppable({drop: function() {sym.getSymbol("risk3_orange").play();}});
However, when I remove the object from the middle of the target ('Target') it does not change back and then changes back and forth whenever moved from then on,
Can you help?

Excellent, will give this a try in a sec, slightly running before i can walk, I now have 1 symbols for my target, and tried replicating the same code but chagning the name of the symbols for each one, however, it seems that the first symbol changes the colour of the second one? here is my code:
// insert code to be run when the symbol is created here
yepnope(
{nope:['js/jquery-ui-1.10.0.custom.min.js','js/jquery.ui.touch-punch.min.js', 'js/jquery-ui-1.10.4.custom.min.js'],
complete: init
function init(){
// apply the draggable JQuery UI plugin to the MyDraggableSymbol symbol on your stage
sym.$('risk3_orange').draggable({
start: function(e){},
drag: function(e,ui){sym.getSymbol("risk3_orange").stop("Initial");}
sym.getSymbol("Drop").$('Outer').droppable({
drop: function(event, ui)
sym.getSymbol("risk3_orange").stop("Green");
sym.getSymbol("Drop").$('Middle').droppable({
drop: function(event, ui)
sym.getSymbol("risk3_orange").stop("Blue");
sym.getSymbol("Drop").$('Target').droppable({
drop: function(event, ui)
sym.getSymbol("risk3_orange").stop("Red");
sym.$('Risk2').draggable({
start: function(e){},
drag: function(e,ui){sym.getSymbol("Risk2").stop("Initial2");}
sym.getSymbol("Drop").$('Outer').droppable({
drop: function(event, ui)
sym.getSymbol("Risk2").stop("Green2");
sym.getSymbol("Drop").$('Middle').droppable({
drop: function(event, ui)
sym.getSymbol("Risk2").stop("Blue2");
sym.getSymbol("Drop").$('Target').droppable({
drop: function(event, ui)
sym.getSymbol("Risk2").stop("Red2");
Can you help?

Similar Messages

  • I have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    i have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    Greetings,
    What happens when you drag it?
    Make sure the drive you are moving the files to has enough available space to receive the file:
    Click on the movie file and go to File >  Get Info and note the "size"
    Check the drive to which you are moving the file to make sure it has enough available space: https://idisk.me.com/madisonfile-Public/web/finder-drive-available-space-and-for mat.html
    Also note the format of the drive you are copying too.  If it is not Mac OS Extended or FAT (not recommended unless you are taking it to a windows computer) then that may be the issue.
    Hope that helps.

  • Contain a drag and drop symbol within a specified area.

    I am very green with Adobe Flash but I have a question I was hoping you could walk me through like a child.  I have CS3 using AS2 and need to know how you can confine the area of movement of a drag and drop symbol within a specific area.  I have an rectangular field in which I need items to be able to drag and drop but not outside the field.
    Thanks,
    Soups

    If you look at the startDrag method you will find that it provides the options for specifying the limits of movement...
    startDrag([lockCenter: Boolean], [left: Number], [top: Number], [right: Number], [bottom: Number])
    See the help documents: startDrag in ActionScript 2.0

  • 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 | Text | Submit | PLEASE HELP

    Hi. I really need help.  THANK YOU in advance.
    I am building a voting contact from in flash profession with AS3. The functionality will allow users to drag and drop choices OR add their own allow them to submit their TOP 5 choices.
    PROBLEM:
    1. Drag and drop text is not submitted when it is dragged into the editable text field.
    HOW CAN I DO THIS TO ALLOW FOR DRAG AND DROPPED ITEMS TO BE SUBMITTED or TEXT THAT IS MANUALLY ENTERED.
    This can be seen HERE: http://pttdt.com/winnipegcafes.php
    AS3 Code used thus far:
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_1.buttonMode = true;
    choice_1.mouseChildren = false;
    choice_1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
                choice_1.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
                choice_1.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_2.buttonMode = true;
    choice_2.mouseChildren = false;
    choice_2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);
    function fl_ClickToDrag_2(event:MouseEvent):void
                choice_2.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);
    function fl_ReleaseToDrop_2(event:MouseEvent):void
                choice_2.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_3.buttonMode = true;
    choice_3.mouseChildren = false;
    choice_3.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);
    function fl_ClickToDrag_3(event:MouseEvent):void
                choice_3.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);
    function fl_ReleaseToDrop_3(event:MouseEvent):void
                choice_3.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_4.buttonMode = true;
    choice_4.mouseChildren = false;
    choice_4.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_4);
    function fl_ClickToDrag_4(event:MouseEvent):void
                choice_4.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_4);
    function fl_ReleaseToDrop_4(event:MouseEvent):void
                choice_4.stopDrag();
    /* Drag and Drop
    Makes the specified symbol instance moveable with drag and drop.
    choice_5.buttonMode = true;
    choice_5.mouseChildren = false;
    choice_5.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_5);
    function fl_ClickToDrag_5(event:MouseEvent):void
                choice_5.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_5);
    function fl_ReleaseToDrop_5(event:MouseEvent):void
                choice_5.stopDrag();
    /* Mouse Click Event
    Clicking on the specified 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 clicked.
    send_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
                // Start your custom code
                // This example code displays the words "Mouse clicked" in the Output panel.
                trace(box_1.text);
                trace(box_2.text);
                trace(box_3.text);
                trace(box_4.text);
                trace(box_5.text);
                trace(theName.text);
                trace(theEmail.text);
                // End your custom code
    PLEASE HELP

    It can be fairly involved once you realize how many aspects need to be dealt with.  You'll need to find a tutorial that teaches you how to use drag and drop involving targets so that when you drop something you check if it hit a valid target (textfield in your case) and then process your text into that target.  You should try searching Google using terms like "AS3 drag drop tutorial" and "AS3 dropTarget tutorial"   Here's a link from the latter of the two that has links to tutorials that might help.
    http://forums.adobe.com/post!reply.jspa?message=3462293

  • Drag and Drop Image Sequence Issue

    Hello,
    Im having trouble dragging and dropping an image sequence folder. The folder drags in perfectly and the window even highlights but nothing happens. However when I go through FILE and IMPORT i do have success bringing in the image sequence as comp.

    > Is there anyplace to go to find known bugs with the program incase something like this arises in the future?
    We often post solutions to known issues on the Technical Support part of our site.
    I'll go ahead and write up a quick list of known issues in After Effects CC (12.2) with workarounds.
    Regarding the update that we thought we'd be releasing this week: We ran into a problem in which one of our fixes broke something else (which is why we do the testing), and we're having to redo some things. My current estimate is that the update will not come out this week but will come out some time within the next couple of weeks. Sorry for the delay, but we need to get this right more than we need to get it out fast.
    I'll post a summary of workarounds tomorrow to bridge the time between now and when the update is released.

  • How do I drag and drop an action onto a task flow?

    In How to pass View Object bind variable from ADF page John states that
    You should also consider dragging-and-dropping the executeWithParams operation on your task flow and wiring it to occur before your page instead of putting it in the page definition of the page itself - this way it is more clear what is happening, and is the recommended approach for 11g apps. When you drag-and-drop the operation, you can use the dialog to bind the parameter to your page-flow-scoped variable by supplying the proper EL there.
    How can I drag and drop the executeWithParams method onto a task flow. I am using 11.1.1.5.0 on LINUX?
    I'm presuming I a need a method action in my page flow.
    I have the following action defined in my page def file:
    <action IterBinding="localizedCustomerHierarchyViewIterator"
    id="executeQueryWithParamsForLocalizedCustomerHierarchyView"
    InstanceName="BusinessRulesAMDataControl.LocalizedCustomerHierarchyView"
    DataControl="BusinessRulesAMDataControl" RequiresUpdateModel="true"
    Action="executeWithParams">
    <NamedData NDName="RootEntityId"
    NDValue="#{pageFlowScope.recommendationRule.customerEntityId"
    NDType="java.lang.Long" NDOption="3"/>
    <NamedData NDName="Language"
    NDValue="#{pageFlowScope.recommendationRule.language}"
    NDType="java.lang.String" NDOption="3"/>
    </action>

    In summary, it appears you need the following artifacts in order to initialize a view object from parameters before rendering a .jsff view that relies on that view
    1) a method-call in task flow.xml file:
    <method-call id="executeWithParamsLocalizedCustomerHierarchyView">
    <method id="__5">#{bindings.executeWithParamsLocalizedCustomerHierarchyView.execute}</method>
    <outcome id="__12">
    <fixed-outcome id="__9">initializedLocalizedCustomerHierarchy</fixed-outcome>
    </outcome>
    </method-call>
    2) a control flow rule in the task flow .xml file whose source is (1) and whose destination is the view for which you want to intiialize a view object that supports an iterator that is bound to a list, tree, etc.
    3) an entry for the execute action in the databindings.cpx file
    <page path="/WEB-INF/[email protected]calizedCustomerHierarchyView"
    usageId="oracle_apps_br_view_RecommendationRulePFPageDef"/>
    4) the page def must be defined in the databindings.cpx file
    5) the page def needs to define action and iterator and list (or otherwise) that is used in UI.
    <iterator id="localizedCustomerHierarchyViewIterator"
    Binds="LocalizedCustomerHierarchyView"
    DataControl="BusinessRulesAMDataControl" RangeSize="25" Refresh="never">
    <sortCriteria>
    <sort attribute="Level" ascending="true"/>
    </sortCriteria>
    </iterator>
    <action IterBinding="localizedCustomerHierarchyViewIterator"
    id="executeWithParamsLocalizedCustomerHierarchyView"
    InstanceName="BusinessRulesAMDataControl.LocalizedCustomerHierarchyView"
    DataControl="BusinessRulesAMDataControl" RequiresUpdateModel="true"
    Action="executeWithParams">
    <NamedData NDName="RootEntityId"
    NDValue="#{pageFlowScope.recommendationRule.customerEntityId}"
    NDType="java.lang.Long"/>
    <NamedData NDName="Language"
    NDValue="#{pageFlowScope.recommendationRule.language}"
    NDType="java.lang.String"/>
    </action>
    <list ListOperMode="navigation"
    IterBinding="localizedCustomerHierarchyViewIterator"
    id="customerLocalizedEntityHierarchyList">
    <AttrNames>
    <Item Value="EntityName"/>
    </AttrNames>
    </list>
    6) a backing bean that provides the functions to initialize the parameters for execution
    The easiest way to get most of this is to drag the ExecuteWithParams from within the view in the datacontrols panel right onto the task flow diagram. The downside is that you are left with some pretty poorly named artifacts...
    Did I miss anything?
    -Klaus
    Edited by: klaus gross on Sep 29, 2011 1:00 PM

  • Drag and Drop Multiple attachments issue

    I'm having trouble with Mail - when I receive an email with multiple attachments, I like to drag and drop them into the folder short cuts that appear on the left of the finder windows. When I go to that folder later on the attachments aren't there, but their is a text file. The text file name is "yyyy". The number of "y" characters corresponds the number of attachments that I drag their. Has any one had this trouble before. I have done a total reinstall of the system on to a clean hard drive, and it is still happening. The G5 Dual 2.3 was new in Dec 05.
    (this is my first posting, so please be patient if I'm not doing this correctly)
    Cheers Andy

    Andy, the safer way would be to press the Save button that is in the header of your email and then select the folder where you want it saved.

  • Drag and drop/duplicate warning issues

    I am finding itunes extremely frustrating at the moment. For some reason its not telling me when I am about to add the same song to my library. I am cleaning up my folders to save space. I am pretty sure that in the past i have been able to selct an album, drag and drop it into my itunes library and if it was already there itunes would warn me. Then i could just delete the album in the knowledge that i have it in my itunes library. I have just drag and dropped the exact same song in to my library 3 times with no warning. Why? Is there a setting that I have missed? I am using itunes 11.1.5. Thank s in advance

    Please provide more details and/or examples.
    Ciao.

  • Since I updated to Maverick I cant "drag and drop" files. Please help

    I have no clue whats going on with this update... I can not move items around on my desktop... nor can I drag n drop files when they need to be!

    I have no clue whats going on with this update... I can not move items around on my desktop... nor can I drag n drop files when they need to be!

  • Drag and Drop Symbols

    Hey can alyone help me with this problem,
    I'm making a flash website for a photographer.
    They want a selection of their photos on the screen that the
    user can drag round the webpage (like a pile of photos on a table
    ??) and if they click on it, it enlarges ???
    Any help ?

    Hey can alyone help me with this problem,
    I'm making a flash website for a photographer.
    They want a selection of their photos on the screen that the
    user can drag round the webpage (like a pile of photos on a table
    ??) and if they click on it, it enlarges ???
    Any help ?

  • Drag and Drop in custom components..

    hello friends,
    I am trying to devlop a schedule component. on part of this i trying to develop a functionality where the user can reschedure the appointment by drag and drop.  the dragdrop event in the container component is not triggered when ther user drag the appointment and drop it in the another container. can any one help me on this please. i have given below my source codes.
    Testbox.as
    package layouts.DayViewControl.containers
        import mx.core.Container;
        public class TestBox extends Container
            private var __timeAndXYCoOrdArray:Array;
            private var __xyDiff:int=0;
            public function TestBox()
                super();
                __timeAndXYCoOrdArray=new Array();
            protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
                super.updateDisplayList(unscaledWidth,unscaledHeight);
                var totalSlots:int=24*2;
                var __lineThickness:int=1;
                var __lineAlpha:int=0.2;
                var boxHeight:uint=unscaledHeight/totalSlots;
                graphics.clear();
                var xPos:int=0;
                var ypos:int=0;
                graphics.lineStyle(2,0x000000,0.5);
                graphics.drawRect(0,0,unscaledWidth,unscaledHeight);
                var __boxHeight:int=unscaledHeight/totalSlots;
                var __minusCount:int=1;
                for(var i:int=0;i<totalSlots;i++){
                    var timeStr:String="";
                    if(i%2 == 0){
                        __lineThickness=2;
                        graphics.lineStyle(__lineThickness,0x000000,0.4);               
                    }else{
                        __lineThickness=1;
                        graphics.lineStyle(__lineThickness,0x000000,0.2);   
                    graphics.moveTo(xPos,ypos);
                    var tempYpos:int=ypos;
                    if(__xyDiff == 0){
                        __xyDiff=ypos-xPos;
                    graphics.lineTo(xPos+unscaledWidth,tempYpos);
                    ypos+=boxHeight;
                    var newYPos:int=0;
                    if(i == 0){
                        timeStr="00:00";
                    }else if(i%2 != 0){
                        if(i<=9){
                            timeStr="0"+(i-__minusCount).toString()+":30";
                        }else{
                            timeStr=(i-__minusCount).toString()+":30";                       
                        newYPos=ypos-__xyDiff;
                    }else if(i%2 == 0){
                        if(i<=9){
                            timeStr="0"+(i-__minusCount).toString()+":00";
                        }else{
                            timeStr=(i-__minusCount).toString()+":00";                       
                        __minusCount+=1;
                        newYPos=ypos-__xyDiff;
                    __timeAndXYCoOrdArray.push({XPos:xPos,YPos:newYPos,Time:timeStr});
            public function getXFromtime(inputTime:String):int{
                var returnVal:int=0;
                if(inputTime && inputTime != ""){
                    for (var j:int=0;j<__timeAndXYCoOrdArray.length;j++){
                        if(__timeAndXYCoOrdArray[j].Time.toString() == inputTime){
                            returnVal=parseInt(__timeAndXYCoOrdArray[j].XPos)
                            break;
                return returnVal;
            public function getYFromtime(inputTime:String):int{
                var returnVal:int=0;
                if(inputTime && inputTime != ""){
                    for (var j:int=0;j<__timeAndXYCoOrdArray.length;j++){
                        if(__timeAndXYCoOrdArray[j].Time.toString() == inputTime){
                            returnVal=parseInt(__timeAndXYCoOrdArray[j].YPos)
                            break;
                return returnVal;
            public function getTimeDifference():int{
                return __xyDiff;
    TimeDividerLines.as
    package layouts.DayViewControl
        import flash.events.MouseEvent;
        import flash.utils.Dictionary;
        import layouts.DayViewControl.containers.TestBox;
        import mx.collections.ArrayCollection;
        import mx.core.DragSource;
        import mx.core.EventPriority;
        import mx.core.UIComponent;
        import mx.events.DragEvent;
        import mx.managers.DragManager;
        public class TimeDividerLines extends TestBox
            private var __linesPerHour:int=4;
            private var __currentDate:Date;
            private var __timeAndXYCoOrdArray:Array;
            private var __dataComponentArry:Array;
            private var __totalAppointment:int=5;
            private var __xyDiff:int=0;
            private var __apptDataInfoArry:Array;
            private var __dataProviderChanged:Boolean=false;
            private var __reArrangeDataArrayCol:ArrayCollection;
            private var __sortedArrayCollection:ArrayCollection;
            private var __dragDropEnabled:Boolean=false;
            public function TimeDividerLines()
                super();
                //__timeAndXYCoOrdArray=new Array();
                __dataComponentArry=new Array();
                __apptDataInfoArry=new Array();
                __sortedArrayCollection=new ArrayCollection();   
            public function set dragDropEnabled(inputVal:Boolean):void{
                if(inputVal){
                    //set youself for drag and drop event
                    this.addEventListener(DragEvent.DRAG_ENTER,dragEnterEventHandler,false,EventPriority.DEFA ULT_HANDLER);
                    this.addEventListener(DragEvent.DRAG_OVER,dragOverEventHandler,false,EventPriority.DEFAUL T_HANDLER);
                    this.addEventListener(DragEvent.DRAG_DROP,dragDropEventHandler,false,EventPriority.DEFAUL T_HANDLER);
                    this.addEventListener(DragEvent.DRAG_COMPLETE,dropCompleteHandler);               
                }else{
                    this.removeEventListener(DragEvent.DRAG_ENTER,dragEnterEventHandler,false);
                    this.removeEventListener(DragEvent.DRAG_OVER,dragOverEventHandler,false);
                    this.removeEventListener(DragEvent.DRAG_DROP,dragDropEventHandler,false);               
                __dragDropEnabled=inputVal;
            private function dropCompleteHandler(event:DragEvent):void{
                trace("inside drop complete handler");
            private function dragEnterEventHandler(event:DragEvent):void{
                if(event.dragSource.hasFormat("Appointment")){
                    var dropTarget:UIComponent=UIComponent(event.currentTarget);
                    DragManager.acceptDragDrop(dropTarget);           
                    DragManager.showFeedback(event.ctrlKey ? DragManager.COPY : DragManager.MOVE);   
                    return;
                DragManager.showFeedback(DragManager.NONE);
            private function dragOverEventHandler(event:DragEvent):void{
                /* if(event.dragSource.hasFormat("Appointment")){
                    if(event.ctrlKey){
                        DragManager.showFeedback(DragManager.COPY);
                        return
                    }else{
                        DragManager.showFeedback(DragManager.MOVE);
                        return
                DragManager.showFeedback(DragManager.NONE); */
            private function dragDropEventHandler(event:DragEvent):void{
                //We need to do two things here. you need to add the dropped data to the data provider list.
                //and need need to update this entry to DB
                 /* if(event.dragSource.hasFormat("Appointment")){
                     var draggedbox:AppointmentDisplayBox=event.dragSource.dataForFormat("Appointment") as AppointmentDisplayBox;
                     var dropBox:TimeDividerLines=event.currentTarget as TimeDividerLines;
                     //create a new copy
                     var newBox:AppointmentDisplayBox=new AppointmentDisplayBox();
                     newBox=draggedbox;
                     newBox.x=dropBox.mouseX;
                     newBox.y=dropBox.mouseY;
                     this.addChild(newBox);
                 trace("11111111111111111111111111111111111111111")
            private function mouseDownHandler(event:MouseEvent):void{
                var draginit:AppointmentDisplayBox=AppointmentDisplayBox(event.currentTarget);
                var ds:DragSource=new DragSource();
                ds.addData(draginit,"Appointment");
                DragManager.doDrag(draginit,ds,event);
            override protected function createChildren():void{
                super.createChildren();
            override protected function commitProperties():void{
                 if(__dataProviderChanged){
                     __dataComponentArry=new Array();
                    for (var k:int=0;k<__apptDataInfoArry.length;k++){
                        var tempDispBox:AppointmentDisplayBox=new AppointmentDisplayBox();
                        tempDispBox.currentDate=this.currentDate;
                        tempDispBox.startTime=__apptDataInfoArry[k].StartTime.toString();
                        tempDispBox.endTime=__apptDataInfoArry[k].EndTime.toString();
                        tempDispBox.apptDataXml=__apptDataInfoArry[k].Data as XML;       
                        tempDispBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler);           
                        this.addChild(tempDispBox);
                        __dataComponentArry.push(tempDispBox);
                    __dataProviderChanged=false;
            private function sortTheCollectionValues(__inputArrayCol:ArrayCollection):ArrayCollection{
                var returnArrayCollection:ArrayCollection=new ArrayCollection();
                var tempArray:Array=new Array();
                for(var i:int=0;i<__inputArrayCol.length;i++){
                    tempArray.push({Length:(__inputArrayCol[i] as Array).length,Index:i});
                tempArray.sortOn("Length",Array.DESCENDING|Array.NUMERIC);
                for(var j:int=0;j<tempArray.length;j++){
                    returnArrayCollection.addItem(__inputArrayCol[tempArray[j].Index]);
                return returnArrayCollection;
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
                super.updateDisplayList(unscaledWidth,unscaledHeight);
                if(__dataComponentArry.length > 0){
                    __sortedArrayCollection=new ArrayCollection();
                    sortArray(__dataComponentArry);
                if(__sortedArrayCollection.length > 0 ){
                    //you need to sort the arraycollection based on the length first to draw the highest no. child array first
                    __sortedArrayCollection=sortTheCollectionValues(__sortedArrayCollection);
                    var appGap:int=2;
                    var endGap:int=10;
                    //var drawnApptObj:Array=new Array();
                    var existingChildArray:Array=new Array();   
                    var drawnApptObj:Dictionary=new Dictionary();
                    for(var l:int=0;l<__sortedArrayCollection.length;l++){
                        var apptWidth:int=0;
                        var innerArry:Array=__sortedArrayCollection[l] as Array;
                        existingChildArray=new Array();
                        //you need to recalculate the width
                        //for the first iteration you need to sort by height
                        //if(l == 0){
                        //    innerArry.sortOn("apptHeight",Array.NUMERIC|Array.DESCENDING);
                        //}else{
                            innerArry.sortOn(["isChild","apptHeight"],Array.NUMERIC|Array.DESCENDING);   
                        //innerArry.sortOn("apptHeight",Array.NUMERIC|Array.DESCENDING);
                        //first we need to find out any intersection appointment is there
                        var count:int=0;
                         for each(var tempApptDispBox:AppointmentDisplayBox in innerArry){
                            if(drawnApptObj[tempApptDispBox] == tempApptDispBox){
                                if(apptWidth < tempApptDispBox.width){
                                    apptWidth=tempApptDispBox.width;
                                    existingChildArray.push({index:count,object:tempApptDispBox});
                            count++;
                        if(apptWidth == 0){
                            apptWidth=(unscaledWidth - (endGap + (appGap*innerArry.length)))/innerArry.length;
                        //now you need to layout the childrens
                        var canDraw:Boolean=false;
                        var ismatch:Boolean=false;
                        for (var childCnt:int=0;childCnt < innerArry.length;childCnt++){
                             var tempDispBox:AppointmentDisplayBox=innerArry[childCnt] as AppointmentDisplayBox;
                             for (var i:int=0;i<existingChildArray.length;i++){
                                 if(existingChildArray[i].index == childCnt){
                                     ismatch=true;
                                     break;
                            if(childCnt == 0 && !ismatch){
                                tempDispBox.x=this.getXFromtime(tempDispBox.startTime.toString())+2;
                                canDraw=true;
                            }else if(existingChildArray.indexOf(childCnt) > -1 && childCnt != 0){
                                //tempDispBox.x=(existingChildArray[childCnt] as AppointmentDisplayBox).x+apptWidth+appGap;
                                canDraw=false;
                            }else if(childCnt != 0 && !ismatch){
                                tempDispBox.x=((existingChildArray[childCnt-1].object) as AppointmentDisplayBox).x+apptWidth+appGap;
                                canDraw=true;
                            if(canDraw){
                                tempDispBox.y=this.getYFromtime(tempDispBox.startTime.toString());   
                                tempDispBox.width=apptWidth;
                                tempDispBox.height=tempDispBox.apptHeight-2;
                                if(tempDispBox.isChild){
                                    drawnApptObj[tempDispBox]=tempDispBox;
                                existingChildArray.push({index:childCnt,object:tempDispBox});
                            canDraw=false;
                            ismatch=false;
                //first we need to sort the component array based on the height property to position the biggest appointment first
            private function sortArray(tempArry:Array):void{
                //var tempArry:Array=arrayClone(__datacompArray);
                 for(var i:int=0;i<tempArry.length;i++){
                     var tempDispBox:AppointmentDisplayBox=tempArry[i] as AppointmentDisplayBox;
                    var start:int=this.getYFromtime(tempDispBox.startTime.toString());
                    var end:int=this.getYFromtime(tempDispBox.endTime.toString());
                    tempDispBox.apptHeight=end-start;
                var indexArray:Array=new Array();
                var canContinue:Boolean=false;
                var loopArray:Array=new Array();
                loopArray=tempArry.concat(); // this will copy the array to loopArray
                var copyArry:Array=new Array();
                var k:int=0;
                while(k<loopArray.length){
                    loopArray.sortOn("apptHeight",Array.NUMERIC|Array.DESCENDING);
                    if(indexArray.length > 0){
                        if(indexArray.indexOf(k) >= 0){
                            canContinue=false;
                        }else{
                            canContinue=true;
                    }else{
                        canContinue=true;
                    if(canContinue){
                        var newArry:Array=new Array();
                        //newArry.push(tempArry[k]);                   
                        for (var innerCnt:int=0;innerCnt<loopArray.length;innerCnt++){
                            var locCanContinue:Boolean=false;
                            if(indexArray.length > 0){
                                if(indexArray.indexOf(innerCnt) >= 0){
                                    locCanContinue=false;
                                }else{
                                    locCanContinue=true;
                            }else{
                                locCanContinue=true;
                            if(locCanContinue && k != innerCnt){
                                var outerstartTime:Number=parseFloat(loopArray[k].startTime.toString().replace(":","."));
                                var outerendtime:Number=parseFloat(loopArray[k].endTime.toString().replace(":","."));
                                var innerStartTime:Number=parseFloat(loopArray[innerCnt].startTime.toString().replace(":","." ));
                                var innerEndtime:Number=parseFloat(loopArray[innerCnt].endTime.toString().replace(":","."));
                                if(outerstartTime == innerStartTime && outerendtime == innerEndtime){
                                    //newArry.push(tempArry.splice(innerCnt,1));
                                    newArry.push(loopArray[innerCnt]);
                                    indexArray.push(innerCnt);
                                }else if(outerstartTime == innerStartTime && outerendtime > innerEndtime){
                                    //newArry.push(tempArry.splice(innerCnt,1));
                                    newArry.push(loopArray[innerCnt]);
                                    indexArray.push(innerCnt);
                                }else if(outerstartTime  < innerStartTime && outerendtime == innerEndtime){
                                    //newArry.push(tempArry.splice(innerCnt,1));
                                    newArry.push(loopArray[innerCnt]);
                                    indexArray.push(innerCnt);
                                }else if(outerstartTime  < innerStartTime && outerendtime > innerEndtime){
                                    //newArry.push(tempArry.splice(innerCnt,1));
                                    newArry.push(loopArray[innerCnt]);
                                    indexArray.push(innerCnt);
                                }else if(outerstartTime > innerStartTime && outerendtime > innerEndtime && innerEndtime > outerstartTime){
                                    //newArry.push(tempArry.splice(innerCnt,1));
                                    newArry.push(loopArray[innerCnt]);
                                    loopArray[innerCnt].isChild=true;
                                    //indexArray.push(innerCnt);
                                }else if(outerstartTime < innerStartTime && outerendtime < innerEndtime && innerStartTime < outerendtime){
                                    //newArry.push(tempArry.splice(innerCnt,1));
                                    newArry.push(loopArray[innerCnt]);
                                    loopArray[innerCnt].isChild=true;
                                    //indexArray.push(innerCnt);
                                }else if(outerstartTime == innerStartTime && outerendtime < innerEndtime){
                                    newArry.push(loopArray[innerCnt]);
                                    loopArray[innerCnt].isChild=true;
                                }else if(outerstartTime > innerStartTime && outerendtime == innerEndtime){
                                    newArry.push(loopArray[innerCnt]);
                                    loopArray[innerCnt].isChild=true;
                        //newArry.push(tempArry.splice(k,1));
                        indexArray.push(k);
                        newArry.push(loopArray[k]);
                        __sortedArrayCollection.addItem(newArry);                   
                    copyArry=loopArray.concat();
                    loopArray=new Array();
                    for (var j:int=0;j<copyArry.length;j++){
                        if(indexArray.indexOf(j) < 0){
                            loopArray.push(copyArry[j]);
                    indexArray=new Array();               
            private function arrayClone(source:Array):Array{
                var returnArray:Array=new Array();
                for(var j:int=0;j<source.length;j++){
                    returnArray.push(source[j]);
                return returnArray;
            public function set currentDate(inputVal:Date):void{
                if(__currentDate != inputVal){
                    __currentDate=inputVal;
            public function get currentDate():Date{
                return __currentDate;
            public function set apptDataArray(inputVal:Array):void{
                if(!__dataProviderChanged && inputVal.length > 0){
                    __apptDataInfoArry=inputVal;
                    __dataProviderChanged=true;
                    invalidateProperties();
                    invalidateDisplayList();
    AppointmentDisplayBox.as
    package layouts.DayViewControl
        import mx.controls.TextInput;
        import mx.core.UIComponent;
        public class AppointmentDisplayBox extends UIComponent
            private var __startTime:String;
            private var __EndTime:String;
            private var __currentDate:Date;
            private var __apptData:XML;
            private var __height:Number;
            private var __isChild:Boolean=false;
            private var __modifiedWidth:Boolean=false;
            private var __docNameLable:TextInput;
            private var __appDetails:TextInput;
            public function AppointmentDisplayBox()
                super();
                this.setStyle("horizontalScrollPolicy","off");
                this.setStyle("verticalScrollPolicy","off");
                this.setStyle("borderStyle","solid");
                this.setStyle("verticalGap","0");
                this.setStyle("borderStyle","outset");       
                this.buttonMode=true;           
            protected override function createChildren():void{
                super.createChildren();
                if(!__docNameLable){
                    __docNameLable=new TextInput();
                    __docNameLable.editable=false;
                    __docNameLable.setStyle("horizontalScrollPolicy","off");
                    __docNameLable.setStyle("verticalScrollPolicy","off");
                    __docNameLable.setStyle("borderStyle","none");
                    //__docNameLable.setStyle("borderThickness","0");
                    __docNameLable.buttonMode=true;
                    addChild(__docNameLable);
                if(!__appDetails){
                    __appDetails=new TextInput();
                    __appDetails.editable=false;   
                    __appDetails.setStyle("horizontalScrollPolicy","off");
                    __appDetails.setStyle("verticalScrollPolicy","off");
                    __appDetails.setStyle("borderStyle","none");
                     __appDetails.setStyle("backgroundColor","0xB1FB17");
                     __appDetails.buttonMode=true;
                //    __appDetails.setStyle("borderThickness","0");
                    addChild(__appDetails);
            protected override function commitProperties():void{
                super.commitProperties();
                 if(__apptData != null){
                    __docNameLable.text=__apptData.DocName.toString();
                    __appDetails.text=__apptData.PatientID.toString()+"\n"+__apptData.Description.toString();                
                    invalidateDisplayList();
            protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
                super.updateDisplayList(unscaledWidth,unscaledHeight);
                __docNameLable.setActualSize(unscaledWidth-1,20);
                __docNameLable.move(1,1);
                graphics.clear();
                var lineColor:uint=0x000000;
                graphics.lineStyle(1,lineColor,1);
                graphics.beginFill(0xFEFDFD,1)
                graphics.drawRect(0,0,unscaledWidth,22);
                graphics.endFill();
                __appDetails.setActualSize(unscaledWidth-1,unscaledHeight-22);
                __appDetails.move(1,23);
                graphics.drawRect(0,22,unscaledWidth,unscaledHeight-20);
            public function set startTime(inputVal:String):void{
                __startTime=inputVal;
            public function get startTime():String{
                return __startTime;
            public function set endTime(inputVal:String):void{
                __EndTime=inputVal;
            public function get endTime():String{
                return __EndTime;
            public function set currentDate(inputVal:Date):void{
                __currentDate=inputVal;
            public function get currentDate():Date{
                return __currentDate;
            public function set apptHeight(inputVal:Number):void{
                __height=inputVal;
            public function get apptHeight():Number{
                return __height;
            public function set isChild(inputVal:Boolean):void{
                __isChild=inputVal;
            public function get isChild():Boolean{
                return __isChild;
            public function set isModifiedWidth(inputVal:Boolean):void{
                __modifiedWidth=inputVal;
            public function get isModifiedWidth():Boolean{
                return __modifiedWidth;
            public function set apptDataXml(inputVal:XML):void{
                if(__apptData != inputVal){
                    __apptData=inputVal;
                    invalidateProperties();
                    invalidateDisplayList();
            public function get apptDataXml():XML{
                return __apptData;
    Test.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:layouts="layouts.*"
        xmlns:DayViewControl="layouts.DayViewControl.*" xmlns:test="layouts.DayViewControl.containers.*">
        <mx:Script>
            <![CDATA[
                import mx.controls.TextInput;
                import layouts.DayViewControl.TimeDividerLines;
                import mx.events.DragEvent;
                import mx.managers.DragManager;
                import mx.core.DragSource;
                import layouts.DayViewControl.AppointmentDisplayBox;
                private function mouseDownHandler(event:MouseEvent):void{
                    var dragint:AppointmentDisplayBox=AppointmentDisplayBox(event.currentTarget);
                    //var dragint:TextInput=TextInput(event.currentTarget);
                    var ds:DragSource=new DragSource();
                    ds.addData(dragint,"Appoitment");
                    DragManager.doDrag(dragint,ds,event);               
                private function dragEnterHandler(event:DragEvent):void{
                    if(event.dragSource.hasFormat("Appoitment")){
                        var droptarget:TimeDividerLines=TimeDividerLines(event.currentTarget);
                        DragManager.acceptDragDrop(droptarget);
                        DragManager.showFeedback(event.ctrlKey?DragManager.COPY:DragManager.MOVE);
                        return;
                    DragManager.showFeedback(DragManager.NONE);
                private function dragDropHandler(event:DragEvent):void{
                    if(event.dragSource.hasFormat("Appoitment")){
                        var droppedObj:AppointmentDisplayBox=AppointmentDisplayBox(event.dragSource.dataForFormat("Ap poitment"));
                        //var droppedObj:TextInput=TextInput(event.dragSource.dataForFormat("Appoitment"));
                        var dropTarget:TimeDividerLines=TimeDividerLines(event.currentTarget);
                        droppedObj.x=dropTarget.mouseX;
                        droppedObj.y=dropTarget.mouseY;
                        dropTarget.addChild(droppedObj);
            ]]>
        </mx:Script>
        <mx:HBox width="100%" height="100%">
            <DayViewControl:TimeDividerLines width="50%" height="100%">
                <DayViewControl:AppointmentDisplayBox width="50" height="100" mouseDown="mouseDownHandler(event)"/>
            </DayViewControl:TimeDividerLines>
            <DayViewControl:TimeDividerLines width="50%" height="100%" dragEnter="dragEnterHandler(event)" dragDrop="dragDropHandler(event)"/>
        </mx:HBox>
    </mx:Application>

    First 3 .as are the component
    source. in the last test.mxml file i have written the drag and drop functionality.
    can any help me?? please

  • Drag and Drop FileBrowse​r

    I would like to select files from a FileBrowser Tree window (filebrowser.fp) by the Drag -n- Drop method in my GUI. I want to drag a file in the filebrowser, to pull it over a Textbox, and to drop it, so the path and/or the filename appears in the Textbox. I found only one example for 'drag and drop', but it doesnt help, it shows me how to drag-and-drop inside a Tree box, with child items, and so on. (I cannot implement what I saw there due to I am still quite a beginner in LabWin.)
    Could somebody give me a short example how to manage this, or a link with an example?
    Thank you very much,
    best regards,
    András B-D.

    Sorry
    ABD

  • Compare time slot in dates while making drag and drop..

    Hi,
    The drag and drop is working fine without conditions, but I have to check the time slots between two dates. If the time of both date are same it should not dropped else it can drag and drop. I use the code below, but not getting executed according to condition.. Please provide suggestion and ideas to get it executed..
    declare
    l_date_value varchar2(150) := apex_application.g_x01;
    l_primary_key_value varchar2(150) := apex_application.g_x02;
    l_full_time varchar2(150);
    l_time_a varchar2(150);
    l_time_b varchar2(150);
    begin
    select
    ltrim(replace(to_char(resv_start_date,'hhmiAM'),'00',' '),'0')||','|| ltrim(replace(to_char(l_date_value ,'hhmiAM'),'00',' '),'0')
    into l_full_time
    from reservation
    where resv_no=l_primary_key_value;
    select SUBSTR(l_full_time, 1 ,INSTR(l_full_time, ',', 1, 1)-1) into l_time_a from dual;
    select SUBSTR(l_full_time, INSTR(l_full_time,',', 1, 1)+1)into l_time_b from dual;
    begin
    if l_time_a<> l_time_b then
    update reservation set RESV_START_DATE = to_date(l_date_value,'RRRRMMDDHH24MISS') where Resv_no= l_primary_key_value;
    end if;
    exception when others then
    Raise_application_error(-20001,'Error'||SQLERRM);
    end;
    end;
    Thanks..

    First 3 .as are the component
    source. in the last test.mxml file i have written the drag and drop functionality.
    can any help me?? please

  • Drag and drop issue, please help.

    I can no longer drag and drop photos within photoshop elements 12.  When working with a layer, I want to move it to a layer within another existing file, and no longer have the option.  The only way I have fixed the issue in the past is uninstall and reinstall the program.  I've read other forum posts and followed the instructions by resetting preferences and it does not work.
    Does anyone have any solutions to this issue?  Please help!

    With both files open, simplest to tile them side by side, you should be able to drag the layer from the source file onto the target file. So long as it shows the 'grasping hand' you can release the mouse and it should add the layer to the target.
    So what is happening now on your system? When you drag the layer to the target what icon is shown - 'grasping hand', 'no entry', something else?
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

Maybe you are looking for