Re: [flexcoders] Drag And Drop Tree
Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From: Alex Harui aha...@adobe.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label=Unu/ node label=Doi/ node label=DoiUnu node label=DoiUnuUnu/ node label=DoiUNuDoi/ /node node label=Trei/ /node node label=Spamu/ node label=Sent/ node label=Movable/ /node /mx:XMLList /mx:Application so the code seems to be working when drag and dropping an folder but not when dropping a leaf, I get a new Item with no label. I have searched the archives for something similar and found only the same issue posted twice by 2 different guys and no answers. So I thought I'll have
[flexcoders] Re: WipeLeft in a module with combobox error ??
the stack trace error from the code i posted ArgumentError: Error #2004: One of the parameters is invalid at flash.display::Graphics/drawRoundRect() at mx.skins::ProgrammaticSkin/drawRoundRect()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\skins\ProgrammaticSkin.as:745] at mx.skins.halo::ButtonSkin/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\skins\halo\ButtonSkin.as:217] at mx.skins::ProgrammaticSkin/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\skins\ProgrammaticSkin.as:421] at mx.managers::LayoutManager/validateClient()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:880] at mx.core::UIComponent/validateNow()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5679] at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::validateBaselinePosition()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5715] at mx.controls::ComboBase/get baselinePosition()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\ComboBase.as:313] at mx.containers::FormItem/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\FormItem.as:913] at mx.core::UIComponent/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6351] at mx.core::Container/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2677] at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:695] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Usually a shared code problem. See the modules presentation on my blog. Post the stacktrace from the error. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rockorgames Sent: Sunday, January 18, 2009 5:29 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] WipeLeft in a module with combobox error ?? hey guys.. i have app with a module that has a form and some combobox in it.. also this same module has a removedEffect that is a wipeleft.. when the module is removed it generates a wierd error.. but if i remove the combobox from the module it doesnt generate error... i ll post a simple version of this error.. if some1 has any ideia of why this happens app: ?xml version=1.0 encoding=utf-8? mx:Application creationComplete=init() xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.controls.Alert; import mx.modules.Module; import mx.events.ModuleEvent; import mx.modules.ModuleManager; import mx.modules.IModuleInfo; public var info:IModuleInfo; public var xi:Module; private function init():void { info = ModuleManager.getModule(a.swf?Versao=1.0); info.addEventListener(ModuleEvent.READY, modEventHandler); info.load(); } private function modEventHandler(e:ModuleEvent):void { xi = info.factory.create() as Module ; addChild(xi); } public function remove():void { removeChild(xi); info.removeEventListener(ModuleEvent.READY, modEventHandler); info.unload(); info = null; xi=null; } ]] /mx:Script mx:WipeLeft id=wipeOut duration=600/ mx:Button x=200 y=176 id=lasal label=remove click=remove()/ /mx:Application module a: ?xml version=1.0 encoding=utf-8? mx:Module removedEffect=wipeOut xmlns:com=* xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute width=400 height=300 mx:Script ![CDATA[ [Bindable] private var dptest:Array = [item1, item2]; ]] /mx:Script mx:Form mx:FormItem mx:ComboBox dataProvider={dptest} / /mx:FormItem /mx:Form /mx:Module thx for ur time!!!
Re: [flexcoders] Drag And Drop Tree
Are you using a custom event? And if so, did you implement the clone method? 2009/1/19 claudiu ursica the_bran...@yahoo.com Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu -- *From:* Alex Harui aha...@adobe.com *To:* flexcoders@yahoogroups.com flexcoders@yahoogroups.com *Sent:* Monday, January 19, 2009 7:47:53 AM *Subject:* RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn't work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler *From:* flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] *On Behalf Of *Claudiu Ursica *Sent:* Sunday, January 18, 2009 9:59 AM *To:* flexcod...@yahoogro ups.com *Subject:* [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label=Unu/ node label=Doi/ node label=DoiUnu node label=DoiUnuUnu/ node label=DoiUNuDoi/ /node node label=Trei/ /node node label=Spamu/ node label=Sent/ node label=Movable/ /node /mx:XMLList
Re: [flexcoders] Drag And Drop Tree
No custom event just the usual DragDrop events dispatched by the tree e.g. dragStart, dragOver, dragDrop, dragComplete... Claudiu... From: Sefi Ninio sefi.ni...@gmail.com To: flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 11:25:35 AM Subject: Re: [flexcoders] Drag And Drop Tree Are you using a custom event? And if so, did you implement the clone method? 2009/1/19 claudiu ursica the_braniak@ yahoo.com Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From: Alex Harui aha...@adobe. com To: flexcod...@yahoogro ups.com flexcod...@yahoogro ups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn't work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node label=Unu/ node
[flexcoders] Re: LCDS - adding a new Item using createItem()
I had the same problem and I ended with the following solution: Add an event listener on your collection like this: groups.addEventListener(CollectionEvent.COLLECTION_CHANGE, onDataChanged); In the onDataChanged function, look if the 'kind' property of the event is CollectionEventKind.UPDATE. Then you can find the id with something like that: if (ev.items.length 0) { var pce:PropertyChangeEvent = ev.items[0] as PropertyChangeEvent; var id:Number = pce.currentTarget.id; } Hope it helps, Benjamin. --- In flexcoders@yahoogroups.com, Besite - Bart b...@... wrote: Hello, In my Data Management Service I create a new User-object using the createItem() function : ds.createItem(new User(Jeff)); var token:AsyncToken = ds.commit(); token.kind = create; When the commit is sent, the new User is persisted to the server... In my database an autoincrement id is generated, but the object returned to the Flex client has still an id equal to 0. How do I know the unique id of the created User-object on the client-side ? I need this unique id to do some remote calls as soon as it is created on the server... Any help is welcome ! Kind regards Bart
Re: [flexcoders] flex not seeing method
I don't know if this is related, but there is one problem with the name of the event. The event is downloadresizeevent, while in the meta declaration and the event handler you are calling it DownloadResizeEvent. You will have either to change the event's name with: public static const DOWNLOADRESIZE_EVENT:String = DownloadResizeEvent; or correct how you reference it: snip mx:Metadata [Event(name=downloadresizeevent, type=elib.event.DownloadResizeEvent)] /mx:Metadata snip snip view:componentmxml downloadresizeevent=handler_resize(event)/ //snip Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Sun, Jan 18, 2009 at 6:35 PM, dnk d.k.emailli...@gmail.com wrote: Hi there, I have an mxml component that dispatches an event. Now when i use the component, the meta data is showing up fine. But when i assign a handler, flex says that it is a call to a possibly undefined method. But it is there plain as day. IDeas??? Code snippets below. DownloadResizeEvent.as - pretty stock custom event: package elib.event { import flash.events.Event; public class DownloadResizeEvent extends Event { public static const DOWNLOADRESIZE_EVENT:String = downloadresizeevent; public function DownloadResizeEvent(type:String):void { super(type); } // Override the inherited clone() method. override public function clone():Event { return new DownloadResizeEvent(type); } } } now in my component.mxml: (in a script block) snip import elib.event.*; //snip (in same script block) snip //located in a method dispatchEvent( new Event(DownloadResizeEvent.DOWNLOADRESIZE_EVENT) ); //snip Then later in my mxml snip mx:Metadata [Event(name=DownloadResizeEvent, type=elib.event.DownloadResizeEvent)] /mx:Metadata //snip An now in my other mxml file that has my component.mxml called in it: main.mxml (in my root tag) snip xmlns:view=elib.view.components.* //snip (in a script block) snip import elib.event.*; //snip (in same script block) snip //event handler private function handler_resize(evt:Event):void { } //snip snip view:componentmxml DownloadResizeEvent=handler_resize(event)/ //snip
[flexcoders] Re: tilelist itemrender problem
how do i create an Array Collection of Objects that have a label property and an icon property. after reading something abt the tilelist on bruce philips blog, someone had the same problem and was asked to create an Array Collection of Objects that have a label property and an icon property and use the icon property to load the images.
Re: [flexcoders] Flex drop down horizontal menu
Take a look at the MenuBar control: http://livedocs.adobe.com/flex/3/langref/mx/controls/MenuBar.html Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Mon, Jan 19, 2009 at 12:06 AM, brucewhealton br...@futurewavedesigns.com wrote: Hello all, I was wondering if anyone could share some tutorials on how to create a horizontal menu with drop-down sub-menus. Please let me know if you can think of any good examples with tutorials/script examples for learning, etc. Thanks, Bruce
RE: [flexcoders] NPE on ToolTipManagerImpl/reset()
Hi I am reopening this thread. I am unable to get around this NPE issue. I tried to do the following Set the visibility of ToolTipManager.currentTooltip to false (instead of destroying it) Disable the tooltip when I make a service call and enable it on response. However, I still get the exception stated in my earlier mail below. The exception occurs either on mouseOut or mouseOver tool tip handlers and the trace leads all the way to ToolTipManagerImpl.reset() method. Thanks Regards Ram _ rviswanathan wrote: Thanks Alex. Since the destroyToolTip is public and the doc says not to call it on the currentToolTip, I'd probably think that it is used when we explicitly create and destroy tooltips. About faking the mouse event that you have mentioned, are you meaning that I need to add my own tooltipmouseouthandler and put in my logic in this handler? Thanks Ram Alex Harui wrote: The doc says don't call destroyToolTIp on the current tooltip. I'd search around to see if anyone else has a way of causing a tooltip to go away, but I'd probably do it by faking a mouse event instead of calling an mx_internal method. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rviswanathan Sent: Sunday, November 30, 2008 11:52 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] NPE on ToolTipManagerImpl/reset() Hi All I am facing an NPE with tooltips, the problem is outlined below. Set up: (I use Flex 2.0) I have a UI where I have a datagrid that gets populated by data coming from a remote server call. My module contains a timer that sends out a refresh request (server call) to paint the datagrid with the latest data. This timer fires every 20 seconds. Also, when I point to a datagrid cell, I see the tooltip that shows the content of this cell. This is what I have done to disable and enable tooltips during the server call. a) Prior to makign the server call, I destroy the current tooltip using ToolTipManager.destroyToolTip(). I also set the ToolTipManager.currentToolTip to null. I also make ToolTipManager.enabled as false. b) On getting a response from the server, I set ToolTipManager.enabled as true. Now, here's the problem. I keep my mouse on a cell and a tooltip is displayed. At some time T, the 20 second timer fires that makes a server call. At this very same moment, I move my mouse out of the cell, so the tooltip's mouseouthandler gets called. I get an exception in ToolTipManagerImpl/reset() method. From the trace, it shows an NPE. This happens only when I move the mouse out of a tooltip and a refresh call to the server goes. The lines around getSystemManager(previousTarget) is where I think I hit an exception, probably because the system manager for the previousTarget is null and the next line throws an NPE, although I am not a 100% sure. From ToolTipManagerImpl.reset() method private function reset():void { if (currentToolTip) { // Remove it. var sm:ISystemManager = getSystemManager(previousTarget); sm.toolTipChildren.removeChild(DisplayObject(currentToolTip)); currentToolTip = null; } } Any pointers to overcome this would really help. Thanks Ram -- View this message in context: http://www.nabble.com/NPE-on-ToolTipManagerImpl-reset%28%29-tp20761439p20761439.html Sent from the FlexCoders mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/NPE-on-ToolTipManagerImpl-reset%28%29-tp20761439p21541940.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] debug deep linking
In my flex application, when I click refresh button on the browser, the deep linking doesn't work for some items. I tried to debug the issue, but debug doesn't work for refresh button. Any comments? Thanks Karen
[flexcoders] Writing a Cairngorm ServiceLocator for 'fallback' services
Hi, I'm a Flash developer migrating to Flex and Cairngorm. I want to have my Cairngorm ServiceLocator use AMF Remoting as the first option but then fall back to a SOAP webservice if that fails. Both services have the same methods/operations as they are implemented in ASP.Net with WebOrb. I can define both the Remoting service and the webservice in the Services.mxml file in the usual way and can access both from my delegates and it all works fine. Here's my problem: The Cairngorm examples I have seen all show that the generic getService() method is depreciated and I should use getRemoteObject() or getWebService() from IServiceLocator. Using that approach I could put the logic to decide which service to use into each and every delegate but it would make more sense to have it centralised in the Services.mxml file and have this serve up the currently used service to my delegate. Since they both inherit the same methods, I should be able to call a generic services object using polymorphism and do some good OOP in the process. So here's my question: How would you experienced Cairngorm users out there approach this? - Should I write a new method in my Services.mxml component, which switches between services by binding it to a variable indicating which service type to use in the ModelLocator? - Should I scrap the mxml version and extend ServiceLocator in Actionscript? - Should I abandon this bit of the Cairngorm framework swc interfaces and write this from scratch? - Any other suggestions/warnings? Has anyone done something like this before? Thanks in anticipation of your help!
[flexcoders] Re: Saving data permanently to Sqlite DB
You were right on the money, the db in the bin-debug has the lastest changes. Thanx for your help. Regards, Tristan --- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote: It's not the case that the database in /src/assets is getting copied to /bin-debug/src/assets and the changes made to that copy, is it? Just a thought, I've not really checked your code in any detail at all. If you're using a db file path relative to the application and you left the compiler settings as is then this may well be the case. It's worth noting that some OS's (e.g Vista) won't allow you to change files in the application directory in any case, so you should be copying the db to the users application storage directory if you're to avoid problems with a published app. -Original Message- From: flexcoders@yahoogroups.com on behalf of beriahotep Sent: Sat 17/01/2009 08:32 To: flexcoders@yahoogroups.com Subject: [flexcoders] Saving data permanently to Sqlite DB Hi, I am having alot of trouble saving data to an Sqlite db. I have no trouble, loading data, however commiting changes permanently seems to fail. I am using a delegate for the table. The code to execute any sqlStatement is: private function executeSQL(sqlStatement:SQLStatement):void{ if(sqlStatement != null){ sqlStatement.addEventListener(SQLEvent.RESULT, responder.result); sqlStatement.addEventListener(SQLErrorEvent.ERROR, responder.fault); sqlStatement.sqlConnection = storyHelperConn; sqlStatement.execute(); } } public function UpdateStory(story:StoryVO):void{ try{ if(!isDBOpen){ openDatabase(); var sqlQuery:String = update stories set title = :titleText, + where id = :id; sqlStatement = new SQLStatement(); sqlStatement.text = sqlQuery; sqlStatement.parameters[:titleText] = story.title; sqlStatement.parameters[:id] = story.id; sqlStatement.itemClass = StoryVO; executeSQL(sqlStatement); }catch(e:Error){ trace(Story Delegate Update Story error: +e.message + + e.toString()); } } The database is stored in src/assets. I get no errors. When debuging i can view the parameters, and they contain all the correct data. Ive been pouring over various help sites and tutorials without success. Can anyone suggest anything to look for? Possible uncaught errors, etc? Regards, Beriah __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
[flexcoders] CSS to SWF with Maven using Flex-mojos
Anyone has a working pom example of compiling a css file into a swf with Flex-mojos?
[flexcoders] n00b question :)
I keep seeing code samples using package. Can someone clarify what this is? I'm not sure what it is and how it's used and how I/when I should use one. Thanks in advance :) --Chris--
[flexcoders] Im new, and this is an old question
I am new to flex and RIA in general. I have been working with .net and java for a while now, and I am just starting to try to create a new interface for some projects of mine, and thought flex might be the answer, but I am having trouble wrapping my head around the idea that its less like a web page, and more like a desktop application, to stop thinking about page reloads, and start thinking about ViewStacks. So my original thought was to begin with multiple swf applications, and convert parts of the site over one part at a time (for instance, user registration, and then move on to the shared calendar, or another part of the site). But after doing some reading, it seems that its better to build the whole site as one application. Well I hope i can get some help, here is my question.. -- I did a lot of searching, and found a lot of posts that seem to disagree. The basic question is: I am building a big application for a website, using flex/swf as a front end, and .net as a back end. How do I control the project so that its not one monster swf file? Answers seem to range between using a single ViewStack, to using modules that you load in. Almost everyone wrote, to not build multiple swf/flex projects and try to communicate between them using .net or directly between swf files. -- I hope that is clear enough, so i should begin by learning about loading and unloading modules? Is that right? Thanks, Mike
[flexcoders] Flex , Blaze DS and coldfusion
Hi all, i am a coldfusion developer and a flex aspirant. i want to know how we can integrate flex with blazeds and coldfusion. i dont know much abt blazeds. Can i make a chat applicatin in coldfusion with blazeds support and integrate in a flex site? is that possible? any tutorial links would be helpful..thnx..
[flexcoders] data grid columns adjustment
Hi, I'm working on datagrid columns adjustment based on the content of cells. Basically columns widths are adjusted based on maximum cell width in the column. I extended the DataGrid class and added adjustment on setting of dataprovider. The problem is that columns are not adjusted if the datagrid is not visible at the time of setting the dataprovider. For example I have a datagrid in an accordion component and if the data grid is not in the active panel at the beginning, the columns are not adjusted. After the data grid is shown for the first time, each later adjustment works, even if the data grid is not visible (i.e, not in the active panel of the accordion). I also want to invoke adjustment on data grid width changes. Does anybody has any ideas which events I can listen to for these two cases? The important thing is also not to invoke the adjustment too often, I mean not to attach it to an event which is often dispatched. Thanks, Grzegorz and Karl.
[flexcoders] Re: Flex , Blaze DS and coldfusion
I would start with http://flexcf.com/ --- In flexcoders@yahoogroups.com, ajith_manmadhan ajith_manmad...@... wrote: Hi all, i am a coldfusion developer and a flex aspirant. i want to know how we can integrate flex with blazeds and coldfusion. i dont know much abt blazeds. Can i make a chat applicatin in coldfusion with blazeds support and integrate in a flex site? is that possible? any tutorial links would be helpful..thnx..
RE: [flexcoders] n00b question :)
It's essentially/simply used for your folder structure and then used to import in your various classes. So inside your src folder if you had a folder structure of src-com-mywebname - view, then any classes inside the folder 'view' would have a package name of com.mywebname.view and the import would be com.mywebname.view.*; or com.mywebname.view.myClassName; If your using flexbuilder it names the package for you. If you create a new AS file inside a particular folder flexbuilder will give the package name the same folder location. Should you move an AS file from one folder to another you will need to rename the package. For more detail check out http://www.foundation-flash.com/tutorials/packages/ and http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhe lp.htm?context=LiveDocs_Partsfile=0041.html Kenneth. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Chris Sent: 18 January 2009 07:43 To: flexcoders@yahoogroups.com Subject: [flexcoders] n00b question :) I keep seeing code samples using package. Can someone clarify what this is? I'm not sure what it is and how it's used and how I/when I should use one. Thanks in advance :) --Chris-- Disclaimer --- This electronic message contains information which may be privileged and confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone on 0131 476 6000 and delete the material from your computer. Registered in Scotland number: SC 172507. Registered office address: Quay House 142 Commercial Street Edinburgh EH6 6LB. This email message has been scanned for viruses by Mimecast. ---
[flexcoders] Re: Im new, and this is an old question
Mike I don't know that I would agree with that idea. In my case I have had to build smaller applications because each part of our intranet is owned by different departments and they all want separate control over Their piece. Now that I have it up and running, I don't know that I would now make it into modules. All works well as it is. If a user clicks a link that goes to a different department, a new swf loads for that department. If I had a modular system, a new swf would load so what's the difference? I think in your case that you would be better off porting part of the site at a time. If you want to go to modules later on then you can do so. Think about how you would have multiple pages on the same page. eg. We have multiple table based pages that are built using PHP. With Flex we now have one page that loads multiple windows into that data. (Check out FlexMDI - Part of FlexLib) --- In flexcoders@yahoogroups.com, nycynik m...@... wrote: I am new to flex and RIA in general. I have been working with .net and java for a while now, and I am just starting to try to create a new interface for some projects of mine, and thought flex might be the answer, but I am having trouble wrapping my head around the idea that its less like a web page, and more like a desktop application, to stop thinking about page reloads, and start thinking about ViewStacks. So my original thought was to begin with multiple swf applications, and convert parts of the site over one part at a time (for instance, user registration, and then move on to the shared calendar, or another part of the site). But after doing some reading, it seems that its better to build the whole site as one application. Well I hope i can get some help, here is my question.. -- I did a lot of searching, and found a lot of posts that seem to disagree. The basic question is: I am building a big application for a website, using flex/swf as a front end, and .net as a back end. How do I control the project so that its not one monster swf file? Answers seem to range between using a single ViewStack, to using modules that you load in. Almost everyone wrote, to not build multiple swf/flex projects and try to communicate between them using .net or directly between swf files. -- I hope that is clear enough, so i should begin by learning about loading and unloading modules? Is that right? Thanks, Mike
[flexcoders] Re: n00b question :)
package refers to the directory that the class is in. If the class file is in the root (src) directory, then there is no package name. If the class is in a directory called (For example) MyEvents then the package statement would be package MyEvents. Each class file in that directory would have the same package statement. --- In flexcoders@yahoogroups.com, Chris loony...@... wrote: I keep seeing code samples using package. Can someone clarify what this is? I'm not sure what it is and how it's used and how I/when I should use one. Thanks in advance :) --Chris--
Re: [flexcoders] Re: BlazeDS server environment configuration
Thanks for these tutorials (the last one using Hibernate seems exactly what I had in mind while asking in the first place) Now I have to study and configure my application in accordance. Great help from this forum, George --- On Thu, 1/15/09, valdhor valdhorli...@embarqmail.com wrote: From: valdhor valdhorli...@embarqmail.com Subject: [flexcoders] Re: BlazeDS server environment configuration To: flexcoders@yahoogroups.com Date: Thursday, January 15, 2009, 8:13 AM OK, how about: http://backbeatlabs .com/?p=3 http://www.bfaig. org/blog/ ?cat=14 http://www.adobe. com/devnet/ flex/articles/ flex_hibernate. html --- In flexcod...@yahoogro ups.com, grg_blls grg_b...@.. . wrote: Hi again, following the information provided, I tried the tutorial Wesley provided, only the information in the article is of course rather sketchy - as the complete detailed description was provided in the source code used for that banner example. Unfortunatelly the sources provided are not available anymore (links, dowloads, et.c. don't work), as this article is outdated being 5 years old. So I can't really make much out of this. On the other hand what is described in that old article is generally correct, and this is the way I know I have to proceed. Only I still have to look for something more up to day and detailed enough for me to study and adapt to my case. Specifically, I look for an current BlazeDS/Tomcat/ MySql environment setup detailed description for a Flex client connected to database by Remote Object procedures. Besides working examples, I still look for a book to read on the subject and documentation, in extend to BlazeDS developer's guide.. So while the question remains open and have to wait for any other answer leading to some consice piece of info, I thank you both valdhor and Wesley for trying to help me. George --- In flexcod...@yahoogro ups.com, grg_blls grg_blls@ wrote: Hi again (and thanks for replying) I didn't say Wesley is not correct..On the contrary... As I have first to work it out and then see if I get any more questions. (Obviously not having done this before, was the reason for asking about documentation (or a cookbook) in the first place. Sofar I 've done a lot working with Flex for the client and the business logic of my app, having Hsqldb as a basic database. I also feel very satisfied with Flex documentation and on-line help (this forum included) that helped me so much sofar. So I still consider any additional hint towards a good book on BlazeDS, covering both some examplary applications as well as pointing to differences to say JBOSS for instance. This as I want to go a bit deeper into the subject and understand better.. some aspects. Thank you all George --- In flexcod...@yahoogro ups.com, valdhor valdhorlists@ wrote: Wesley is correct - This is a Java question. You already have the BlazeDS part set up and working. All you need to do is change the database access in Java. I would suggest following the tutorial Wesley provided and then apply the knowledge gained to your project. From what I can see this entails adding the driver for the MySQL connection; removing the flex.samples. ConnectionHelper stuff and adding the dbHandler handler class from the tutorial. --- In flexcod...@yahoogro ups.com, grg_blls grg_blls@ wrote: --- In flexcod...@yahoogro ups.com, Wesley Acheson wesley.acheson@ wrote: Really thats more of a java question then a flex one. for using mysql and tomcat try http://www.opensour cetutorials. com/tutorials/ Databases/ MySQL/tomcat- and-mysql/page2. html Thank you Wesley for a quick reply. But what I am asking has to do with BlazeDS (how to set up its environment) in conjunction to the MySql database environment plus Tomcat environment. So this is more complicated than that. You see I understand what to do with the Java classes needed and that I have to set up a Remote Object in mxml, and that I have to configure how I connect to the service destination. (I have done that already while using the Hsqldb - and work just fine, by following the documentation available). Now I have to again with MySql, but I missing a clear documentation. . Then BlazeDS has to be set up properly to work with MySql under the servlet container (Tomcat). Mainly this connection will serve user login procedures, so what will be in that database will be a number of users and their login data. (I mean an apriori unknown number of users) Thank you George
[flexcoders] Problems with POST or GET
Are there any known problems with HTTPService, resultFormat = e4x when the service would not go into result listener? Thanks
RE: [flexcoders] Problems with POST or GET
It used to be the case that Internet Explorer would refuse to do anything with GET requests sending data over a certain length, which mystified me for a while a couple of years ago since everything worked fine with firefox. It just failed very quietly, no errors raised at all. Changing to POST fixed it, but I can't really remember the details now I'm afraid. This issue did get added to the livedocs after I posted it there, but memory fails me as to which topic, exactly. I'm not sure if this is what you're after? -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of markgoldin_2000 Sent: 19 January 2009 15:00 To: flexcoders@yahoogroups.com Subject: [flexcoders] Problems with POST or GET Are there any known problems with HTTPService, resultFormat = e4x when the service would not go into result listener? Thanks __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
[flexcoders] Re: Problems with POST or GET
I had a couple of problems like this before. For one changing to POST helped, but not for this one. I am returning a string with 1000 chars. back to POST call, still does not work. It is simply not getting into the result listener. I tried with Chrome, same problem. --- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote: It used to be the case that Internet Explorer would refuse to do anything with GET requests sending data over a certain length, which mystified me for a while a couple of years ago since everything worked fine with firefox. It just failed very quietly, no errors raised at all. Changing to POST fixed it, but I can't really remember the details now I'm afraid. This issue did get added to the livedocs after I posted it there, but memory fails me as to which topic, exactly. I'm not sure if this is what you're after? -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of markgoldin_2000 Sent: 19 January 2009 15:00 To: flexcoders@yahoogroups.com Subject: [flexcoders] Problems with POST or GET Are there any known problems with HTTPService, resultFormat = e4x when the service would not go into result listener? Thanks __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
[flexcoders] Re: flex not seeing method - update
--- In flexcoders@yahoogroups.com, Josh McDonald dzn...@... wrote: Ah, I forgot about outerDocument, as I'm one of those loose-coupling nazi types and don't use it :) Of course, being a louse-coupling nazi has it's upside, in Smartypants-IOC I tend to agree with Josh that we'd all be better off if we pretended we didn't know about Application.application and outerdocument. In addition to his excellent advice, you might want to check out http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf Question 3. HTH; Amy
Re: [flexcoders] Re: Flex , Blaze DS and coldfusion
thnx.. --- On Mon, 1/19/09, valdhor valdhorli...@embarqmail.com wrote: From: valdhor valdhorli...@embarqmail.com Subject: [flexcoders] Re: Flex , Blaze DS and coldfusion To: flexcoders@yahoogroups.com Date: Monday, January 19, 2009, 2:11 PM I would start with http://flexcf.com/ --- In flexcoders@yahoogroups.com, ajith_manmadhan ajith_manmad...@... wrote: Hi all, i am a coldfusion developer and a flex aspirant. i want to know how we can integrate flex with blazeds and coldfusion. i dont know much abt blazeds. Can i make a chat applicatin in coldfusion with blazeds support and integrate in a flex site? is that possible? any tutorial links would be helpful..thnx..
[flexcoders] Do states and transitions behave differently depending on the context?
I have a component which can appear initially in one of two states, and can subsequently be switched between them. When this switch takes place, I want a transition to occur. Here's a tiny model of my component: mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; mx:states mx:State name=state1 mx:AddChild mx:HBox mx:Text id=text1 text=t1:/ mx:Text id=text2 text=t2:/ /mx:HBox /mx:AddChild /mx:State /mx:states mx:transitions mx:Transition mx:Move targets={[text1, text2]}/ /mx:Transition /mx:transitions /mx:Canvas If I embed this component (call it MyComp) like this: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; view:MyComp currentState=state1/ /mx:Application the transition takes place as the component appears, and everything is fine. But if I put it inside a FormItem, like this: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Form mx:FormItem label=Type view:SectionTypeControl currentState=taskQueue/ /mx:FormItem /mx:Form /mx:Application the transition never takes place and the two labels remain superimposed. In fact the problem is a little worse than this. In the toy application above, you can replace FormItem by a container like HBox and it works again. But in my real app I can't use it inside a Form at all. What gives? Maurice
[flexcoders] Passing data to a cell on a DataGrid, and putting there a ComboBox
Hi, My application has an AdvancedDataGrid that shows a list of data. I would like that the user could edit data on the DataGrid itself just by clicking on a row/cell. After the click, that cell shows a ComboBox filled with data that comes from other data source different from the datasource provided to the AdvancedDataGrid. My problems are: 1- Best practices to pass the data (that comes from other datasource) to the ComboBox on the cell ? Should I extend the ADG ? 2- To show the ComboBox on the cell, the proposed solution is to use an itemRenderer or an itemEditor? What's the difference between both, and which one of them fits better on my problem ? 3- After the user chooses the value, I need to save the change somewhere. I am thinking on dispatching an event, with bubbles = true, and catching it on the AdvancedDataGrid parent. Do you think this is a good approach? Thanks, João Saleiro
[flexcoders] TileList / DataGrid View Swap
I have a datagrid that displays a list of files on a server. What I have done is created a button for you to switch back and forth between the datagrid and a tile list view. mx:ViewStack id=vs selectedIndex=0 width=100% height=100% mx:Canvas width=100% height=100% mx:DataGrid id=filelist width=100% height=100% dataProvider={files} allowMultipleSelection=true dragEnabled=true dragMoveEnabled=true mx:columns mx:DataGridColumn headerText=File Name dataField=name/ mx:DataGridColumn headerText=File Type dataField=type/ mx:DataGridColumn headerText=File Size dataField=size labelFunction=bytesToKilobytes/ mx:DataGridColumn headerText=Last Modified dataField=lastModified/ mx:DataGridColumn headerText=Hidden dataField=isHidden/ /mx:columns /mx:DataGrid /mx:Canvas mx:Canvas width=100% height=100% mx:TileList width=100% height=100% dataProvider={files} color=#00 backgroundColor=#ff itemRenderer=ThumbnailView/ /mx:Canvas /mx:ViewStack I am struggling with 2 things here. What I want to do is to display thumbnails for any image file in the list. If its not an image I will display an icon (pdf/doc/excel). 1.) The first time my item renderer loads the init function is called 4x event though there are 3 data items. My thumbnails are gettiog loaded the 1st time but after that is some very buggy behavior. 2.) To display the thumbnails I am passing the image path to a server, resizing the image placing in a temp directory passing back the binary data and displaying the image. Is this my only option? I mean you can't just load a file from C:\myfolder\abc.gif as its a major security no no. ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; backgroundColor=#ff width=100% height=100% creationComplete=init() mx:Script ![CDATA[ import mx.controls.Image; import mx.core.Application; import mx.rpc.events.ResultEvent; import flash.display.Loader; private function init():void { trace(init called); } private function loadImage(path:String,type:String):void { if(type.toLowerCase() == png || type.toLowerCase() == jpg || type.toLowerCase() == gif){ ImageService.getImageData(path,Application.application.tempLocation); } else { trace(type); } } private function onReadImage(event:ResultEvent):void { var loader:Loader = new Loader(); var imgData:ByteArray = new ByteArray(); var img:Image = new Image(); imgData = event.result as ByteArray; loader.loadBytes(imgData); img.data = imgData; thumbnail.addChild(img); } ]] /mx:Script mx:RemoteObject id=ImageService destination=ColdFusion source=ImageLoader.src.ImageService showBusyCursor=true mx:method name=getImageData result=onReadImage(event)/ /mx:RemoteObject mx:VBox id=thumbnail width=200 height=200 backgroundColor=#ff paddingBottom=20 paddingTop=20 paddingLeft=20 paddingRight=20 verticalScrollPolicy=off horizontalScrollPolicy=off borderColor=#00 creationComplete=loadImage(data.path,data.type) mx:Label text={data.name}/ /mx:VBox /mx:Canvas Has anyone else gone through something like this? Any help would be great, thanks! Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders]How would you rewrite this isset PHP condition in AS3?
The hasOwnProperty method available in all objects does exactly this. http://livedocs.adobe.com/flex/3/langref/Object.html#hasOwnProperty() Why it is called hasOwnProperty rather than hasProperty I have no idea. 2009/1/19 dorkie dork from dorktown dorkiedorkfromdorkt...@gmail.com: late night... thanks On Sun, Jan 18, 2009 at 10:05 AM, Ralf Bokelberg ralf.bokelb...@gmail.com wrote: doesn't try catch help here? If no error is thrown, isset returns true ralf On Sun, Jan 18, 2009 at 1:46 PM, dorkie dork from dorktown dorkiedorkfromdorkt...@gmail.com wrote: I have a PHP statement that I am trying to write in AS3. So far it errors out because the properties do not exist on it yet. How would/should I rewrite this for AS3? Here is the statement: // at the time this is run this.language_data is an object with 2 properties // the STYLES property does not exist yet and it generates a // TypeError: Error #1010: A term is undefined and has no properties. if (isset(this.language_data['STYLES']['BRACKETS'][0])) { ddfd
RE: [flexcoders] Passing data to a cell on a DataGrid, and putting there a ComboBox
One set of answers: 1- Assuming the ComboBox dataProvider is the same for all rows, you couild bind it to a data model on the main application. 2- If I recall correctly, using an itemEditor and editable column makes flex display the editor when you click in a cell. You would use the normal DataGrid editing events to manipulate the data if needed. If set up correctly, the DG will handle updating the dataProvider. I tend to prefer non-editable columns containing full interactive itemRenderers that handle all of the display, and updating of the dataProvider item themselves. The itemRenderer has a reference to the current dataProvider row item. You can simply update the item there. Use the dataProvider API to update the item, to ensure the UI responds to the change. 3 - see 2 above Additional notes: * itemRenderers should be be data driven. You must update a renderers visual state based on changes to the underlying data. * If you want ComboBox to display the current cell value as the selectedItem, you will need to do some workl. * Interactive Item renderers are not simple, especially if youwant to perserve performance. Find an example and modify it. Do not start from scratch. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of João Sent: Monday, January 19, 2009 12:03 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Passing data to a cell on a DataGrid, and putting there a ComboBox Hi, My application has an AdvancedDataGrid that shows a list of data. I would like that the user could edit data on the DataGrid itself just by clicking on a row/cell. After the click, that cell shows a ComboBox filled with data that comes from other data source different from the datasource provided to the AdvancedDataGrid. My problems are: 1- Best practices to pass the data (that comes from other datasource) to the ComboBox on the cell ? Should I extend the ADG ? 2- To show the ComboBox on the cell, the proposed solution is to use an itemRenderer or an itemEditor? What's the difference between both, and which one of them fits better on my problem ? 3- After the user chooses the value, I need to save the change somewhere. I am thinking on dispatching an event, with bubbles = true, and catching it on the AdvancedDataGrid parent. Do you think this is a good approach? Thanks, João Saleiro
[flexcoders] Re: Populating a Flex Container in Flash
Does anyone else have any thoughts on this problem? --- In flexcoders@yahoogroups.com, specdout ratu...@... wrote: Thanks for your reply, Paul. --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: Does anything get added to the display list? When the example code executes I do see the FlexContentHolder symbol (Fx) on the display where I would expect it to be, i.e. positioned where I would expect, with the dimensions I would expect, so I think it's already on the DisplayList. As well, I can make it invisible if I want, so it does appear to be available and active - it's just the Flex content that doesn't show. - Original Message - From: specdout raturne@ To: flexcoders@yahoogroups.com Sent: Thursday, January 15, 2009 5:42 PM Subject: [flexcoders] Populating a Flex Container in Flash Hi All, I'm currently developing a Flex application that loads a Flash SWF for use as a background image. In other words, the app's main window has as its first child a SWFLoader component into which I've loaded a SWF developed in Flash. So far, so good. Now, rather than open up dialogs or create direct child windows of the main window, I want to host Flex content within the Flash SWF itself. I installed the Flex Component Kit in my Flash CS3 environment and proceeded to created a MovieClip symbol that contains a FlexContentHolder. From Flex, I can access the symbol and set Flex content on that symbol but the Flex content never appears. An example of how I've attempted to do this is as follows: // get a reference to the Flex Content MovieClip var swf:MovieClip = _swfLoader.content as MovieClip; var fc:Object = swf[flexContainer]; // create some Flex content to display var button:Button = new Button(); button.width = 200; button.height = 100; button.label = Click me!; // create a top-level container for the Flex content var uiComponent:UIComponent = new UIComponent(); uiComponent.width = fc.width; uiComponent.height = fc.height; uiComponent.alpha = 1.0; uiComponent.addChild(button); uiComponent.visible = true; fc.content = uiComponent; Am I doing something wrong here? Conceptually, am I on the right track? In other words, should what I'm trying to do be possible? I'd appreciate any help or insight anyone might be able to offer. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
RE: [flexcoders] TileList / DataGrid View Swap
If the mx:Canvas component you posted is to be an item renderer, then you have some work to do. Item renderers myst be data driven. You cannot use the initialize or creationComplete events for any row-level work, because renderer instances are re-cycled. Thus there is no useful meaning in the number of itemRenderer instances, and tracing the number of times init() is called will tell you nothing of value. I advise you find an example of an itemRenderer and modify it as needed. That or study the docs. Both, probably. You can display an image file stored on a server, with just the url. Example, http://www.myServer.com/myImages/abc.gif. You would need a crosdomain.xml policy file on the image server if the domain is different than the domain serving the application. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Dan Vega Sent: Monday, January 19, 2009 12:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] TileList / DataGrid View Swap I have a datagrid that displays a list of files on a server. What I have done is created a button for you to switch back and forth between the datagrid and a tile list view. mx:ViewStack id=vs selectedIndex=0 width=100% height=100% mx:Canvas width=100% height=100% mx:DataGrid id=filelist width=100% height=100% dataProvider={files} allowMultipleSelection=true dragEnabled=true dragMoveEnabled=true mx:columns mx:DataGridColumn headerText=File Name dataField=name/ mx:DataGridColumn headerText=File Type dataField=type/ mx:DataGridColumn headerText=File Size dataField=size labelFunction=bytesToKilobytes/ mx:DataGridColumn headerText=Last Modified dataField=lastModified/ mx:DataGridColumn headerText=Hidden dataField=isHidden/ /mx:columns /mx:DataGrid /mx:Canvas mx:Canvas width=100% height=100% mx:TileList width=100% height=100% dataProvider={files} color=#00 backgroundColor=#ff itemRenderer=ThumbnailView/ /mx:Canvas /mx:ViewStack I am struggling with 2 things here. What I want to do is to display thumbnails for any image file in the list. If its not an image I will display an icon (pdf/doc/excel). 1.) The first time my item renderer loads the init function is called 4x event though there are 3 data items. My thumbnails are gettiog loaded the 1st time but after that is some very buggy behavior. 2.) To display the thumbnails I am passing the image path to a server, resizing the image placing in a temp directory passing back the binary data and displaying the image. Is this my only option? I mean you can't just load a file from C:\myfolder\abc.gif as its a major security no no. ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml backgroundColor=#ff width=100% height=100% creationComplete=init() mx:Script ![CDATA[ import mx.controls.Image; import mx.core.Application; import mx.rpc.events.ResultEvent; import flash.display.Loader; private function init():void { trace(init called); } private function loadImage(path:String,type:String):void { if(type.toLowerCase() == png || type.toLowerCase() == jpg || type.toLowerCase() == gif){ ImageService.getImageData(path,Application.application.tempLocation); } else { trace(type); } } private function onReadImage(event:ResultEvent):void { var loader:Loader = new Loader(); var imgData:ByteArray = new ByteArray(); var img:Image = new Image(); imgData = event.result as ByteArray; loader.loadBytes(imgData); img.data = imgData; thumbnail.addChild(img); } ]] /mx:Script mx:RemoteObject id=ImageService destination=ColdFusion source=ImageLoader.src.ImageService showBusyCursor=true mx:method name=getImageData result=onReadImage(event)/ /mx:RemoteObject mx:VBox id=thumbnail width=200 height=200 backgroundColor=#ff paddingBottom=20 paddingTop=20 paddingLeft=20 paddingRight=20 verticalScrollPolicy=off horizontalScrollPolicy=off borderColor=#00 creationComplete=loadImage(data.path,data.type) mx:Label text={data.name}/ /mx:VBox /mx:Canvas Has anyone else gone through something like this? Any help would be great, thanks! Thank You Dan
[flexcoders] Re: n00b question :)
--- In flexcoders@yahoogroups.com, Chris loony...@... wrote: I keep seeing code samples using package. Can someone clarify what this is? I'm not sure what it is and how it's used and how I/when I should use one. Thanks in advance :) Try this: http://flexdiary.blogspot.com/2007/08/as3-basics.html
Re: [flexcoders] TileList / DataGrid View Swap
Thanks Tracy, I will dig around some more and see if I can find anything. As far as the images go, they can be anywhere on the server, if they are outside of the web root that approach will not work. Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Mon, Jan 19, 2009 at 12:38 PM, Tracy Spratt tspr...@lariatinc.comwrote: If the mx:Canvas component you posted is to be an item renderer, then you have some work to do. Item renderers myst be data driven. You cannot use the initialize or creationComplete events for any row-level work, because renderer instances are re-cycled. Thus there is no useful meaning in the number of itemRenderer instances, and tracing the number of times init() is called will tell you nothing of value. I advise you find an example of an itemRenderer and modify it as needed. That or study the docs. Both, probably. You can display an image file stored on a server, with just the url. Example, http://www.myServer.com/myImages/abc.gif. You would need a crosdomain.xml policy file on the image server if the domain is different than the domain serving the application. Tracy Spratt Lariat Services Flex development bandwidth available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Dan Vega *Sent:* Monday, January 19, 2009 12:07 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] TileList / DataGrid View Swap I have a datagrid that displays a list of files on a server. What I have done is created a button for you to switch back and forth between the datagrid and a tile list view. mx:ViewStack id=vs selectedIndex=0 width=100% height=100% mx:Canvas width=100% height=100% mx:DataGrid id=filelist width=100% height=100% dataProvider={files} allowMultipleSelection=true dragEnabled=true dragMoveEnabled=true mx:columns mx:DataGridColumn headerText=File Name dataField=name/ mx:DataGridColumn headerText=File Type dataField=type/ mx:DataGridColumn headerText=File Size dataField=size labelFunction=bytesToKilobytes/ mx:DataGridColumn headerText=Last Modified dataField=lastModified/ mx:DataGridColumn headerText=Hidden dataField=isHidden/ /mx:columns /mx:DataGrid /mx:Canvas mx:Canvas width=100% height=100% mx:TileList width=100% height=100% dataProvider={files} color=#00 backgroundColor=#ff itemRenderer=ThumbnailView/ /mx:Canvas /mx:ViewStack I am struggling with 2 things here. What I want to do is to display thumbnails for any image file in the list. If its not an image I will display an icon (pdf/doc/excel). 1.) The first time my item renderer loads the init function is called 4x event though there are 3 data items. My thumbnails are gettiog loaded the 1st time but after that is some very buggy behavior. 2.) To display the thumbnails I am passing the image path to a server, resizing the image placing in a temp directory passing back the binary data and displaying the image. Is this my only option? I mean you can't just load a file from C:\myfolder\abc.gif as its a major security no no. ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; backgroundColor=#ff width=100% height=100% creationComplete=init() mx:Script ![CDATA[ import mx.controls.Image; import mx.core.Application; import mx.rpc.events.ResultEvent; import flash.display.Loader; private function init():void { trace(init called); } private function loadImage(path:String,type:String):void { if(type.toLowerCase() == png || type.toLowerCase() == jpg || type.toLowerCase() == gif){ ImageService.getImageData(path,Application.application.tempLocation); } else { trace(type); } } private function onReadImage(event:ResultEvent):void { var loader:Loader = new Loader(); var imgData:ByteArray = new ByteArray(); var img:Image = new Image(); imgData = event.result as ByteArray; loader.loadBytes(imgData); img.data = imgData; thumbnail.addChild(img); } ]] /mx:Script mx:RemoteObject id=ImageService destination=ColdFusion source=ImageLoader.src.ImageService showBusyCursor=true mx:method name=getImageData result=onReadImage(event)/ /mx:RemoteObject mx:VBox id=thumbnail width=200 height=200 backgroundColor=#ff paddingBottom=20 paddingTop=20 paddingLeft=20
Re: [flexcoders] TileList / DataGrid View Swap
Here is a simple Canvas based item render with a pic, some text and a remove button (in case you want to delete a file ;-) ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=160 height=75 borderStyle=solid borderThickness=1 cornerRadius=10 backgroundColor=#00 backgroundAlpha=0.25 borderColor={borderColor} rollOver={rollOver()} rollOut={rollOut()} toolTip={comment.dateInserted} horizontalScrollPolicy=off mx:Script ![CDATA[ import beans.ProductCommentRPC; import events.MySingleDataEvent; import mx.events.FlexEvent; import beans.W2WUser; [Bindable] private var borderColor:int = 0xFF ; [Bindable] private var comment:ProductCommentRPC; [Bindable] private var selected:Boolean ; private function rollOver():void { borderColor=0x00FF00 ; selected = true ; } private function rollOut():void { borderColor=0xFF selected = false ; } override public function set data(value:Object):void { if (value != null) { super.data = value ; comment = value as ProductCommentRPC ; } dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE)) ; } private function removeComment(f:Object):void { var newFriendEv:MySingleDataEvent = new MySingleDataEvent(showFriend, true) ; newFriendEv.data = f ; dispatchEvent(newFriendEv) ; } ]] /mx:Script mx:Image verticalCenter=0 source={comment.userType} left=5 height=38 width=38/ mx:TextArea color=#FF backgroundAlpha=0 text={comment.comment} textAlign=left fontWeight=bold borderStyle=none left=50 right=5 top=5 bottom=5 wordWrap=true editable=false/ mx:Button label=- right=5 verticalCenter=0 visible={selected} click={removeComment(comment)}/ /mx:Canvas In the ovveriden set data you can do any initialization you need as it is called every time data is passed to the renderer. The button throws a custom event which i catch outside. If you do not need such functionality simple remove it. I hope it helps you continue... On Mon, Jan 19, 2009 at 7:44 PM, Dan Vega danv...@gmail.com wrote: Thanks Tracy, I will dig around some more and see if I can find anything. As far as the images go, they can be anywhere on the server, if they are outside of the web root that approach will not work. Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Mon, Jan 19, 2009 at 12:38 PM, Tracy Spratt tspr...@lariatinc.comwrote: If the mx:Canvas component you posted is to be an item renderer, then you have some work to do. Item renderers myst be data driven. You cannot use the initialize or creationComplete events for any row-level work, because renderer instances are re-cycled. Thus there is no useful meaning in the number of itemRenderer instances, and tracing the number of times init() is called will tell you nothing of value. I advise you find an example of an itemRenderer and modify it as needed. That or study the docs. Both, probably. You can display an image file stored on a server, with just the url. Example, http://www.myServer.com/myImages/abc.gif. You would need a crosdomain.xml policy file on the image server if the domain is different than the domain serving the application. Tracy Spratt Lariat Services Flex development bandwidth available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Dan Vega *Sent:* Monday, January 19, 2009 12:07 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] TileList / DataGrid View Swap I have a datagrid that displays a list of files on a server. What I have done is created a button for you to switch back and forth between the datagrid and a tile list view. mx:ViewStack id=vs selectedIndex=0 width=100% height=100% mx:Canvas width=100% height=100% mx:DataGrid id=filelist width=100% height=100% dataProvider={files} allowMultipleSelection=true dragEnabled=true dragMoveEnabled=true mx:columns mx:DataGridColumn headerText=File Name dataField=name/ mx:DataGridColumn headerText=File Type dataField=type/ mx:DataGridColumn headerText=File Size dataField=size labelFunction=bytesToKilobytes/ mx:DataGridColumn headerText=Last Modified dataField=lastModified/ mx:DataGridColumn headerText=Hidden dataField=isHidden/
RE: [flexcoders] Re: WebService returning results, but event.result is null
Interestingly enough, setting the resultFormat to e4x does indeed properly populate the event.result. I'm guessing this has got to be some sort of parsing error in the WebService classes attempts to marshal the results as objects. Has anyone else run across this issue? Jeff Tapper Senior Consultant digital primates IT Consulting Group R Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@digitalprimates.net From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 16, 2009 5:59 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null Something like: proxy.find.resultFormat = e4x; Tracy Spratt Lariat Services Flex development bandwidth available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeff Tapper Sent: Friday, January 16, 2009 5:49 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null Ok,so, given im making a call like this: public function getMediaItems(eventId:Number):AsyncToken{ var req:Object = new Object(); req['event-id'] = eventId; var token:AsyncToken = proxy.find(req); token.addResponder(responder); return token; } How do I get a handle on the operation? (in this case, it's the find method of my service, proxy. Jeff Tapper Senior Consultant digital primates IT Consulting Group R Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@digitalprimates.net From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 16, 2009 5:31 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null Well, actually it is at the operation/method level. The default is object, which converts your soap xml into a tree of dynamic objects, and this has some issues. Change it to e4x, which will preserve the xml, to see if the behavior changes. Tracy Spratt Lariat Services Flex development bandwidth available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeff Tapper Sent: Friday, January 16, 2009 5:20 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null I don't believe the mx.rpc.soap.WebService class has a resultFormat property, but, if it does, im using its default. I've only seen that property on HTTPService, not WebService Jeff Tapper Senior Consultant digital primates IT Consulting Group R Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@digitalprimates.net From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 16, 2009 3:41 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null And what is your resultFormat? Tracy Spratt Lariat Services Flex development bandwidth available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of valdhor Sent: Friday, January 16, 2009 3:18 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: WebService returning results, but event.result is null HmCould you post the Soap response. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Jeff Tapper j...@... wrote: Oddly enough, I'm getting a ResultEvent, no faults at all. Jeff Tapper Senior Consultant digital primates IT Consulting Group R Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@... From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of valdhor Sent: Friday, January 16, 2009 2:00 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: WebService returning results, but event.result is null Are you getting a faultevent or a SoapFault? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Jeff Tapper jeff@ wrote: Has anyone dealt with situations where a webservice call is indeed completing properly, and the results can be seen in service capture, and the raw SOAP can be seen in event.message.body, but yet the event.result is coming through null? I'm battling that very issue now. Any advice or words of wisdom?
RE: [flexcoders] Re: Populating a Flex Container in Flash
So you have a browser hosting the Flash Player, running a Flex app that contains a SWFLoader that loads a Flash SWF. In that Flash SWF, you implemented a UIComponent and inside of that you want to display a Flex application that you are going to build dynamically. Is that correct? If so, why so convoluted? Is the Flex framework available from within the Flash SWF? Also, UIComponent is not a container and will not do any automatic sizing or layout of the content. You will have to do that yourself. That means implementing the lifecycle, layout and measurement functionality. Say again why you want to do this? I'm not saying it is bad, just trying to be sure you have a god reason. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of specdout Sent: Monday, January 19, 2009 12:05 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Populating a Flex Container in Flash Does anyone else have any thoughts on this problem? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , specdout ratu...@... wrote: Thanks for your reply, Paul. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Paul Andrews paul@ wrote: Does anything get added to the display list? When the example code executes I do see the FlexContentHolder symbol (Fx) on the display where I would expect it to be, i.e. positioned where I would expect, with the dimensions I would expect, so I think it's already on the DisplayList. As well, I can make it invisible if I want, so it does appear to be available and active - it's just the Flex content that doesn't show. - Original Message - From: specdout raturne@ To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Sent: Thursday, January 15, 2009 5:42 PM Subject: [flexcoders] Populating a Flex Container in Flash Hi All, I'm currently developing a Flex application that loads a Flash SWF for use as a background image. In other words, the app's main window has as its first child a SWFLoader component into which I've loaded a SWF developed in Flash. So far, so good. Now, rather than open up dialogs or create direct child windows of the main window, I want to host Flex content within the Flash SWF itself. I installed the Flex Component Kit in my Flash CS3 environment and proceeded to created a MovieClip symbol that contains a FlexContentHolder. From Flex, I can access the symbol and set Flex content on that symbol but the Flex content never appears. An example of how I've attempted to do this is as follows: // get a reference to the Flex Content MovieClip var swf:MovieClip = _swfLoader.content as MovieClip; var fc:Object = swf[flexContainer]; // create some Flex content to display var button:Button = new Button(); button.width = 200; button.height = 100; button.label = Click me!; // create a top-level container for the Flex content var uiComponent:UIComponent = new UIComponent(); uiComponent.width = fc.width; uiComponent.height = fc.height; uiComponent.alpha = 1.0; uiComponent.addChild(button); uiComponent.visible = true; fc.content = uiComponent; Am I doing something wrong here? Conceptually, am I on the right track? In other words, should what I'm trying to do be possible? I'd appreciate any help or insight anyone might be able to offer. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf- 1e62079f6847 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf -1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo ! Groups Links
RE: [flexcoders] Re: WebService returning results, but event.result is null
Not specifically. But the default object conversion is the source of *many* problems. It is a quick way to display data, but that is about all. I don't see how, even theoretically, that a single algorithm could handle any arbitrary XML input and produce a reliable, predicatable object tree. And dynamic objects can have poor access performance, and the object tree does not provide e4x expressions for manipulation. Ease of use is its only benefit. I steer folks away from it any chance I get. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeff Tapper Sent: Monday, January 19, 2009 12:51 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null Interestingly enough, setting the resultFormat to e4x does indeed properly populate the event.result. I'm guessing this has got to be some sort of parsing error in the WebService classes attempts to marshal the results as objects. Has anyone else run across this issue? Jeff Tapper Senior Consultant digital primates IT Consulting Group (r) Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@digitalprimates.net From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 16, 2009 5:59 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null Something like: proxy.find.resultFormat = e4x; Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeff Tapper Sent: Friday, January 16, 2009 5:49 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null Ok,so, given im making a call like this: public function getMediaItems(eventId:Number):AsyncToken{ var req:Object = new Object(); req['event-id'] = eventId; var token:AsyncToken = proxy.find(req); token.addResponder(responder); return token; } How do I get a handle on the operation? (in this case, it's the find method of my service, proxy. Jeff Tapper Senior Consultant digital primates IT Consulting Group (r) Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@digitalprimates.net From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 16, 2009 5:31 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null Well, actually it is at the operation/method level. The default is object, which converts your soap xml into a tree of dynamic objects, and this has some issues. Change it to e4x, which will preserve the xml, to see if the behavior changes. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeff Tapper Sent: Friday, January 16, 2009 5:20 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null I don't believe the mx.rpc.soap.WebService class has a resultFormat property, but, if it does, im using its default. I've only seen that property on HTTPService, not WebService Jeff Tapper Senior Consultant digital primates IT Consulting Group (r) Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@digitalprimates.net From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Friday, January 16, 2009 3:41 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: WebService returning results, but event.result is null And what is your resultFormat? Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of valdhor Sent: Friday, January 16, 2009 3:18 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: WebService returning results, but event.result is null HmCould you post the Soap response. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Jeff Tapper j...@... wrote: Oddly enough, I'm getting a ResultEvent, no faults at all. Jeff Tapper Senior Consultant digital primates IT Consulting Group R Phone: 847.824.7800, x222 | Fax: 847.655.2867 jtap...@... From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com
[flexcoders] Facebook Connect and Flex
Hi, Has anyone had experience implementing Facebook connect with Flex/Air Apps? If so, can someone point to an example? Thanks, -Daniel
Re: [flexcoders] Re: LCDS - adding a new Item using createItem()
Bart, during the sync method, when you create your bean, are you setting the new generated Id back again into the bean? -- João Fernandes Adobe Certified Expert Adobe Community Expert http://www.onflexwithcf.org http://www.riapt.org Portugal Adobe User Group (http://aug.riapt.org)
Re: [flexcoders] Re: Illegible axis labels
In the case of gutterLeft, the increased gap is on the left of the axis title, which looks a little odd, unless I can compute it based on the size of the numbers on the axis, or at least as a percentage of the container size. It might be more fruitful to do a custom renderer to display 20 as 200K. But thanks for the tips. On Sat, Jan 17, 2009 at 12:09 PM, sunild99 sunilbd...@gmail.com wrote: --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Richard Rodseth rrods...@... wrote: Is there any way to control how much space is devoted to the axis compared to the chart? Or to control the width of a category (not of the column)? Or to set a minimum font size, after which the axis is dropped? You can use the gutter styles (gutterLeft, gutterRight, etc) to specify how much space is in between the chart and the edge of the chart control. Making your gutters bigger should allow more space for your axis labels. Sunil
[flexcoders] ContextMenuItem with a checkbox ?
Hi, I'd like to create a ContextMenuItem with a checkbox that toggles some behavior. Is this possible? Thanks! - Michael
[flexcoders] Re: Data Grid Issue
Hi Sanjay, Thanks lot for you reply. Please share that piece of code where in you are storing the index of selected row at the respective index of array. How did you u get the row which need to be selected, are you also calling a method on mouseOver function. I desperately need this functionality in my project. Please share your sample app if possible or have a look in my code below, please point me to the location where I need to focus. Regards, Dharmendra ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=init() backgroundColor=#b3b4ae mx:Script ![CDATA[ import mx.charts.HitData; import mx.controls.dataGridClasses.DataGridItemRenderer; import mx.events.ListEvent; import flash.utils.describeType; import flash.utils.getDefinitionByName; import mx.controls.Alert; import mx.formatters.DateFormatter; import mx.collections.ArrayCollection; // include MatsFormatter.as var selectedArr:Array = new Array(); var arrCol:ArrayCollection ; function init():void{ arrCol = new ArrayCollection([{name:'AA', age:25}, {name:'BB', age:15}, {name:'CC', age:23}, {name:'DD', age:25}, {name:'EE', age:15}, {name:'FF', age:23}, {name:'GG', age:25}, {name:'HH', age:15}, {name:'II', age:23}]); dg.dataProvider = arrCol; } var isMouseDown:Boolean = false; public function mouseDownFunc (mDn:flash.events.MouseEvent ):void{ //Alert.show(mouseDownFunc); isMouseDown = true; } public function mouseUpFunc (mUp:flash.events.MouseEvent ):void{ // Alert.show(mouseUpFunc); isMouseDown = false; // Work Around to select iterleaved unselected row /* var selectedArr2:Array = new Array(); var firstRowIndex :int = dg.selectedIndices[0] var lastRowIndex :int = dg.selectedIndices [dg.selectedIndices.length -1 ] if(firstRowIndex lastRowIndex){ for(var i:int = firstRowIndex; firstRowIndex= lastRowIndex;firstRowIndex++) selectedArr2.push(firstRowIndex); }else{ for(var j:int = lastRowIndex; lastRowIndex= firstRowIndex;lastRowIndex++) selectedArr2.push(lastRowIndex); } dg.selectedIndices = selectedArr2; */ } public function mouseOverFunc (mOver:MouseEvent,dgCol:ListEvent = null ):void{ var rend:Object; if(isMouseDown){ try{ selectedArr = dg.selectedIndices; selectedArr.push(mOver.target.listData.rowIndex); dg.selectedIndices = selectedArr; }catch(e:Error){ // rend = mOver.relatedObject ; } } } // Deprecated /* public function itemRollOverFunc(itmRollOver:ListEvent):void { if(isMouseDown){ try{ selectedArr = dg.selectedIndices; selectedArr.push(itmRollOver.rowIndex); dg.selectedIndices = selectedArr; }catch(e:Error){ trace(e.getStackTrace()); } } } */ ]] /mx:Script mx:Style DataGrid { backgroundColor:#b3b4ae; borderColor:#66696B; verticalGridLineColor :#808080; horizontalGridLineColor :#808080; themeColor:#0A246A; borderStyle:solid; fontSize: 8; headerStyleName: dgHeaderStyles; } .dgHeaderStyles { fontSize: 10; textAlign: left; backgroundColor: #d4d0c8; fontFamily :san Sarif; } /mx:Style !--mouseDown=mouseDownFunc(event) mouseUp=mouseUpFunc (event) mouseOver=mouseOverFunc(event)-- mx:Panel layout=absolute title=MATS Trade Management Console id=gridPanel left=5 right=5 top=5 bottom=5 themeColor=#B3B4AE mx:DataGrid width=50% height=50% headerColors=[#d4d0c8,#d4d0c8] horizontalScrollPolicy=auto allowMultipleSelection=true id=dg horizontalGridLines=truerowHeight=30
[flexcoders] IE freezing when closing a flex app the 2nd time ??
hmm.. i have a blank app like this: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute /mx:Application when i run it, it opens ie without problem.. if i close the browser, it closes without problems... but if i open a new window.. the app loads.. but when i try to close this browser now.. IE freeze.. and windows says the the app has stopped working... does this happen to anyone else or is it some kind of bug with my IE ? ps. IE 7 with flash player 10 debug installed
RE: [flexcoders] debug deep linking
Some things are better debugged using trace statements. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of yk96290 Sent: Sunday, January 18, 2009 6:38 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] debug deep linking In my flex application, when I click refresh button on the browser, the deep linking doesn't work for some items. I tried to debug the issue, but debug doesn't work for refresh button. Any comments? Thanks Karen
RE: [flexcoders] NPE on ToolTipManagerImpl/reset()
I would call dispatchMouseEvent(new MouseEvent()) on the tooltip From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rviswanathan Sent: Monday, January 19, 2009 4:21 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] NPE on ToolTipManagerImpl/reset() Hi I am reopening this thread. I am unable to get around this NPE issue. I tried to do the following Set the visibility of ToolTipManager.currentTooltip to false (instead of destroying it) Disable the tooltip when I make a service call and enable it on response. However, I still get the exception stated in my earlier mail below. The exception occurs either on mouseOut or mouseOver tool tip handlers and the trace leads all the way to ToolTipManagerImpl.reset() method. Thanks Regards Ram __ rviswanathan wrote: Thanks Alex. Since the destroyToolTip is public and the doc says not to call it on the currentToolTip, I'd probably think that it is used when we explicitly create and destroy tooltips. About faking the mouse event that you have mentioned, are you meaning that I need to add my own tooltipmouseouthandler and put in my logic in this handler? Thanks Ram Alex Harui wrote: The doc says don't call destroyToolTIp on the current tooltip. I'd search around to see if anyone else has a way of causing a tooltip to go away, but I'd probably do it by faking a mouse event instead of calling an mx_internal method. From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rviswanathan Sent: Sunday, November 30, 2008 11:52 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] NPE on ToolTipManagerImpl/reset() Hi All I am facing an NPE with tooltips, the problem is outlined below. Set up: (I use Flex 2.0) I have a UI where I have a datagrid that gets populated by data coming from a remote server call. My module contains a timer that sends out a refresh request (server call) to paint the datagrid with the latest data. This timer fires every 20 seconds. Also, when I point to a datagrid cell, I see the tooltip that shows the content of this cell. This is what I have done to disable and enable tooltips during the server call. a) Prior to makign the server call, I destroy the current tooltip using ToolTipManager.destroyToolTip(). I also set the ToolTipManager.currentToolTip to null. I also make ToolTipManager.enabled as false. b) On getting a response from the server, I set ToolTipManager.enabled as true. Now, here's the problem. I keep my mouse on a cell and a tooltip is displayed. At some time T, the 20 second timer fires that makes a server call. At this very same moment, I move my mouse out of the cell, so the tooltip's mouseouthandler gets called. I get an exception in ToolTipManagerImpl/reset() method. From the trace, it shows an NPE. This happens only when I move the mouse out of a tooltip and a refresh call to the server goes. The lines around getSystemManager(previousTarget) is where I think I hit an exception, probably because the system manager for the previousTarget is null and the next line throws an NPE, although I am not a 100% sure. From ToolTipManagerImpl.reset() method private function reset():void { if (currentToolTip) { // Remove it. var sm:ISystemManager = getSystemManager(previousTarget); sm.toolTipChildren.removeChild(DisplayObject(currentToolTip)); currentToolTip = null; } } Any pointers to overcome this would really help. Thanks Ram -- View this message in context: http://www.nabble.com/NPE-on-ToolTipManagerImpl-reset%28%29-tp20761439p20761439.html Sent from the FlexCoders mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/NPE-on-ToolTipManagerImpl-reset%28%29-tp20761439p21541940.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] Re: WipeLeft in a module with combobox error ??
Put a combobox in the main app. If the problem goes away, then it is a shared code problem. Otherwise, debug into it. The stack trace indicates that getStyle(cornerRadius) for some button is returning an invalid number. Maybe some style object is missing. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of rockorgames Sent: Monday, January 19, 2009 12:54 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: WipeLeft in a module with combobox error ?? the stack trace error from the code i posted ArgumentError: Error #2004: One of the parameters is invalid at flash.display::Graphics/drawRoundRect() at mx.skins::ProgrammaticSkin/drawRoundRect()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\skins\ProgrammaticSkin.as:745] at mx.skins.halo::ButtonSkin/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\skins\halo\ButtonSkin.as:217] at mx.skins::ProgrammaticSkin/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\skins\ProgrammaticSkin.as:421] at mx.managers::LayoutManager/validateClient()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:880] at mx.core::UIComponent/validateNow()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5679] at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::validateBaselinePosition()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5715] at mx.controls::ComboBase/get baselinePosition()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\ComboBase.as:313] at mx.containers::FormItem/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\FormItem.as:913] at mx.core::UIComponent/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6351] at mx.core::Container/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2677] at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:695] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aha...@... wrote: Usually a shared code problem. See the modules presentation on my blog. Post the stacktrace from the error. From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of rockorgames Sent: Sunday, January 18, 2009 5:29 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] WipeLeft in a module with combobox error ?? hey guys.. i have app with a module that has a form and some combobox in it.. also this same module has a removedEffect that is a wipeleft.. when the module is removed it generates a wierd error.. but if i remove the combobox from the module it doesnt generate error... i ll post a simple version of this error.. if some1 has any ideia of why this happens app: ?xml version=1.0 encoding=utf-8? mx:Application creationComplete=init() xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.controls.Alert; import mx.modules.Module; import mx.events.ModuleEvent; import mx.modules.ModuleManager; import mx.modules.IModuleInfo; public var info:IModuleInfo; public var xi:Module; private function init():void { info = ModuleManager.getModule(a.swf?Versao=1.0); info.addEventListener(ModuleEvent.READY, modEventHandler); info.load(); } private function modEventHandler(e:ModuleEvent):void { xi = info.factory.create() as Module ; addChild(xi); } public function remove():void { removeChild(xi); info.removeEventListener(ModuleEvent.READY, modEventHandler); info.unload(); info = null; xi=null; } ]] /mx:Script mx:WipeLeft id=wipeOut duration=600/ mx:Button x=200 y=176 id=lasal label=remove click=remove()/ /mx:Application module a: ?xml version=1.0 encoding=utf-8? mx:Module removedEffect=wipeOut xmlns:com=* xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute width=400 height=300 mx:Script ![CDATA[ [Bindable] private var dptest:Array = [item1, item2]; ]] /mx:Script mx:Form mx:FormItem mx:ComboBox dataProvider={dptest} / /mx:FormItem /mx:Form /mx:Module thx for ur time!!!
RE: [flexcoders] Drag And Drop Tree
If I remove your handlers, I can move Sent just fine. In your handler the following line is suspicious: var xml : XML = new XML(items); because items is an array. Use XML.toXMLString() to make sure you're trying to put in valid data. From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of claudiu ursica Sent: Monday, January 19, 2009 12:30 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Drag And Drop Tree Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From: Alex Harui aha...@adobe.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From: flexcod...@yahoogro ups.comhttp://ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxmlhttp://www.adobe.com/2006/mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. // taking all of the items in the DragSouce, insert them into the // tree using parent pointer. var xml : XML = new XML(items); var sucess : Boolean = myTree.dataDescript or.addChildAt( dropParent, xml, selectedIndex) ; //trace(sucess) ; } ]] /mx:Script mx:Tree id=myTree width=300 height=100% labelField=@label showRoot=false dataProvider={treeData} borderStyle=none dragEnabled=true dragMoveEnabled=true dropEnabled=true dragEnter=onDragEnter( event) dragDrop=onDragDrop(event) /mx:Tree mx:XMLList id=treeData node label=Mail Box node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Inbox node label=Marketing/ node label=Product Management/ node label=Personal/ /node node label=Outbox node label=Professional/ node label=Personal/ node label=Inbox node label=Marketing/ node label=Product Management/ /node node label=Personal/ /node node label=De mutat node
[flexcoders] one renderer forcing update of another
I have a datagrid with a renderer in each of 2 columns. The first column displays a combobox. When the combobox is changed on one row I want to update the data in the second column on the same row. Is there a way to do this?
[flexcoders] Re: Flex drop down horizontal menu
Thanks for the tip. Can this be used to display a menu for website navigation? I guess I'd need a NavigateToUrl tag to allow menu item links to navigate the xhtml web page. In other words, I'm wanting the Flex application to only be for the menu not a part of a complete site done in Flex. Can this be done? Also, will the Flex application need to have the height equivalent to the highest opened menu? Or is there a way to have the Flex application - the menu - hover over the content on the xhtml web page transparently? Bruce --- In flexcoders@yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: Take a look at the MenuBar control: http://livedocs.adobe.com/flex/3/langref/mx/controls/MenuBar.html Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Mon, Jan 19, 2009 at 12:06 AM, brucewhealton br...@... wrote: Hello all, I was wondering if anyone could share some tutorials on how to create a horizontal menu with drop-down sub-menus. Please let me know if you can think of any good examples with tutorials/script examples for learning, etc. Thanks, Bruce
Re: [flexcoders] Drag And Drop Tree
It can be moved around but cannot be dropped into a folder (branch) unless the folder is open. I was adding those handlers, so that i can drop item/items inside a closed node... And it works for branches but not for leaf nodes ... Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. The funny thing is that the accurate data seems to be there at a certain time when debugged, and i tried to store it in a private member of the component and that works fine for branches, it seems that it just looses the data it probably when dragging over a branch or I don''t know, but the length is still one so I end up in adding an empty leaf. That also happens for the dragComplete handler. Still adding an empty leaf... From: Alex Harui aha...@adobe.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Monday, January 19, 2009 11:01:07 PM Subject: RE: [flexcoders] Drag And Drop Tree If I remove your handlers, I can move Sent just fine. In your handler the following line is suspicious: var xml : XML = new XML(items); because items is an array. Use XML.toXMLString( ) to make sure you’re trying to put in valid data. From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of claudiu ursica Sent: Monday, January 19, 2009 12:30 AM To: flexcod...@yahoogro ups.com Subject: Re: [flexcoders] Drag And Drop Tree Hi Alex, I can move simple leafs from the root under a folder with no custom handlers, if the folder is open. However the thing is that I need to just put (maybe just copy not move) the item let's say for argument sake node label=Sent/ under Inbox folder. I cannot do that unless the sent is under some folder and move it with the folder, because otherwise the DragSource seeems to return an item but I cannot get the data from that item. So I end up dropping an empty item. However as said before If I move/copy a folder with items around it works fine ... The same happends with the drag complete handler, for just one item the drags source traces out to blank event though the length is 1. Claudiu From:Alex Harui aha...@adobe. com To: flexcod...@yahoogro ups.com flexcod...@yahoogro ups.com Sent: Monday, January 19, 2009 7:47:53 AM Subject: RE: [flexcoders] Drag And Drop Tree Setting breakpoints in drag/drop generally doesn’t work because you tend to release the mouse in order to dig through the debugging info and when you resume the drag is cancelled. Remove the custom drag event handlers and try with simple data and see if it works. We definitely tested drag/drop in Tree so basic cases work. One trick for Tree is that what happens on drop is different than in List. The node is removed before it is added in Tree, and sometimes that is done in dragComplete handler instead of dragDropHandler From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Claudiu Ursica Sent: Sunday, January 18, 2009 9:59 AM To: flexcod...@yahoogro ups.com Subject: [flexcoders] Drag And Drop Tree Hi I'm trying to implement the drag and drop functionality inside a tree, dragging and dropping inside the same tree. However It seems that I cannot drag and drop leaf nodes... When I handle enterDrag event the item seems to be appearing only at debug time and gets lost after that... here is the code.. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml layout=absolute mx:Script ![CDATA[ import mx.events.DragEvent ; import mx.managers. DragManager; import mx.core.UIComponent ; import mx.core.DragSource; private function onDragEnter( event : DragEvent) : void { var items : Array = event.dragSource. dataForFormat(treeItems) as Array; trace(items , items); //this only shows data for branches //if I try drag drop a leaf like spam for //instance I can see the node only when debugginh and when resuming the data is gone //when resuming even though the length is 1 } /** * The dragDrop event is dispatched when the mouse is released. * The Tree can still ignore the drop here */ private function onDragDrop(event : DragEvent) : void { var ds : DragSource = event.dragSource; var items : Array = ds.dataForFormat(treeItems) as Array; trace(items , items); //this display actually the drop node instead of the dragsource var dropTarget : Tree = Tree(event.currentT arget); var selectedIndex : int = myTree.calculateDro pIndex(event) ; myTree.selectedInde x = selectedIndex; var node : XML = myTree.selectedItem as XML; var dropParent : *; // if the selected node has children // then add the items at the beginning if(myTree.dataDescr iptor.hasChildre n(node)) { dropParent = node; selectedIndex = 0; } else { dropParent = node.parent( ); } // taking all of the items in the DragSouce, insert them into the // tree using parent pointer.
RE: [flexcoders] Re: Problems with POST or GET
Are you POST'ing to a host on a domain that is not the same as the domain hosting the SWF? Are you using HTTPS? If so, does it work when using HTTP? Does it happen in all browsers, or just a particular one?
Re: [flexcoders] hug cell contents in one cell on a datagrid
On 16-Jan-09, at 3:46 PM, dnk wrote: Curious Is there a way to force once cell of a datagrid to resize itself to hug the contents? I have an item renderer in a cell that changes size, and i wanted the datagrid cell to always resize with the contents. Thanks! d In an effort to put something together for this, i have written an event that passes the dimensions through. Now my problem is that the mx:DataGridColumn does not accept a height attribute. There has to be someway to deal with this. Any ideas? d
[flexcoders] Application language files
Hi guys, I want to store all my messages in a language class, common things like login fail messages etc, so I can easily change them later or perhaps add another language. I was talking with a friend about how best to do this, and we couldn't decide. At first we thought of making a LanguageManager singleton class with each translation as a const, but then we'd be bloating the application with unwanted languages. Maybe we could import a SWC at runtime with the correct language class? Can anyone suggest the best solution for working with languages? -- View this message in context: http://www.nabble.com/Application-language-files-tp21552940p21552940.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] Application language files
Take a look at ResourceManager, and the resource module examples in the Developer Guide. We use this method, and it's been working pretty smoothly. We compile with locale= (the empty string), so that resources are *always* loaded at runtime (we found that this simplified things a little). You can pre-load a specific resource module (based on flashvars, I believe), so it's available at startup, but we just have a non-localized login screen where the user picks a locale. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: Sceneshift j...@sceneshift.com Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Application language files Date: Mon, 19 Jan 2009 14:23:38 -0800 (PST) Hi guys, I want to store all my messages in a language class, common things like login fail messages etc, so I can easily change them later or perhaps add another language. I was talking with a friend about how best to do this, and we couldn't decide. At first we thought of making a LanguageManager singleton class with each translation as a const, but then we'd be bloating the application with unwanted languages. Maybe we could import a SWC at runtime with the correct language class? Can anyone suggest the best solution for working with languages? -- View this message in context: http://www.nabble.com/Application-language-files-tp21552940p21552940.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] LCDS - adding a new Item using createItem()
As long as your assembler's createItem method populates identity property of the item passed in, it should be returned to the client and updated there when the commit response is received by the client. To help diagnose why this is not happening, first upgrade to 2.6.1 (on the product download page) since it has better diagnostics than the earlier versions. Secondly, enable the server's debug log target for Service.*.In the logs, should see it calling your createItem method and what value gets returned for the identity property. If it all looks correct there, check the client mx:TraceTarget/ logs and make sure that value makes it back to the client. It should indicate in the client logs that it is updating the cache and that the id property is getting updated there. Jeff From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Besite - Bart Sent: Sunday, January 18, 2009 5:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] LCDS - adding a new Item using createItem() Hello, In my Data Management Service I create a new User-object using the createItem() function : ds.createItem(new User(Jeff)); var token:AsyncToken = ds.commit(); token.kind = create; When the commit is sent, the new User is persisted to the server... In my database an autoincrement id is generated, but the object returned to the Flex client has still an id equal to 0. How do I know the unique id of the created User-object on the client-side ? I need this unique id to do some remote calls as soon as it is created on the server... Any help is welcome ! Kind regards Bart inline: image001.jpginline: image002.jpg
Re: [flexcoders] Application language files
Thanks very much for your reply, I will look into this! Maciek Sakrejda wrote: Take a look at ResourceManager, and the resource module examples in the Developer Guide. We use this method, and it's been working pretty smoothly. We compile with locale= (the empty string), so that resources are *always* loaded at runtime (we found that this simplified things a little). You can pre-load a specific resource module (based on flashvars, I believe), so it's available at startup, but we just have a non-localized login screen where the user picks a locale. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com -Original Message- From: Sceneshift j...@sceneshift.com Reply-To: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Application language files Date: Mon, 19 Jan 2009 14:23:38 -0800 (PST) Hi guys, I want to store all my messages in a language class, common things like login fail messages etc, so I can easily change them later or perhaps add another language. I was talking with a friend about how best to do this, and we couldn't decide. At first we thought of making a LanguageManager singleton class with each translation as a const, but then we'd be bloating the application with unwanted languages. Maybe we could import a SWC at runtime with the correct language class? Can anyone suggest the best solution for working with languages? -- View this message in context: http://www.nabble.com/Application-language-files-tp21552940p21552940.html Sent from the FlexCoders mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Application-language-files-tp21552940p21553412.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Re: Flex Builder 3 crashes (Vista)
Hi Kevin, Thank you very much for such detailed instructions. First, I looked into the log - the exception I can see there is the following: !MESSAGE Error creating actionscript project for ui_login !STACK 1 org.eclipse.core.runtime.CoreException: Error Loading Project Then, I just recreated the new workspace and so far (2 days yet) have not got any crashes. Who-hoo! PS Do you have any idea why FlexBuilder.ini is ignored under Vista? Cheers, Dmitri. --- In flexcoders@yahoogroups.com, Kevin Benz kb...@... wrote: Been there, done that. OK.. There are two paths for you. Eclipse Errors: Eclipse makes mountains of log entries so you need to isolate Flex issues from Eclipse Issues. Go through the eclipse logs looking for errant components and Null Pointer Exceptions. Although the openness of eclipse encourages the addition of all kinds of great and not so great components (Java, Maven, Data Tools, JDT), I believe strongly that the Flex development environment should be sandboxed and kept single purpose. Yes, I have two eclipse installs. Flex: Flex issues like this, we have found to be resultant to the operation of Flex and the operation of SCM and SDK upgrades. I see you are using 3.0.2 which tells me your recently updated to the 3.2 SDK. I am convinced that Flex cannot handle an SDK upgrade well. Let me explain. We have a very large project that started during SDK 3.0 with the project files being checked into Subversion as 3.0 files. Now there are lots of argument regarding checking in project files as in most cases they can become platform and developer specific, after going to the 3.1 SDK we lost the ability to use the compiler options tab in the project properties window with Flex complaining about the SDK string value. After a few minutes the IDE becomes unstable and crashes. No matter what we did, we could not recover (copy files around between developers, manually fixup the SDK and locale strings). If you checked out your project again, you have project files built for a different SDK. In over for us to overcome this, here is what we do. 1. BACKUP EVERYTHING 2. Turn off automatic build 3. Find all instances of files with the .cache extension within the Flex plug-in directories THAT START WITH YOUR PROJECT NAME (for example myproject.cache) and remove them. They automatically come back when the compiler runs. 4. Use FlexBuilder to create a new Empty Workspace. Leave the old one alone if we need to get back to it. WE DO NOT MAKE ANY CHANGES TO THE OLD WORKSPACE 5. In FlexBuilder, create new copies of the project(s) in the new workspace USING THE EXACT NAMES OF THE PRESENT PROJECTS. Leaving these projects empty, in their initial state. This will create new project files with the correct SDK string, locale, etc etc. 6. Backup these new projects from the new workspace and put them aside. 7. If using SCM, checkout the project(s) into the new workspace OR if not using SCM, copy OLD project(s) into the new workspace directory. THIS IS IMPORTANT AS YOU CANNOT RELIABLY MOVE A FOLDER UNDER SCM AND HAVE IT WORK. IT SHOULD BE CHECKED OUT AGAIN. 8. From your new workspace, recently checked out or copied, remove the following files .project .actionSciptProperties .flexProperties /.settings/org.eclipse.core.resources.prefs 9. Copy the empty versions of these files (that were put aside) into the new workspace. 10. Start FlexBuilder and on each project's properties, enter the Library Build Path, on the classes tab and uncheck /src and save/close that form. THEN go back in and check that checkbox, close (this forces Flexbuilder to walk the filesystem and update its catalog of local classes) and save that form. You are basically faking an import 11. Back in Library Build Path, the project may need any swc's or referenced projects that were in the old project configuration. 12. Turn back on automatic build. KFB From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Dmitri Girski Sent: Saturday, January 17, 2009 6:38 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex Builder 3 crashes (Vista) Hi everybody, After some absolutely painless 6 months run, my Flex Builder 3 (3.0.2) started to crash every 10-15 minutes under Vista (I know, I know, this is beyond my control, I have to live with this). The only one thing which actually changed is Flash CS4 - all components have been recompiled using Flash CS4 for FP9. There is some difference as these components now visible all the time in the Design View. SWCs compiled with Flash CS3 were very freaky in Design View. Here is the Java Screen Of Death: http://mitek.id.au/flex/builder_crash.jpg A couple of questions: 1. Why Xmx Xms parameters are repeated twice (see the screenshot)? 2. Why Flex Builder
RE: [flexcoders] one renderer forcing update of another
Yes. The core concept here is that itemRenderers must be data driven to work correctly. If your first renderer updates the dataProvider item, then the second one, which should be driven by the dataProvider, will update automatically. Remember, all itemRenderers have access to the entire row's data, via the data property. How advanced are your itemRenderer skills? Do you understand about the set data() override, the call to invalidateProperties(), commitProperties(), createChildren() and updateDisplayList() methods? Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of darylgmyers Sent: Monday, January 19, 2009 4:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] one renderer forcing update of another I have a datagrid with a renderer in each of 2 columns. The first column displays a combobox. When the combobox is changed on one row I want to update the data in the second column on the same row. Is there a way to do this?
RE: [flexcoders] Re: Problems with POST or GET
Also, do you have a fault handler? Have you checked to see if it is being called? Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Peter Farland Sent: Monday, January 19, 2009 4:39 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Problems with POST or GET Are you POST'ing to a host on a domain that is not the same as the domain hosting the SWF? Are you using HTTPS? If so, does it work when using HTTP? Does it happen in all browsers, or just a particular one?
RE: [flexcoders] Re: Flex Builder 3 crashes (Vista)
On Vista, I would search for other copies of that file in weird places. A synchronization folder for example. I have no experience running FlexBuilder(FB) on Vista as I prefer to avoid painful challenges where I can. Here is an idea for you (although a little off topic). We don't install the full FB IDE but rather do the follow.. It also makes FB a lot faster and reduces the memory overhead.. This may seem really strange. All of our developers install the C++ version of Eclipse 3.3.2 and then disable the C++ plug-in. Then install the FB plug-in. There is just so much goo that comes in with standard FB from Java and JDT that when you will be surprised how quickly it boots. Downside is that those who do both Java and FB end up with two installs but we try to isolate Flex developers from IDE pain so I don't let them install many plug-ins anyway. The way the MXML preview component leaks memory, you have to take whatever shortcuts you can. KFB From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Dmitri Girski Sent: Monday, January 19, 2009 2:56 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex Builder 3 crashes (Vista) Hi Kevin, Thank you very much for such detailed instructions. First, I looked into the log - the exception I can see there is the following: !MESSAGE Error creating actionscript project for ui_login !STACK 1 org.eclipse.core.runtime.CoreException: Error Loading Project Then, I just recreated the new workspace and so far (2 days yet) have not got any crashes. Who-hoo! PS Do you have any idea why FlexBuilder.ini is ignored under Vista? Cheers, Dmitri. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Kevin Benz kb...@... wrote: Been there, done that. OK.. There are two paths for you. Eclipse Errors: Eclipse makes mountains of log entries so you need to isolate Flex issues from Eclipse Issues. Go through the eclipse logs looking for errant components and Null Pointer Exceptions. Although the openness of eclipse encourages the addition of all kinds of great and not so great components (Java, Maven, Data Tools, JDT), I believe strongly that the Flex development environment should be sandboxed and kept single purpose. Yes, I have two eclipse installs. Flex: Flex issues like this, we have found to be resultant to the operation of Flex and the operation of SCM and SDK upgrades. I see you are using 3.0.2 which tells me your recently updated to the 3.2 SDK. I am convinced that Flex cannot handle an SDK upgrade well. Let me explain. We have a very large project that started during SDK 3.0 with the project files being checked into Subversion as 3.0 files. Now there are lots of argument regarding checking in project files as in most cases they can become platform and developer specific, after going to the 3.1 SDK we lost the ability to use the compiler options tab in the project properties window with Flex complaining about the SDK string value. After a few minutes the IDE becomes unstable and crashes. No matter what we did, we could not recover (copy files around between developers, manually fixup the SDK and locale strings). If you checked out your project again, you have project files built for a different SDK. In over for us to overcome this, here is what we do. 1. BACKUP EVERYTHING 2. Turn off automatic build 3. Find all instances of files with the .cache extension within the Flex plug-in directories THAT START WITH YOUR PROJECT NAME (for example myproject.cache) and remove them. They automatically come back when the compiler runs. 4. Use FlexBuilder to create a new Empty Workspace. Leave the old one alone if we need to get back to it. WE DO NOT MAKE ANY CHANGES TO THE OLD WORKSPACE 5. In FlexBuilder, create new copies of the project(s) in the new workspace USING THE EXACT NAMES OF THE PRESENT PROJECTS. Leaving these projects empty, in their initial state. This will create new project files with the correct SDK string, locale, etc etc. 6. Backup these new projects from the new workspace and put them aside. 7. If using SCM, checkout the project(s) into the new workspace OR if not using SCM, copy OLD project(s) into the new workspace directory. THIS IS IMPORTANT AS YOU CANNOT RELIABLY MOVE A FOLDER UNDER SCM AND HAVE IT WORK. IT SHOULD BE CHECKED OUT AGAIN. 8. From your new workspace, recently checked out or copied, remove the following files .project .actionSciptProperties .flexProperties /.settings/org.eclipse.core.resources.prefs 9. Copy the empty versions of these files (that were put aside) into the new workspace. 10. Start FlexBuilder and on each project's properties, enter the Library Build Path, on the classes tab and uncheck /src and save/close that form. THEN go back in and check that checkbox, close (this forces Flexbuilder to walk the filesystem and update its catalog of local
Re: [flexcoders] Facebook Connect and Flex
http://code.google.com/p/facebook-actionscript-api/ A library of facebook api, and you would try. On Tue, Jan 20, 2009 at 2:13 AM, Daniel Tse danpr...@gmail.com wrote: Hi, Has anyone had experience implementing Facebook connect with Flex/Air Apps? If so, can someone point to an example? Thanks, -Daniel
Re: [flexcoders]How would you rewrite this isset PHP condition in AS3?
i use hasOwnProperty in the function i posted but i can only use it to check immediate properties. it doesn't support nested properties, for example var obj:Object = new Object(); obj.apple = new Object(); obj.apple.color = red; // hasOwnProperty doesn't support nested properties var b1:Boolean = obj.hasOwnProperty(apple.color); // returns false var b2:Boolean = obj.hasOwnProperty(banana.color); // returns false var b3:* = typeof(obj.apple.color); // returns string var b4:* = typeof(obj.banana.color); // Error #1010: A term is undefined and has no properties. On Mon, Jan 19, 2009 at 10:20 AM, Sam Lai samuel@gmail.com wrote: The hasOwnProperty method available in all objects does exactly this. http://livedocs.adobe.com/flex/3/langref/Object.html#hasOwnProperty() Why it is called hasOwnProperty rather than hasProperty I have no idea. 2009/1/19 dorkie dork from dorktown dorkiedorkfromdorkt...@gmail.comdorkiedorkfromdorktown%40gmail.com : late night... thanks On Sun, Jan 18, 2009 at 10:05 AM, Ralf Bokelberg ralf.bokelb...@gmail.com ralf.bokelberg%40gmail.com wrote: doesn't try catch help here? If no error is thrown, isset returns true ralf On Sun, Jan 18, 2009 at 1:46 PM, dorkie dork from dorktown dorkiedorkfromdorkt...@gmail.com dorkiedorkfromdorktown%40gmail.com wrote: I have a PHP statement that I am trying to write in AS3. So far it errors out because the properties do not exist on it yet. How would/should I rewrite this for AS3? Here is the statement: // at the time this is run this.language_data is an object with 2 properties // the STYLES property does not exist yet and it generates a // TypeError: Error #1010: A term is undefined and has no properties. if (isset(this.language_data['STYLES']['BRACKETS'][0])) { ddfd
[flexcoders] Re: Problems with POST or GET
Yes, I am posting to the same domain. No, I am not using HTTPS. It's happening in different browsers. --- In flexcoders@yahoogroups.com, Peter Farland pfarl...@... wrote: Are you POST'ing to a host on a domain that is not the same as the domain hosting the SWF? Are you using HTTPS? If so, does it work when using HTTP? Does it happen in all browsers, or just a particular one?
[flexcoders] Re: Problems with POST or GET
I have Alert box in a fault handler. Never seen it's popping. --- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote: Also, do you have a fault handler? Have you checked to see if it is being called? Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Peter Farland Sent: Monday, January 19, 2009 4:39 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Problems with POST or GET Are you POST'ing to a host on a domain that is not the same as the domain hosting the SWF? Are you using HTTPS? If so, does it work when using HTTP? Does it happen in all browsers, or just a particular one?
Re: [flexcoders]How would you rewrite this isset PHP condition in AS3?
Oh. My bad - should read the entire thread first before posting. I had a similar need, and ended up doing it in a loop like you did, mainly because from the languages I've used before, exceptions tend to be 'expensive' in terms of computation time. Not sure what the case is with AS3. 2009/1/20 dorkie dork from dorktown dorkiedorkfromdorkt...@gmail.com: i use hasOwnProperty in the function i posted but i can only use it to check immediate properties. it doesn't support nested properties, for example var obj:Object = new Object(); obj.apple = new Object(); obj.apple.color = red; // hasOwnProperty doesn't support nested properties var b1:Boolean = obj.hasOwnProperty(apple.color); // returns false var b2:Boolean = obj.hasOwnProperty(banana.color); // returns false var b3:* = typeof(obj.apple.color); // returns string var b4:* = typeof(obj.banana.color); // Error #1010: A term is undefined and has no properties. On Mon, Jan 19, 2009 at 10:20 AM, Sam Lai samuel@gmail.com wrote: The hasOwnProperty method available in all objects does exactly this. http://livedocs.adobe.com/flex/3/langref/Object.html#hasOwnProperty() Why it is called hasOwnProperty rather than hasProperty I have no idea. 2009/1/19 dorkie dork from dorktown dorkiedorkfromdorkt...@gmail.com: late night... thanks On Sun, Jan 18, 2009 at 10:05 AM, Ralf Bokelberg ralf.bokelb...@gmail.com wrote: doesn't try catch help here? If no error is thrown, isset returns true ralf On Sun, Jan 18, 2009 at 1:46 PM, dorkie dork from dorktown dorkiedorkfromdorkt...@gmail.com wrote: I have a PHP statement that I am trying to write in AS3. So far it errors out because the properties do not exist on it yet. How would/should I rewrite this for AS3? Here is the statement: // at the time this is run this.language_data is an object with 2 properties // the STYLES property does not exist yet and it generates a // TypeError: Error #1010: A term is undefined and has no properties. if (isset(this.language_data['STYLES']['BRACKETS'][0])) { ddfd
[flexcoders] float-safe bitwise AND comparison
Please, anyone with skills to convert the following php function to flex? i'm killing myself trying... please... anyone? thanks rafael - /** * Perform a float-safe bitwise AND comparison * * @param int/float $number The number to which to perform a bitwise AND * @param int/float $comparison The number with which to perform a bitwise AND * @return bool */ function safeBitCheck($number,$comparison) { if( $number 2147483647 ) { return ($number $comparison)==$comparison; } else { $binNumber = strrev(base_convert($number,10,2)); $binComparison = strrev(base_convert($comparison,10,2)); for( $i=0; $istrlen($binComparison); $i++ ) { if( strlen($binNumber)$i || ($binComparison{$i}===1 $binNumber{$i}===0) ) { return false; } } return true; } } safeBitCheck(17,16); // true safeBitCheck(17,2); // false safeBitCheck((4294967296+8589934592),4294967296); // true safeBitCheck(2,8589934592); // false
Re: [flexcoders] float-safe bitwise AND comparison
Does result = (uint(number) uint(comparison)) work? -Josh 2009/1/20 Rafael Faria rafaelfaria.gru...@gmail.com Please, anyone with skills to convert the following php function to flex? i'm killing myself trying... please... anyone? thanks rafael - /** * Perform a float-safe bitwise AND comparison * * @param int/float $number The number to which to perform a bitwise AND * @param int/float $comparison The number with which to perform a bitwise AND * @return bool */ function safeBitCheck($number,$comparison) { if( $number 2147483647 ) { return ($number $comparison)==$comparison; } else { $binNumber = strrev(base_convert($number,10,2)); $binComparison = strrev(base_convert($comparison,10,2)); for( $i=0; $istrlen($binComparison); $i++ ) { if( strlen($binNumber)$i || ($binComparison{$i}===1 $binNumber{$i}===0) ) { return false; } } return true; } } safeBitCheck(17,16); // true safeBitCheck(17,2); // false safeBitCheck((4294967296+8589934592),4294967296); // true safeBitCheck(2,8589934592); // false -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: j...@gfunk007.com :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk
[flexcoders] internationalization
I'm working on a project that requires multiple languages. I'm thinking I have two choices... 1) Use an XML file to change the text to different languages 2) Create a query/remote object through coldfusion to pull the different language. Are those my only options? Or should I say, what is the best way to do this? Has anyone done this or come across any articles? The articles I've found thus far deal with changing the currency/calendar/etc.. While that is something that I need to use, it's not the whole story... Thanks much. Scott
Re: [flexcoders] internationalization
Scott wrote: I'm working on a project that requires multiple languages. I'm thinking I have two choices... resource bundles (sort of) just like in cf. find it kind of funny that flex has resource bundles but lacks the other i18n bits while cf is just the opposite ;-) in any case, you'll probably want to use this puppy: http://as3localedata.riaforge.org/
Re: [flexcoders] internationalization
That's a hella useful link Paul. I'm not doing any I18N *now*, but that's going into del.icio.us :) Cheers, -Josh 2009/1/20 Paul Hastings paul.hasti...@gmail.com Scott wrote: I'm working on a project that requires multiple languages. I'm thinking I have two choices... resource bundles (sort of) just like in cf. find it kind of funny that flex has resource bundles but lacks the other i18n bits while cf is just the opposite ;-) in any case, you'll probably want to use this puppy: http://as3localedata.riaforge.org/ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: j...@gfunk007.com :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk
[flexcoders] Re: float-safe bitwise AND comparison
Thanks Josh. I kinda managed to get it working. so for the records if someone else need it, it seems to work fine. private function safeBitCheck(num:Number,comparison:Number):Boolean { if(num 2147483647 ) { return (num comparison)==comparison; } else { var binNumber:String = strrev(base_convert(num,10,2)); var binComparison:String = strrev(base_convert(comparison,10,2)); for(var i:uint=0; ibinComparison.length; i++ ) { if( binNumber.length i || (binComparison.charAt(i)===1 binNumber.charAt(i)===0) ) { return false; } } return true; } } public function strrev(str:String):String { return str.split().reverse().join(); } public function base_convert(num:Number, frombase:Number, tobase:Number):String { return parseInt(num+'', frombase+0).toString(tobase+0); } --- In flexcoders@yahoogroups.com, Josh McDonald dzn...@... wrote: Does result = (uint(number) uint(comparison)) work? -Josh 2009/1/20 Rafael Faria rafaelfaria.gru...@... Please, anyone with skills to convert the following php function to flex? i'm killing myself trying... please... anyone? thanks rafael - /** * Perform a float-safe bitwise AND comparison * * @param int/float $number The number to which to perform a bitwise AND * @param int/float $comparison The number with which to perform a bitwise AND * @return bool */ function safeBitCheck($number,$comparison) { if( $number 2147483647 ) { return ($number $comparison)==$comparison; } else { $binNumber = strrev(base_convert($number,10,2)); $binComparison = strrev(base_convert($comparison,10,2)); for( $i=0; $istrlen($binComparison); $i++ ) { if( strlen($binNumber)$i || ($binComparison{$i}===1 $binNumber{$i}===0) ) { return false; } } return true; } } safeBitCheck(17,16); // true safeBitCheck(17,2); // false safeBitCheck((4294967296+8589934592),4294967296); // true safeBitCheck(2,8589934592); // false -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: j...@... :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk
Re: [flexcoders] Re: float-safe bitwise AND comparison
This method is 10x faster, and more accurate (although the word is meaningless at such scale due to the nature of IEEE floats): private function safeBitCheck2(l : Number, r : Number) : Boolean { if (r l) return false; if (r == l) return true; if ((l = uint.MAX_VALUE) (r = uint.MAX_VALUE)) return (l r) == r; var rs : String = r.toString(32); var ls : String = l.toString(32).substring(-rs.length); var split : uint = uint(rs.length) 1; if (safeBitCheck2(parseInt(ls.substr(0, split), 32), parseInt(rs.substr(0, split), 32))) return safeBitCheck2(parseInt(ls.substr(split), 32), parseInt(rs.substr(split), 32)); return false; } What on earth do you actually need this function for? -Josh 2009/1/20 Rafael Faria rafaelfaria.gru...@gmail.com Thanks Josh. I kinda managed to get it working. so for the records if someone else need it, it seems to work fine. private function safeBitCheck(num:Number,comparison:Number):Boolean { if(num 2147483647 ) { return (num comparison)==comparison; } else { var binNumber:String = strrev(base_convert(num,10,2)); var binComparison:String = strrev(base_convert(comparison,10,2)); for(var i:uint=0; ibinComparison.length; i++ ) { if( binNumber.length i || (binComparison.charAt(i)===1 binNumber.charAt(i)===0) ) { return false; } } return true; } } public function strrev(str:String):String { return str.split().reverse().join(); } public function base_convert(num:Number, frombase:Number, tobase:Number):String { return parseInt(num+'', frombase+0).toString(tobase+0); } --- In flexcoders@yahoogroups.com, Josh McDonald dzn...@... wrote: Does result = (uint(number) uint(comparison)) work? -Josh 2009/1/20 Rafael Faria rafaelfaria.gru...@... Please, anyone with skills to convert the following php function to flex? i'm killing myself trying... please... anyone? thanks rafael - /** * Perform a float-safe bitwise AND comparison * * @param int/float $number The number to which to perform a bitwise AND * @param int/float $comparison The number with which to perform a bitwise AND * @return bool */ function safeBitCheck($number,$comparison) { if( $number 2147483647 ) { return ($number $comparison)==$comparison; } else { $binNumber = strrev(base_convert($number,10,2)); $binComparison = strrev(base_convert($comparison,10,2)); for( $i=0; $istrlen($binComparison); $i++ ) { if( strlen($binNumber)$i || ($binComparison{$i}===1 $binNumber{$i}===0) ) { return false; } } return true; } } safeBitCheck(17,16); // true safeBitCheck(17,2); // false safeBitCheck((4294967296+8589934592),4294967296); // true safeBitCheck(2,8589934592); // false -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: j...@... :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: j...@gfunk007.com :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk
Re: [flexcoders] Re: Flex drop down horizontal menu
Yes you can use it as a menu for a website. A pure flash menu would be perhaps lighter, but I don't know by how much. For the navigation you have to use flash.net.navigateToURL(). The Flax app must have the height of the highest opened menu otherwise it will be truncated. But you can make the background of the app transparent (set the alphas to 0) and put it in a div on the top of the html page. For the div, use absolute positioning and give it the highest z-index. Use javascript to embed the app, use 'transparent' for the 'wmode' parameter and give a html-only replacement for the menu (even if it's a simple list). Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Mon, Jan 19, 2009 at 10:27 PM, brucewhealton br...@futurewavedesigns.com wrote: Thanks for the tip. Can this be used to display a menu for website navigation? I guess I'd need a NavigateToUrl tag to allow menu item links to navigate the xhtml web page. In other words, I'm wanting the Flex application to only be for the menu not a part of a complete site done in Flex. Can this be done? Also, will the Flex application need to have the height equivalent to the highest opened menu? Or is there a way to have the Flex application - the menu - hover over the content on the xhtml web page transparently? Bruce --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: Take a look at the MenuBar control: http://livedocs.adobe.com/flex/3/langref/mx/controls/MenuBar.html Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Mon, Jan 19, 2009 at 12:06 AM, brucewhealton br...@... wrote: Hello all, I was wondering if anyone could share some tutorials on how to create a horizontal menu with drop-down sub-menus. Please let me know if you can think of any good examples with tutorials/script examples for learning, etc. Thanks, Bruce