Thanks Tim,

I have also just done with migration, i am done with requird changes, 
but i have one more problem, i am tring to drage a list item to tree 
but could not, Tree component is not throwing dragdrop event in this 
case.

I am putting a sample code below, please let me know what i need to 
do to make this functional.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="horizontal" 
        applicationComplete="init()" 
        headerHeight="30" xmlns:comp="comp.*">
        <mx:Script>
                <![CDATA[
                        
                        import mx.collections.IList;
                        import mx.controls.Alert;
                        import mx.collections.ArrayCollection;
                        
                        
                        import mx.managers.DragManager;
            import mx.core.DragSource;
            import mx.events.DragEvent;
                        
                        [Bindable]
                        private var listData:ArrayCollection = new 
ArrayCollection([{label:'abc',data:1},{label:'xyz',data:2},
{label:'123',data:2}]);
                        
                        
                        private function init():void{
                                
                                var window:NativeWindow = 
this.stage.nativeWindow;
                                window.maximize();
                                
                                                                
                        }
                        
                        private function onDrageEnter
(event:DragEvent):void{
                                
                                /* event.preventDefault(); */
                                
                                if(event.dragInitiator is Tree){
                                        
                                
        mx.managers.DragManager.showFeedback(DragActions.COPY);
                                        
                                
        mx.managers.DragManager.acceptDragDrop(event.dragInitiator);
                                        
                                }
                                
                        }
                        
                        private function dragDropTreeHandler
(event:DragEvent):void{
                                
                                Alert.show(event.dragInitiator.name)
                                
                                if(event.dragSource.hasFormat
('items')){
                                        
                                        /* event.preventDefault(); */
                                        
                        event.currentTarget.hideDropFeedback(event);
                        
                        var dropTarget:Tree=Tree(event.currentTarget);
                                        
                        var itemsArray:Array = 
event.dragSource.dataForFormat("items") as Array;
                        
                        //Alert.show(event.dragInitiator.name);
                        
                        var tempItem:Object = {label: itemsArray
[0].label, data: itemsArray[0].data};
                                        
                        var dropLoc:int = 
dropTarget.calculateDropIndex(event);
                        
                        IList(dropTarget.dataProvider).addItemAt
(tempItem, dropLoc);
                        
                                }
                                
                        }
                        
                        
                        
                        private function initApp():void {
                targetList.dataProvider = treeDP;
            }

                        
                ]]>
        </mx:Script>
         <mx:XML id="treeDP">
        <node label="Mail">
            <node label="Inbox"/>
            <node label="Personal Folder">
                <node label="Demo"/>
                <node label="Personal"/>
                <node label="Saved Mail"/>
                <node label="bar"/>
            </node>
            <node label="Calendar"/>
            <node label="Sent"/>
            <node label="Trash"/>
        </node>
    </mx:XML>

        <mx:List id="sourceList" dataProvider="{listData}" 
width="100" 
                dragEnter="onDragIn(event)" 
                dropEnabled="false" 
                dragEnabled="true" 
                allowMultipleSelection="true" 
                dragMoveEnabled="false"/>
        
        <mx:Tree dataChange="treeDP"  id="targetList" 
labelField="@label" 
                width="100" 
                dragEnabled="true"
                showRoot="false"
                dragEnter="onDrageEnter(event)"
                dragDrop="dragDropTreeHandler(event)" 
creationComplete="initApp();"/>
                        
        <!--dragEnter="onDragIn(event)"
        dragOver="dragOverHandler(event)"-->
        
</mx:WindowedApplication>


Regards,
Ajay


--- In [email protected], "FineLine" <[EMAIL PROTECTED]> 
wrote:
>
> Hi Ajay, I've just done this migration, and there are indeed a few 
changes,
> but you have to do it because each of these betas expires sometime 
after the
> following release is due. You'll need to do these migration changes 
anyway
> for the final version, so you may as well do them now.
> 
>  
> 
> Your issue with getting a ref to the nativeWindow is because the 
property
> name has changed from stage.window to stage.nativeWindow. If you 
read
> through the release document, you will find most of these things are
> covered. There are a few things that tripped me up, one is that if 
you're
> using a services-config.xml then you must now include port number 
in the
> destination even if it's port 80, and I also has some problems 
relating to
> the way the new layout constraint system has been implemented, so I 
had to
> rethink things there.
> 
>  
> 
> Cheers, Tim
> 
>  
> 
>   _____  
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED]
> On Behalf Of Rob Rusher
> Sent: Saturday, 13 October 2007 12:47 AM
> To: [email protected]
> Subject: Re: [flexcomponents] Re: Flex 3 beta 1 give expire message 
in
> status bar
> 
>  
> 
> You have to migrate your code. You can't stay on Beta 1, you won't 
be able
> to support it in 19 days.
> 
>  
> 
> Bit the bullet now. Besides, the language changes for Flex 3 are 
pretty
> stable now so you shouldn't have big problems like this in the 
future.
> 
>  
> 
> Regards,
> 
>  
> 
> Rob Rusher
> 
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> com
> 
> Adobe Certified AIR and Flex Developer
> 
>  
> 
>  
> 
> On Oct 12, 2007, at 6:52 AM, ajay_22t wrote:
> 
> 
> 
> 
> 
> > It's the same for me too. I don't particularly see this as a 
> problem, after 
> > all it's a beta release and there's little point in staying with 
an 
> old 
> > version if there's a newer update.
> > 
> > Is there a specific reason why you don't want to switch versions?
> > 
> > Paul
> > 
> 
> Paul
> 
> I tried to migrate to flex 3 beta 2 but could not because of error 
i 
> am getting, there are lot of code which was working in beta 1 but 
not 
> in beta 2, like dragging list items, and getting nativeWindow's 
> reference.
> 
> I tried to follow the documentation also but ends up with errors 
> only, i need some time to migrate as my project is pretty heavy.
> 
> ajay
> 
> 
> 
> 
>  
> 
> Regards,
> 
>  
> 
> Rob Rusher
> 
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> com
> 
> Adobe Certified AIR and Flex Developer
>


Reply via email to