<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>drag and drop &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/drag-and-drop/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:08:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>drag and drop &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>DragController updated</title>
		<link>https://blog.sephiroth.it/2006/05/19/dragcontroller-updated/</link>
					<comments>https://blog.sephiroth.it/2006/05/19/dragcontroller-updated/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 19 May 2006 07:00:45 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[tree]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=141</guid>

					<description><![CDATA[Drag Controller along macromedia components
]]></description>
										<content:encoded><![CDATA[<p>Thanks to the hard work of <strong><a href="http://www.zehnet.de">Nicolas Zeh</a></strong> the component I did some time ago (<a href="http://www.sephiroth.it/file_detail.php?id=140">draggable controller</a>) has now lot of changes!</p>
<ul>
<li>a new name: DragController</li>
<li><strong>drag and drop multiple items</strong> at once if multipleSelection is set to true for a component</li>
<li>added the following methods to the DragEvent Object:</li>
<li>evt.checkType</li>
<li>evt.addItem</li>
<li>evt.removeItem</li>
<li>evt.addAndRemoveItem</li>
<li>the methods were renamed to fit Macromedias naming conventions for methods</li>
<li>i lowered the addReference restriction that both components have to be UIComponents. Now only the source has to be an UIComponent and the target suffices to be a MovieClip.</li>
<li>added a veto method for the &#8220;drag_start&#8221; event. So user can decide on this Event if he would like to allow dragging of this specific item.</li>
<li>added an <strong>onDropData</strong> method besides the Event handlers. So you can assign this method directly to a defined target component.</li>
<li>added flags similar to <a href="http://www.sephiroth.it/file_detail.php?id=133">DragAndDropTree</a> component. These are:</li>
<li>DENYDRAGFOLDER (only tree component)</li>
<li>DENYDRAGITEM (only tree component, as i makes no sense for other components)</li>
<li>DENYDROPINTOITEM (only tree component)</li>
<li>DENYDROPINTOFOLDER (only tree component)</li>
<li>DENYDROPINTO (only tree component)</li>
<li>DENYDROPINBETWEEN this option disallows setting a specific target index position and will add the item at the end of the List, DataGrid, Tree</li>
<li>removed some bugs concerning Focus on Component and selectedItems. But i am not sure if there aren&#8217;t some left due to Flash&#8217;s strange Focus mechanisms. (sure, I still haven&#8217;t understood the focus mechnism of MM components)</li>
</ul>
<p>There&#8217;s also a very comprehensive help of the component (just look in the F1 flash help panel)</p>
<ul>
<li><a onclick="window.open('https://blog.sephiroth.it/wp-content/uploads/2006/05/DragController_test.html','dragcontroller','location=yes,resizable=yes,toolbar=yes,status=yes,width=600,height=400,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-200)+'');return false;" rel="nofollow" href="https://blog.sephiroth.it/wp-content/uploads/2006/05/DragController_test.html">See the example</a></li>
<li><a onclick="window.open('https://blog.sephiroth.it/wp-content/uploads/2006/05/DragController_test.html','dragcontroller','location=yes,resizable=yes,toolbar=yes,status=yes,width=600,height=400,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-200)+'');return false;" rel="nofollow" href="https://blog.sephiroth.it/wp-content/uploads/2006/05/DragController_test.html"></a><a href="https://blog.sephiroth.it/wp-content/uploads/2006/05/DragController.zip">Download the mxp component</a></li>
</ul>
<p>[attachments size=large docid=768 force_saveas=&#8221;1&#8243; logged_users=&#8221;0&#8243;]</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/05/19/dragcontroller-updated/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Draggable Controller</title>
		<link>https://blog.sephiroth.it/2005/11/20/draggable-controller/</link>
					<comments>https://blog.sephiroth.it/2005/11/20/draggable-controller/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Sun, 20 Nov 2005 19:12:34 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[opensource]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=116</guid>

					<description><![CDATA[flash draggable controller
]]></description>
										<content:encoded><![CDATA[<p><a href="https://blog.sephiroth.it/wp-content/uploads/2005/11/draggableController.png"><img decoding="async" class="alignleft size-full wp-image-688" title="draggableController" src="https://blog.sephiroth.it/wp-content/uploads/2005/11/draggableController.png" alt="" width="273" height="164" srcset="https://blog.sephiroth.it/wp-content/uploads/2005/11/draggableController.png 273w, https://blog.sephiroth.it/wp-content/uploads/2005/11/draggableController-150x90.png 150w" sizes="(max-width: 273px) 100vw, 273px" /></a>After reading all the comments added on the <a href="http://www.sephiroth.it/file_detail.php?id=133" target="_blank">Drag n&#8217; Drop Tree</a> component made some time ago I spent some time to make a small component which is capable to manage drag and drop between almost all the Macromedia builtins component (such as List, DrataGrid, Tree&#8230;).<br />
It requires Flash 8 to work because I&#8217;m using BitmapData for clone the dragged item (wow, this is incredible easy to do now 🙂 )<br />
You can see a demo here: <a href="https://blog.sephiroth.it/wp-content/uploads/2005/11/DraggableController.html">DraggableController.html</a><br />
This is the code used in the .fla, in order to manage the component events:</p>
<pre class="tutorialCode">/**
Setting up the list of relationship between components
**/
dc.AddReference(this._datagrid_1, this._list_1)
dc.AddReference(this._datagrid_1, this._datagrid_2)
dc.AddReference(this._datagrid_1, this._tree_1)
dc.AddReference(this._datagrid_1, this._datagrid_1)
dc.AddReference(this._list_1, this._list_2)
dc.AddReference(this._list_1, this._text_ctrl_1)
dc.AddReference(this._text_ctrl_2, this._list_2)
dc.AddReference(this._tree_1, this._list_2)
dc.AddReference(this._tree_1, this._text_ctrl_2)
dc.AddReference(this._tree_1, this._text_area_1)
dc.AddReference(this._list_2, this._text_area_1)
/** drag complete listener **/
dc.addEventListener("drag_complete", this)
/**
evt:
- target_component = drop destination component
- source_component = drag n' drop source component
- source_item      = item dragged
- source_index     = selectedIndex of the source component
- target_item      = drop destination item inside target_component
- target_index     = drop destination index
IMPORTANT: once received evt you must Veto() or Skip() the evt itself.
evt.Skip() will simply remove the dragging movieclip
evt.Veto() will move back the dragging item to its source
*/
function drag_complete(evt:Object):Void{
if(evt.target_component == _list_1){
evt.Veto()
} else if(evt.target_component == _datagrid_2 or evt.target_component == _datagrid_1){
evt.source_component.removeItemAt(evt.source_index)
evt.target_component.addItemAt(evt.target_index, evt.source_item)
Selection.setFocus(null)
evt.target_component.selectRow(evt.target_index, false, false)
evt.Skip()
} else if(evt.target_component == _tree_1){
evt.source_component.removeItemAt(evt.source_index)
var node:XMLNode = new XMLNode(1, "node")
node.attributes.label = evt.source_item.title +  "(Cloned)"
node.attributes.data = evt.source_item
evt.target_item.appendChild(node)
evt.Skip()
} else if(evt.target_component == _text_ctrl_1){
evt.source_component.removeItemAt(evt.source_index)
evt.target_component.text = evt.source_item.label
evt.Skip()
} else if(evt.target_component == _list_2 &amp;&amp; evt.source_component == _tree_1){
evt.source_item.removeNode()
evt.source_component.dataProvider = evt.source_component.getDataProvider()
evt.target_component.addItemAt(evt.target_index, evt.source_item.attributes.label)
evt.Skip()
} else if(evt.target_component == _text_area_1 &amp;&amp; evt.source_component == _list_2){
evt.source_component.removeItemAt(evt.source_index)
evt.target_component.text = evt.source_item.label
evt.Skip()
} else if(evt.target_component == _text_area_1 &amp;&amp; evt.source_component == _tree_1){
evt.source_item.removeNode()
evt.source_component.dataProvider = evt.source_component.getDataProvider()
evt.target_component.text = evt.source_item
evt.Skip()
} else {
evt.Veto()
}
}</pre>
<p>The .zip with all the file is available here, if anyone want to test and improve it.</p>
<p>[attachments docid=691 force_saveas=&#8221;1&#8243; logged_users=&#8221;0&#8243;]</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/11/20/draggable-controller/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Drag and Drop Tree component, yet another!</title>
		<link>https://blog.sephiroth.it/2004/12/01/drag-and-drop-tree-component-yet-another/</link>
					<comments>https://blog.sephiroth.it/2004/12/01/drag-and-drop-tree-component-yet-another/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Wed, 01 Dec 2004 23:21:11 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[tree]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=45</guid>

					<description><![CDATA[Yes, this is another drag and drop tree component &#240;&#159;&#153;&#130; It was a log I wanted to extends the built-in Flash mx 2004 Tree component in order to allow drag and drop operations.. but time was always my enemy. I was lucky that i need one for work.. i look around and i founded some &#8230; <a href="https://blog.sephiroth.it/2004/12/01/drag-and-drop-tree-component-yet-another/" class="more-link">Continue reading <span class="screen-reader-text">Drag and Drop Tree component, yet another!</span></a>]]></description>
										<content:encoded><![CDATA[<p>Yes, this is another drag and drop tree component 🙂<br />
It was a log I wanted to extends the built-in Flash mx 2004 Tree component in order to allow drag and drop operations.. but time was always my enemy.<br />
I was lucky that i need one for work.. i look around and i founded some cool other similar components, but i wanted to be able to do it by myself 😉<br />
It just extends the base Tree component and you can set some drag and drop rules, just costants..<br />
for example, i set these costants to be used:</p>
<ul>
<li><strong>TreeDnd.DEFAULT</strong></li>
<li><strong> </strong><strong>TreeDnd.DENYALL</strong></li>
<li><strong></strong><strong>TreeDnd.DENYDRAGFOLDER</strong></li>
<li><strong></strong><strong>TreeDnd.DENYDRAGITEM</strong></li>
<li><strong></strong><strong>TreeDnd.DENYDROPFOLDER</strong></li>
</ul>
<p>they can be used in combinations:<br />
<span style="font-weight: bold;">myDnd.dragRules = TreeDnd.DENYDRAGFOLDER | TreeDnd.DENYDROPITEM</span><br />
in this way you cannot drag a folder, only leaf nodes, and you cannt drop the dragged item into a leaf node, only into a folder or before/after another leaf node&#8230;</p>
<p>[kml_flashembed publishmethod=&#8221;static&#8221; fversion=&#8221;10.0.22&#8243; movie=&#8221;/wp-content/uploads/2004/12/example.swf&#8221; width=&#8221;550&#8243; height=&#8221;400&#8243; targetclass=&#8221;flashmovie&#8221;]</p>
<p><a href="http://adobe.com/go/getflashplayer"><img decoding="async" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
<p>[/kml_flashembed]<br />
Download the component <strong><a href="/2004/12/01/drag-and-drop-tree-component-yet-another/draganddroptree/">here</a></strong>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/12/01/drag-and-drop-tree-component-yet-another/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
