If you remove the [RemoteClass] from the Car.as in this LiveDocs page and then click the button in the application, it still says it is a Car.
This seems counter to the description.
http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_4.html
package
{
?// dragdrop/Car.as
?
?[RemoteClass]
?public class Car extends Object
?{
?// Constructor.
?public function Car()
?{
?super();
?}
?
?// Class properties.
?public var numWheels:int;
?public var model:String;
?public var make:String;
?
?public function get label():String
?{
?return make + '' '' + model;
?}?
?}
}
Forgot the application file:
%26lt;?xml version=''1.0''?%26gt;
%26lt;!-- dragdrop\DandDRemoteClassListUpdated.mxml --%26gt;
%26lt;mx:Application xmlns:mx=''http://www.adobe.com/2006/mxml''
?layout=''absolute'' xmlns=''*''%26gt;
?%26lt;mx:Script%26gt;
?%26lt;![CDATA[
?
?public function changeit():void
?{
?if (list2.dataProvider != null)
?{?
?msg.text += list2.dataProvider[0]
?
?if(list2.dataProvider[0] is Car)
?msg.text += '' Is Car\n'';
?else
?msg.text += '' Is NOT Car\n'';
?}
?}
?]]%26gt;
?%26lt;/mx:Script%26gt;
?%26lt;mx:List id=''list1''
?x=''10'' y=''45''
?width=''160'' height=''120''
?dragEnabled=''true''
?dragMoveEnabled=''true''%26gt;
?%26lt;mx:dataProvider%26gt;
?%26lt;mx:Array%26gt;
?%26lt;Car model=''Camry'' make=''Toyota'' numWheels=''4''/%26gt;
?%26lt;Car model=''Prius'' make=''Toyota'' numWheels=''4''/%26gt;
?%26lt;/mx:Array%26gt;
%26lt;/mx:dataProvider%26gt;
?%26lt;/mx:List%26gt;
?%26lt;mx:List?id=''list2''
?x=''200'' y=''45''
?width=''160'' height=''120''
?dropEnabled=''true''/%26gt;
?
?%26lt;mx:Button label=''Access it as button'' click=''changeit();''/%26gt;
?
?%26lt;mx:TextArea id=''msg''?
?x=''10'' y=''200''
?width=''400'' height=''100''/%26gt;
%26lt;/mx:Application%26gt;
Bump. I'm hoping someone might be able to answer this.
You sure you did a copy and not a move? It will only fail for copy.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui
That's it Alex. The sample code in the LiveDocs page had dragMoveEnabled=''true''.
http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_4.html
Works great not. Thanks so much!
No comments:
Post a Comment