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

Similar Messages

  • Drag and drop row within same table.

    Version 12.1.2
    I am trying to implement drag and drop row within same table, and I am trying to follow this sample from Frank:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/106-reorder-table-rows-1921121.pdf
    But, I am getting this cast exception. The code I have in my dropEvent bean is identical to whats on the sample.
    oracle.jbo.server.ViewRowImpl cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
    ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #1
    Not sure if anything has changed on 12c release, or if I am missing anything.
    Here is my complete code:
    public DnDAction doDnD(DropEvent dropEvent) {
    RichTable table = (RichTable) dropEvent.getDragComponent();
    List dropRowKey = (List) dropEvent.getDropSite();
    if (dropRowKey == null) {
    return DnDAction.NONE;
    Transferable t = dropEvent.getTransferable();
    DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
    RowKeySet rks = t.getData(df);
    Iterator iter = rks.iterator();
    List draggedRowKey = (List) iter.next();
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    Row dragRow = draggeRowNode.getRow();
    JUCtrlHierNodeBinding dropRowObject = (JUCtrlHierNodeBinding) table.getRowData(dropRowKey);
    Row dropRow = dropRowObject.getRow();
    //get the table's ADF JUCtrlHierBinding
    CollectionModel collectionModel = (CollectionModel) table.getValue();
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
    DCIteratorBinding objectsIterator = treeBinding.getDCIteratorBinding();
    RowSetIterator rsi = objectsIterator.getRowSetIterator();
    int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
    dragRow.removeAndRetain();
    rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
    objectsIterator.setCurrentRowIndexInRange(indexOfDropRow);
    AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
    adfctx.addPartialTarget(table.getParent());
    return DnDAction.MOVE;
    It does not seem to like this line of code:
    JUCtrlHierNodeBinding draggeRowNode = (JUCtrlHierNodeBinding) table.getRowData(draggedRowKey);
    I would greatly appreciate any help.
    Thanks.

    Well there has bee a changes somehow. using 12c
    table.getRowData(draggedRowKey);
    returns a ViewRowImpl and no longer anything which can be convertet to JUCtrlHierNodeBinding. Anyway, the fix is easy:
        public DnDAction onDepartmentsRowDrop(DropEvent dropEvent) {
            //get the table instance. This information is later used
            //to determine the tree binding and the iterator binding
            RichTable table = (RichTable) dropEvent.getDragComponent();
            List dropRowKey = (List) dropEvent.getDropSite();
            //if no dropsite then drop area was not a data area
            if (dropRowKey == null) {
                return DnDAction.NONE;
            //The transferable is the payload that contains the dragged row's
            //row key that we use to access the dragged row handle in the ADF
            //iterator binding
            Transferable t = dropEvent.getTransferable();
            //get the row key set of the dragged row. The "rowmove" string is the
            //discriminant defined on the drag source and the collectionDrop target.
            DataFlavor<RowKeySet> df = DataFlavor.getDataFlavor(RowKeySet.class, "rowmove");
            RowKeySet rks = t.getData(df);
            Iterator iter = rks.iterator();
            //for this use case the re-order of rows is one-by-one, which means that the rowKeySet
            //should only contain a single entry. If it contains more then still we only look at a
            //singe (first) row key entry
            List draggedRowKey = (List) iter.next();
            //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
            Object objdrop = table.getRowData(dropRowKey);
            Row dropRow = (Row) objdrop;
            //get the table's ADF JUCtrlHierBinding
            CollectionModel collectionModel = (CollectionModel) table.getValue();
            JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
            //get access to the ADF iterator binding used by the table and the underlying RowSetIterator.
            //The RowSetIterator allows us to remove and re-instert the dragged row
            DCIteratorBinding departmentsIterator = treeBinding.getDCIteratorBinding();
            RowSetIterator rsi = departmentsIterator.getRowSetIterator();
            int indexOfDropRow = rsi.getRangeIndexOf(dropRow);
            //remove dragged row from collection so it can be added back
            dragRow.removeAndRetain();
            rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
            //make row current in ADF iterator.
            departmentsIterator.setCurrentRowIndexInRange(indexOfDropRow);
            //ppr the table
            AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
            //note that the refresh of the table didn't work when refreshing the table
            //so I needed to refresh the container component (af:panelStretchLayout).
            adfctx.addPartialTarget(table.getParent());
            return DnDAction.MOVE;
    does the trick. I changed the line to
    //get access to the oracle.jbo.Row instance represneting this table row
            Object objdragg = table.getRowData(draggedRowKey);
            Row dragRow = (Row) objdragg;
    so you don't need the detour through the JUCtrlHierNodeBinding any longer.
    Timo

  • Why can't I drag and drop songs within my playlist?

    Why can't I drag and drop songs within my playlist?

    Are you automatically updating your iPod?
    Are you talking about dragging and dropping in iTunes?
    ~iBook G4 1.07GHz (Kaiya), with extra 256MB RAM (Mac OS X 10.3.9)~ LaCie 160GB external hard drive~ ~3G 15GB iPod (Nakai)~ ~GiveStarsto users who earn them.~

  • How can I drag and drop lectures within an itunes U album so that they appear in order after syncing with my iphone?

    Whenever I download audio iTunes U lectures, they don't show up in the order in which they were recorded and therefore do not sync in order on my iphone.  There is no sorting option to sort by date recorded.  All I want to do is drag and drop the individual lectures to their proper location so that they will be in order by recording date.  Anyone have the secret?
    Kristy P-S

    This problem started last year when ios 8 was released. I think apple is trying to force users to buy music on iTunes store and that's why it's impossible to sync other music and also that's the reason why they haven't solved this serious problem. That's really disappoints me and i'm angry with apple because i have like 10 gb of music in mp3 and i can't sync music from iTunes to my iPhone.

  • Cannot drag and drop songs within iTunes DJ

    Till iTunes 8.0 i could always drag and drop songs in the Party Jukebox and change change their order.
    Since 8.1 and the iTunes DJ, i can drag the songs... but cannot drop them. If i want a song to be played next, I have to right-click and chose "play next...".
    Also, i do not have the possibility to move (for example) the song #10 to the #5.
    it works on OS X, though...
    Message was edited by: mulo

    Okay...
    I've found the solution in another thread, so i explain the solution again, in case you've only found my post
    Go in iTunes DJ -> Click "Settings" (bottom left) and check OUT "Remote for iPhone / Touch"
    Click ok and... here we go again!

  • Drag and Drop Functionality within the SAP Portal

    Does anyone know if SAP Netweaver Portal 6.0 sp18 supports drag and drop technology.  A good comparison would be Google where a user can drag iViews around and place them where they would like.
    We are trying to build something similar to Google Gadgets with iViews and we would like our users to be able to add, remove, drag, and drop them in the Portal.
    Has anyone done something similar to where I would be able to leverage them for further questions.
    Any help is greatly appreciated.  Thank you.
    Jason

    Hi
    Were you able to find away of using the drag and drop functionality?
    I am wanting to use a similar functionality to Yahoo where people can just drag the iViews they want into the page and saving their personalised settings.  I am unable to find information as to what Portal release supports this functionality and how it works.  Would you be able to help?
    Many thanks
    Jag

  • 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?

  • 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 ?

  • Can't drag and drop in Lilghtroom

    I'm using XP Pro. Duel core. 4 GB ram. Drag and drop works in every other program but not in Lightroom. I know at least one other person with the same problem. Adobe tech support didn't have any idea what to do.
    Any thoughts?
    Thanks

    User Sort Order:
    In the case of
    folders, you should be able to drag and drop files within
    any folder that
    actually contains files. This should be obvious from the fact that the only time the
    User Order option is available on the Sort menu is when you've selected a folder containing files. Anyway, it seems like some of you picked up on the Sort menu thing but didn't join up the remaining dots... Remember, changing the user sort order across folders using drag and drop would involve
    moving the file from one folder to another. It's because moving is very likely not what you wanted that the restriction exists.
    I think a lot of the confusion derives from the fact that Lightroom currently displays the contents of individual subfolders from higher level folders (i.e. flat view). Hopefully this will be resolved if/when we get the option to disable "flat view".
    Collections don't have above restrictions because you're not actually moving the file.
    BTW: there is no need to set the Sort Order before moving the files around
    Drag & Drop:
    The Mac platform allows you to drag files into and out (Import and Export) of the Grid whereas the PC only supports dragging into the Grid (Import only). I'm still not sure why we have that distinction but it's been around from day one.
    Hopefully above helps remove the confusion.

  • ListView drag and drop - tearoff/resort with touch

    I want to use drag and drop internally within a ListView to resort items.
    I figured it out, and it worked well on my development system in the simulator using a mouse, but when I moved it to a tablet for testing, using the touch screen I couldn't get the items in the list to break free when I pulled them horizontally. They would
    bounce a little but I wouldn't tear off and allow me to move them.
    After some testing I happened to try it with the stylus, and using the stylus it tears of and allows me to move items as expected.
    Does anyone know what flag or setting I need to be setting to enable moving ListView items with finger touches?
    Parenthetically it took me a long while to find the right documentation spread over a number of questions, so for the benefit of those that find this message:
    you need to set
    CanReorderItems="True" AllowDrop="True" CanDragItems="True"
    to enable the tearoff resort feature
    to access the Drop event after the user has used tear off so you can record the changes you need to use
    itemListView.AddHandler(Control.DropEvent, new DragEventHandler(itemListView_Drop), true );
    instead of setting the event handler in the xaml

    I think to get your scenario working with touch I only had to make a one-line fix: 
    In ItemsPage.xaml line 86, setting IsSwipeEnabled to True will enable tear off via touch.
    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.isswipeenabled.aspx
    This is specifically needed for touch because with a ScrollViewer (which ListView contains by default) causes panning, but mouse / pen do not.  Thus, this setting turns on special processing to decide whether you're panning the ListView control or trying
    to tear off perpindicular to the control.
    When I created my own repro project from your data,  I didn't get it initially because for a default ListView object, the property is true.
    Hope this helps,
    Matt
    XAML SDET Lead : Input / DirectManipulation / Accessibility

  • How do I set up my drag and drop questionaire to export to a XML file?

    How do I set up my drag and drop questionaire to export to a
    XML file?
    I have a 70 seperate SWF files that pose a question and
    contain a drag and drop rank order response of 1,2,3,4.How do I set
    up a XML file that receives the responses.I don't understand how to
    do the Actionscript
    and get my responses to connect to the XML.Please
    Help!Thanks!
    Here's an example of my XML.
    <assessment>
    <sessionid>ffae926ea290ee93c3f26669c6c04a92</sessionid>
    <request>save_progress</request>
    <question>
    <number>1</number>
    <slot_a>2</slot_a>
    <slot_b>1</slot_b>
    <slot_c>4</slot_c>
    <slot_d>3</slot_d>
    </question>
    <question>
    <number>2</number>
    <slot_a>4</slot_a>
    <slot_b>3</slot_b>
    <slot_c>2</slot_c>
    <slot_d>1</slot_d>
    </question>
    <question>
    <number>3</number>
    <slot_a>1</slot_a>
    <slot_b>2</slot_b>
    <slot_c>3</slot_c>
    <slot_d>4</slot_d>
    </question>
    </assessment>

    Use XML.sendAndLoad.
    http://livedocs.macromedia.com/flash/8/main/00002879.html
    You will need a server script to receive the XML structure
    and it depends on
    the server scripting language how you obtain that data. Then
    you can either
    populate a database or write to a static file or even email
    the XML data
    received from Flash.
    For a basic example, I have two links I use for students in
    my Flash
    courses:
    http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLASP/Ex01/XMLASPEchoEx01_D oc.php
    http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLPHP/EX01/XMLPHPEchoEx01_D oc.php
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "kenpoian" <[email protected]> wrote in
    message
    news:e5i9hp$cs6$[email protected]..
    How do I set up my drag and drop questionaire to export to a
    XML file?
    I have a 70 seperate SWF files that pose a question and
    contain a drag and
    drop rank order response of 1,2,3,4.How do I set up a XML
    file that receives
    the responses.I don't understand how to do the Actionscript
    and get my responses to connect to the XML.Please
    Help!Thanks!
    Here's an example of my XML.
    <assessment>
    <sessionid>ffae926ea290ee93c3f26669c6c04a92</sessionid>
    <request>save_progress</request>
    <question>
    <number>1</number>
    <slot_a>2</slot_a>
    <slot_b>1</slot_b>
    <slot_c>4</slot_c>
    <slot_d>3</slot_d>
    </question>
    <question>
    <number>2</number>
    <slot_a>4</slot_a>
    <slot_b>3</slot_b>
    <slot_c>2</slot_c>
    <slot_d>1</slot_d>
    </question>
    <question>
    <number>3</number>
    <slot_a>1</slot_a>
    <slot_b>2</slot_b>
    <slot_c>3</slot_c>
    <slot_d>4</slot_d>
    </question>
    </assessment>

  • 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.

  • Drag and drop to other desktops doesn't work in Mavericks

    I'm currently experiencing an issue with dragging and dropping files within Mavericks. It seems to work only within one desktop: from one window to another. However, when I want to drag something to another screen/desktop the dragged items become stuck on the other screen. I can only move them again when I go back to the original window I dragged them from.
    It is not practical to drag and drop anything on the same desktop on my (little) 13" MacBook Pro. By the way, this happened after updating to Mavericks.\
    Can anyone help me?
    If you're experiencing the same problem, please click the thumb.

    the splice() method accepts two arguments.  the first is the (start) index of the element(s) you want to remove and the 2nd argument is the number of elements you want to remove.  in your situation, you should be using:
      bubbles.splice(currentIndexArray,1);

  • Drag and Drop Items in Reminders

    I'm disappointed that you can't drag and drop lists in the Reminders app to change the order they appear. Also it's not possible to drag and drop reminders within lists. Any possibility of adding this feature in a future release?

    Go right ahead!

  • Drag and drop songs in order?

    I want to organise the order of songs in a playlist but can't seem to drag and drop anymore since updating?

    I can still drag and drop - from within the playlist.

Maybe you are looking for