[flexcoders] Image Marquee
I am pretty new to Flex but a vet in the programming world so Action Script 3 is great and I think I am coming along quickly with it. I am trying to create a footer bar 800w 60h that will display an animated marquee of all the images i load from an xml file. I have about 30 images in there right now. I am using a tile list to display them and the way I have it the first 8 are showing up. Is there a way to animate the rest of the images in a scrolling animation or am I completely on the wrong track here? Here is what I have so far, any help is greatly appreciated! *main.xml* ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=doComplete() width=855 height=60 mx:Script ![CDATA[ import mx.controls.Image; private var loader:URLLoader; [Bindable] private var xml:XML; private function doComplete():void { loader = new URLLoader(); loader.addEventListener(Event.COMPLETE,onComplete); loader.load(new URLRequest(images.xml)); } private function onComplete(e:Event):void { xml = new XML(e.target.data); } ]] /mx:Script mx:TileList id=tl columnWidth=100 rowHeight=60 width=855 height=60 backgroundColor=#66 horizontalScrollPolicy=off verticalScrollPolicy=off rollOverColor=#66 dataProvider={xml.image.src} itemRenderer=mx.controls.Image direction=horizontal /mx:TileList /mx:Application *images.xml* ?xml version=1.0 encoding=utf-8? images image nameaetna/name srcimages/aetna.gif/src linkhttp://www.yahoo.com/link /image /images -- Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] Security Model
I am having a hard time understand the flash player security model. I am trying to write some web serverice examples and for everyone I keep getting the following error. Warning: Domain services.digg.com does not specify a meta-policy. Applying default meta-policy 'all'. This configuration is deprecated. See http://www.adobe.com/go/strict_policy_files to fix this problem. Is this a problem with me or with the cross domain policy on the providers side. If it is on there end it really does not make much sense to me. All of these web services work in the http request world so why doesnt it work here. Do I need to go around and start asking others to fix it or is this a problem on my end? Dan
[flexcoders] Flex Book
I downloaded a great component from http://www.quietlyscheming.com/blog/ and I am trying to customize it and I am coming across a problem. The example uses mx:XML and if understand that is acompile time tag. I want to load the xml at runtime so I changed the code. Here is my code and this is the error I keep getting. Does anyone know what I am doing wrong? ERROR [SWF] /*/bin-debug/ElginAds.swf - 765,388 bytes after decompression TypeError: Error #1009: Cannot access a property or method of a null object reference. at qs.controls::FlexBook/fillPage()[C:\Program Files\Apache\htdocs\*\src\qs\controls\FlexBook.as:656] at qs.controls::FlexBook/commitProperties()[C:\Program Files\Apache\htdocs\*\src\qs\controls\FlexBook.as:771] at mx.core::UIComponent/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:5660] at mx.managers::LayoutManager/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:517] at mx.managers::LayoutManager/doPhasedInstantiation ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:637] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2 ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8450] at mx.core::UIComponent/callLaterDispatcher ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8393] ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:l=* layout=absolute xmlns:controls=qs.controls.* creationComplete=initApp(); xmlns:containers=qs.containers.* xmlns:effects=qs.effects.* width=720 height=430 mx:Style FlexBook { color: #00; textRollOverColor: #00; border-thickness: 0; border-style: none; page-slope: .6; active-grab-area: page; page-shadow-strength: 1; curve-shadow-strength: 1; auto-turn-duration: 1500; } Application { color: #F1F1CC; textRollOverColor: #000; backgroundColor: #ff; } SuperImage { border-thickness: 0; border-style: none; } /mx:Style mx:Script ![CDATA[ //imports import qs.caching.ContentCache; import qs.controls.flexBookClasses.FlexBookEvent; import mx.core.UIComponent; //bindable variables [Bindable] private var dataSet:XMLList; //variables private var loader:URLLoader; private function initApp():void{ loader = new URLLoader(); loader.addEventListener(Event.COMPLETE,onComplete); loader.load(new URLRequest('data/images.xml')); } private function next():void { if(book.currentPageIndex+1 book.pageCount) book.turnToPage(book.currentPageIndex + 1); } private function previous():void { if(book.currentPageIndex 0) book.turnToPage(book.currentPageIndex -12); } private function onComplete(e:Event):void { var xml:XML = new XML(e.target.data); var thumbs:XMLList = [EMAIL PROTECTED]; dataSet = xml..image; } private function loadContent(event:FlexBookEvent):void { var page:ImagePage = ImagePage(event.renderer); page.load(); } ]] /mx:Script controls:FlexBook id=book y=47 width=600 top=40 height=400 horizontalCenter=0 animateCurrentPageIndex=true showCornerTease=true edgeAndCornerSize=150 itemRenderer=ImagePage content={dataSet} turnStart=loadContent(event) animatePagesOnTurn=true turnEnd=loadContent(event) / /mx:Application -- Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Flex Book
The problem with that is mx:XML is a compile time tag, the xml file will change on the server. Dan On Fri, Feb 15, 2008 at 11:41 AM, Rob Rusher [EMAIL PROTECTED] wrote: Simplify your code by using the mx:XML tag and set it's source property to the path to your XML. mx:XML id=myXML source=data/images.xml/ Your xml might look like: images image thumb=assets/thumb1.jpg/ ... Then reference it as myXML.image.thumb. HTH Rob On Fri, Feb 15, 2008 at 9:31 AM, Dan Vega [EMAIL PROTECTED] wrote: I downloaded a great component from http://www.quietlyscheming.com/blog/ and I am trying to customize it and I am coming across a problem. The example uses mx:XML and if understand that is acompile time tag. I want to load the xml at runtime so I changed the code. Here is my code and this is the error I keep getting. Does anyone know what I am doing wrong? ERROR [SWF] /*/bin-debug/ElginAds.swf - 765,388 bytes after decompression TypeError: Error #1009: Cannot access a property or method of a null object reference. at qs.controls::FlexBook/fillPage()[C:\Program Files\Apache\htdocs\*\src\qs\controls\FlexBook.as:656] at qs.controls::FlexBook/commitProperties()[C:\Program Files\Apache\htdocs\*\src\qs\controls\FlexBook.as:771] at mx.core::UIComponent/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:5660] at mx.managers::LayoutManager/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:517] at mx.managers::LayoutManager/doPhasedInstantiation ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:637] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2 ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8450] at mx.core::UIComponent/callLaterDispatcher ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8393] ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:l=* layout=absolute xmlns:controls=qs.controls.* creationComplete=initApp(); xmlns:containers=qs.containers.* xmlns:effects=qs.effects.* width=720 height=430 mx:Style FlexBook { color: #00; textRollOverColor: #00; border-thickness: 0; border-style: none; page-slope: .6; active-grab-area: page; page-shadow-strength: 1; curve-shadow-strength: 1; auto-turn-duration: 1500; } Application { color: #F1F1CC; textRollOverColor: #000; backgroundColor: #ff; } SuperImage { border-thickness: 0; border-style: none; } /mx:Style mx:Script ![CDATA[ //imports import qs.caching.ContentCache; import qs.controls.flexBookClasses.FlexBookEvent; import mx.core.UIComponent; //bindable variables [Bindable] private var dataSet:XMLList; //variables private var loader:URLLoader; private function initApp():void{ loader = new URLLoader(); loader.addEventListener(Event.COMPLETE,onComplete); loader.load(new URLRequest('data/images.xml')); } private function next():void { if(book.currentPageIndex+1 book.pageCount) book.turnToPage(book.currentPageIndex + 1); } private function previous():void { if(book.currentPageIndex 0) book.turnToPage(book.currentPageIndex -12); } private function onComplete(e:Event):void { var xml:XML = new XML(e.target.data); var thumbs:XMLList = [EMAIL PROTECTED]; dataSet = xml..image; } private function loadContent(event:FlexBookEvent):void { var page:ImagePage = ImagePage(event.renderer); page.load(); } ]] /mx:Script controls:FlexBook id=book y=47 width=600 top=40 height=400 horizontalCenter=0 animateCurrentPageIndex=true showCornerTease=true edgeAndCornerSize=150 itemRenderer=ImagePage content={dataSet} turnStart=loadContent(event) animatePagesOnTurn=true turnEnd=loadContent(event) / /mx:Application -- Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org -- -- Regards, Rob Rusher
Re: [flexcoders] Flex Book
Rob, Great tip on using http instead of xml. The problem I am having now is I think the component is trying to load before the service is completed. I don't think the dataSet is filled when the component is setting up. I tried to create the component in AS but it would not let me. Any help is appreciated, I am racking my brain over this. Dan [SWF] //bin-debug/.swf - 925,285 bytes after decompression TypeError: Error #1009: Cannot access a property or method of a null object reference. at /loadContent()[C:\Program Files\Apache\htdocs\src\.mxml:62] at /__book_turnEnd()[C:\Program Files\Apache\htdocs\\src\.mxml:85] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:9041] at qs.controls::FlexBook/dispatchEventForPage()[C:\Program Files\Apache\htdocs\\src\qs\controls\FlexBook.as:733] at qs.controls::FlexBook/commitProperties()[C:\Program Files\Apache\htdocs\\src\qs\controls\FlexBook.as:777] at mx.core::UIComponent/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:5660] at mx.managers::LayoutManager/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:517] at mx.managers::LayoutManager/doPhasedInstantiation ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:637] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2 ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8450] at mx.core::UIComponent/callLaterDispatcher ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8393] here is my code ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:l=* layout=absolute xmlns:controls=qs.controls.* creationComplete=initApp(); xmlns:containers=qs.containers.* xmlns:effects=qs.effects.* width=720 height=430 mx:Style FlexBook { color: #00; textRollOverColor: #00; border-thickness: 0; border-style: none; page-slope: .6; active-grab-area: page; page-shadow-strength: 1; curve-shadow-strength: 1; auto-turn-duration: 1500; } Application { color: #F1F1CC; textRollOverColor: #000; backgroundColor: #ff; } SuperImage { border-thickness: 0; border-style: none; } /mx:Style mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; import qs.caching.ContentCache; import qs.controls.flexBookClasses.FlexBookEvent; import mx.core.UIComponent; //variables private var loader:URLLoader; private function initApp():void{ dataSet.send(); dataSet.addEventListener(ResultEvent.RESULT,onResult); } private function onResult(e:Event):void { var thumbs:XMLList = [EMAIL PROTECTED]; for(var i:int =0;ithumbs.length();i++) { ContentCache.getCache().preloadContent(thumbs[i]); } } private function loadContent(event:FlexBookEvent):void { var page:ImagePage = ImagePage(event.renderer); page.load(); } private function next():void { if(book.currentPageIndex+1 book.pageCount) book.turnToPage(book.currentPageIndex + 1); } private function previous():void { if(book.currentPageIndex 0) book.turnToPage(book.currentPageIndex -12); } ]] /mx:Script mx:HTTPService id=dataSet url=data/images.xml resultFormat=e4x / controls:FlexBook id=book width=720 height=430 horizontalCenter=0 backgroundColor=#00 animateCurrentPageIndex=true showCornerTease=true edgeAndCornerSize=150 itemRenderer=ImagePage content={dataSet.lastResult..image} turnStart=loadContent(event) animatePagesOnTurn=true turnEnd=loadContent(event) / /mx:Application
Re: [flexcoders] Flex Book
Well the component needs the data from the httpservice so somehow i need to call the component when the service is completed. Dan On Fri, Feb 15, 2008 at 4:34 PM, Phil Krasko [EMAIL PROTECTED] wrote: CreationComplete on component call the httpservice Sent via BlackBerry from T-Mobile -Original Message- From: Dan Vega [EMAIL PROTECTED] Date: Fri, 15 Feb 2008 15:55:24 To:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Flex Book Rob, Great tip on using http instead of xml. The problem I am having now is I think the component is trying to load before the service is completed. I don't think the dataSet is filled when the component is setting up. I tried to create the component in AS but it would not let me. Any help is appreciated, I am racking my brain over this. Dan [SWF] //bin-debug/.swf - 925,285 bytes after decompression TypeError: Error #1009: Cannot access a property or method of a null object reference. at /loadContent()[C:\Program Files\Apache\htdocs\src\.mxml:62] at /__book_turnEnd()[C:\Program Files\Apache\htdocs\\src\.mxml:85] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:9041] at qs.controls::FlexBook/dispatchEventForPage()[C:\Program Files\Apache\htdocs\\src\qs\controls\FlexBook.as:733] at qs.controls::FlexBook/commitProperties()[C:\Program Files\Apache\htdocs\\src\qs\controls\FlexBook.as:777] at mx.core::UIComponent/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:5660] at mx.managers::LayoutManager/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:517] at mx.managers::LayoutManager/doPhasedInstantiation ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:637] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2 ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8450] at mx.core::UIComponent/callLaterDispatcher ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8393] here is my code ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml com/2006/mxml xmlns:l=* layout=absolute xmlns:controls=qs.controls.* creationComplete=initApp(); xmlns:containers=qs.containers.* xmlns:effects=qs.effects.* width=720 height=430 mx:Style FlexBook { color: #00; textRollOverColor: #00; border-thickness: 0; border-style: none; page-slope: .6; active-grab-area: page; page-shadow-strength: 1; curve-shadow-strength: 1; auto-turn-duration: 1500; } Application { color: #F1F1CC; textRollOverColor: #000; backgroundColor: #ff; } SuperImage { border-thickness: 0; border-style: none; } /mx:Style mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; import qs.caching.ContentCache; import qs.controls.flexBookClasses.FlexBookEvent; import mx.core.UIComponent; //variables private var loader:URLLoader; private function initApp():void{ dataSet.send(); dataSet.addEventListener(ResultEvent.RESULT,onResult); } private function onResult(e:Event):void { var thumbs:XMLList = [EMAIL PROTECTED]; for(var i:int =0;ithumbs.length();i++) { ContentCache.getCache().preloadContent(thumbs[i]); } } private function loadContent(event:FlexBookEvent):void { var page:ImagePage = ImagePage(event.renderer); page.load(); } private function next():void { if(book.currentPageIndex+1 book.pageCount) book.turnToPage(book.currentPageIndex + 1); } private function previous():void { if(book.currentPageIndex 0) book.turnToPage(book.currentPageIndex -12); } ]] /mx:Script mx:HTTPService id=dataSet url=data/images.xml resultFormat=e4x / controls:FlexBook id=book width=720 height=430 horizontalCenter=0 backgroundColor=#00 animateCurrentPageIndex=true showCornerTease=true
Re: [flexcoders] Flex Book
While I see your direction I am just not sure thats what I want to do. The xml needed is to display the 1st image and that needs to come from the xml file. Is that what my problem is? Is the component looking for values before they are available? It works using mx:XML/ and that makes sense since its compiled. Dan On Feb 15, 2008 8:07 PM, Jim Hayes [EMAIL PROTECTED] wrote: Dan, I'd set the components dataprovider to an XML variable, and initialise that variable as either empty or whatever the minimum xml information needs to be to prevent the component getting upset about null values. make that variable bindable. Then, when you get the http service results, convert that to xml and put it into the variable that the component is bound to, the binding should result in the component updating. If binding isn't working (for whatever reason), then just reset the dataprovider to the new xml from the http result (and think about binding later if you have to). Hopefully that should get you started on something that works, at least. -Original Message- From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com on behalf of Dan Vega Sent: Fri 15/02/2008 20:55 To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: Re: [flexcoders] Flex Book Rob, Great tip on using http instead of xml. The problem I am having now is I think the component is trying to load before the service is completed. I don't think the dataSet is filled when the component is setting up. I tried to create the component in AS but it would not let me. Any help is appreciated, I am racking my brain over this. Dan [SWF] //bin-debug/.swf - 925,285 bytes after decompression TypeError: Error #1009: Cannot access a property or method of a null object reference. at /loadContent()[C:\Program Files\Apache\htdocs\src\.mxml:62] at /__book_turnEnd()[C:\Program Files\Apache\htdocs\\src\.mxml:85] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:9041] at qs.controls::FlexBook/dispatchEventForPage()[C:\Program Files\Apache\htdocs\\src\qs\controls\FlexBook.as:733] at qs.controls::FlexBook/commitProperties()[C:\Program Files\Apache\htdocs\\src\qs\controls\FlexBook.as:777] at mx.core::UIComponent/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:5660] at mx.managers::LayoutManager/validateProperties ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:517] at mx.managers::LayoutManager/doPhasedInstantiation ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\managers\LayoutManager.as:637] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2 ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8450] at mx.core::UIComponent/callLaterDispatcher ()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\core\UIComponent.as:8393] here is my code ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:l=* layout=absolute xmlns:controls=qs.controls.* creationComplete=initApp(); xmlns:containers=qs.containers.* xmlns:effects=qs.effects.* width=720 height=430 mx:Style FlexBook { color: #00; textRollOverColor: #00; border-thickness: 0; border-style: none; page-slope: .6; active-grab-area: page; page-shadow-strength: 1; curve-shadow-strength: 1; auto-turn-duration: 1500; } Application { color: #F1F1CC; textRollOverColor: #000; backgroundColor: #ff; } SuperImage { border-thickness: 0; border-style: none; } /mx:Style mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; import qs.caching.ContentCache; import qs.controls.flexBookClasses.FlexBookEvent; import mx.core.UIComponent; //variables private var loader:URLLoader; private function initApp():void { dataSet.send(); dataSet.addEventListener(ResultEvent.RESULT,onResult); } private function onResult(e:Event):void { var thumbs:XMLList = [EMAIL PROTECTED]; for(var i:int =0;ithumbs.length();i++) { ContentCache.getCache().preloadContent(thumbs[i]); } } private function loadContent(event:FlexBookEvent):void { var page:ImagePage = ImagePage(event.renderer); page.load(); } private function next():void { if(book.currentPageIndex+1 book.pageCount) book.turnToPage(book.currentPageIndex + 1); } private function previous():void { if(book.currentPageIndex 0) book.turnToPage(book.currentPageIndex -12); } ]] /mx:Script mx:HTTPService id=dataSet url=data/images.xml resultFormat=e4x / controls:FlexBook id=book width=720 height=430 horizontalCenter=0 backgroundColor=#00 animateCurrentPageIndex
[flexcoders] Basic Air App
I am trying to build a basic air app using Flex 3. I have been writing some Flex applications with no problem but when I goto debug my AIR app I am having some issues. First off here is the basic code to create the app. ?xml version=1.0 encoding=utf-8? mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Hello AIR mx:Label text=Hello AIR horizontalCenter=0 verticalCenter=0/ /mx:WindowedApplication When I try and debug Flash Player 9 opens and Flex Builder stays on Launching... for about 1 minute after which I see the following error. Failed to connect, session timed out. Ensure that. 1.) You compiled your flash application with debugging on 2.) You are running the debugger version of Flash Player. I am not sure why I get this message? If I am debbugging flex applications with no problem I should be running the debugger version of Flash player right?
Re: [flexcoders] Basic Air App
how do i find this out? Would I still be able to debug flex apps if I wasnt? On Feb 20, 2008 9:36 AM, Tom Chiverton [EMAIL PROTECTED] wrote: On Wednesday 20 Feb 2008, Dan Vega wrote: be running the debugger version of Flash player right? Are you running the most recent debug version ?
Re: [flexcoders] Basic Air App
I have 115 installed and ran the about test in both browsers. Dan On Feb 20, 2008 9:55 AM, Tom Chiverton [EMAIL PROTECTED] wrote: On Wednesday 20 Feb 2008, Tom Chiverton wrote: The most recent version is ..115. Right click any Flash content and choose 'about'. Although http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19245sliceId=1 will also confirm it's a debug player. Also, make sure Eclipse is launching the same browser you think it is :-) -- Tom Chiverton Helping to vitalistically benchmark fifth-generation models on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links
[flexcoders] ColdFusion Structures in Flex
I am new to Flex and I have some questions about data types. I have a method in ColdFusion that returns a structure. I heard that this is automatically converted for me. I was wondering if anyone can point me to article that explains what types in CF are converted to in Flex. I put a break point on my result and it just looks like an object. A follow up to that is there a method that I can use that will return the type of object I am working with? - Completely separate how does the data provider for different components such as the tree and datagrid work? I have datagrids working with arraycollections and xmlcollections. Is there a specific format for the dp to work? Thank You Dan
Re: [flexcoders] ColdFusion Structures in Flex
Here is what I am trying to do and it may make more sense. I have an object coming back from ColdFusion that contains a list of datasource names. When reading through the docs I can tell i need an arrayCollection or XmlLIstCollection to use as the data provider. I also need to list the field names for each datasource underneath that so should I just build that completely on the cf side before passing it back or when the datasource + is clicked retrieve a list of field names. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=init() mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.utils.ObjectUtil; [Bindable] private var datasources:ArrayCollection; public function init():void { AdminSrv.login(adminpassword); DataSourceSrv.getDataSources(); } public function loginHandler(event:ResultEvent):void{ trace(event.result); } public function getDataSourcesHandler(event:ResultEvent):void{ var ds:Object = event.result; trace(ObjectUtil.toString(ds)); } ]] /mx:Script mx:RemoteObject id=AdminSrv destination=ColdFusion source=cfide.adminapi.administrator mx:method name=login result=loginHandler(event)/ /mx:RemoteObject mx:RemoteObject id=DataSourceSrv destination=ColdFusion source=cfide.adminapi.datasource mx:method name=getDataSources result=getDataSourcesHandler(event)/ /mx:RemoteObject mx:HDividedBox top=60 right=20 left=20 bottom=20 mx:Tree width=300 height=100% dataProvider={datasources} /mx:Tree mx:VBox width=100% height=100% /mx:VBox /mx:HDividedBox /mx:Application
[flexcoders] Scrolling Image Component
I built a custom component that allows me to scroll an image up the screen. When you mouse over the image the animation stops and when you mouse out it resumes. I also built in a click handler to open up a url. Here is the code as well as the code I am using to instantiate it. My question is how could I go about nesting another component? You will see my want example I want to be able to pass any number of images into the component. I am a newb so I am not sure how I can keep nesting. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical xmlns:components=components.* paddingTop=0 paddingBottom=0 components:ScrollingImage height=100% width=500 img=assets/cf_appicon.jpg speed=10/ !--- want it to work like this --- components:ScrollingImage height=100% width=500 speed=10 components:img source=source_of_image url=www.abc.com/ components:img source=source_of_image url=www.abc.com/ components:img source=source_of_image url=www.abc.com/ components:img source=source_of_image url=www.abc.com/ /components:ScrollingImage /mx:Application *ScrollingImage.mxml * ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; horizontalScrollPolicy=off verticalScrollPolicy=off creationComplete=init() borderStyle=solid borderColor=#ff borderThickness=2 mx:Script ![CDATA[ import mx.controls.Image; [Bindable] public var img:String; [Bindable] public var speed:uint; private var myTimer:Timer; public function start():void { myTimer.start(); } public function stop():void { myTimer.stop(); } private function pause(event:MouseEvent):void { stop(); } private function resume(event:MouseEvent):void { start(); } private function init():void { myTimer = new Timer(speed); myTimer.addEventListener(TimerEvent.TIMER,moveImage); start(); scrollingImage.addEventListener(MouseEvent.MOUSE_OVER,pause); scrollingImage.addEventListener(MouseEvent.MOUSE_OUT,resume); scrollingImage.addEventListener(MouseEvent.CLICK,openURL); } private function moveImage(event:TimerEvent):void { if(scrollingImage.y (0-scrollingImage.height)){ scrollingImage.y = this.height; } else { scrollingImage.y --; } } private function openURL(event:MouseEvent):void { navigateToURL(new URLRequest( http://www.adobe.com/products/coldfusion;),_blank); } ]] /mx:Script mx:Image id=scrollingImage source={img} y={this.height}/ /mx:Canvas -- Thank You Dan Vega
Re: [flexcoders] Problems accessing a class method from an mxml file
The static error leads me to believe you have not instantiated your object yet. Have you created the object or are you directly trying to call the method? var obj:myObject = new myObject(); obj.getData(); On Fri, May 30, 2008 at 9:42 AM, justSteve [EMAIL PROTECTED] wrote: I have a public class that defines a method as: public function getData( ):String { return mData; } In an mxml file, I've imported that package and attempt to call ( _nav = getData(); ) but get '1061: Call to a possibly undefined method getData through a reference with static type Class.' I've tried fully qualifying the object (_nav = com.myObject.getData(); ) with the same result. Obviously I'm missing something very, very basic. thx --steve... Messages in this topic http://groups.yahoo.com/group/flexcoders/message/114577;_ylc=X3oDMTM5NHRuamNiBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRtc2dJZAMxMTQ1NzcEc2VjA2Z0cgRzbGsDdnRwYwRzdGltZQMxMjEyMTU0OTQ1BHRwY0lkAzExNDU3Nw--( 1) Reply (via web post) http://groups.yahoo.com/group/flexcoders/post;_ylc=X3oDMTJzOXRramdrBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRtc2dJZAMxMTQ1NzcEc2VjA2Z0cgRzbGsDcnBseQRzdGltZQMxMjEyMTU0OTQ1?act=replymessageNum=114577| Start a new topic http://groups.yahoo.com/group/flexcoders/post;_ylc=X3oDMTJmZDhmaHZjBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEyMTIxNTQ5NDU- Messageshttp://groups.yahoo.com/group/flexcoders/messages;_ylc=X3oDMTJmYXVmNWcwBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRzZWMDZnRyBHNsawNtc2dzBHN0aW1lAzEyMTIxNTQ5NDU- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com [image: Yahoo! Groups]http://groups.yahoo.com/;_ylc=X3oDMTJlanIzOWtrBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTIxMjE1NDk0NQ-- Change settings via the Webhttp://groups.yahoo.com/group/flexcoders/join;_ylc=X3oDMTJnbGlpdGVkBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRzZWMDZnRyBHNsawNzdG5ncwRzdGltZQMxMjEyMTU0OTQ1(Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest[EMAIL PROTECTED]:+Digest| Switch format to Traditional[EMAIL PROTECTED]:+Traditional Visit Your Group http://groups.yahoo.com/group/flexcoders;_ylc=X3oDMTJlYzNtM2F2BF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRzZWMDZnRyBHNsawNocGYEc3RpbWUDMTIxMjE1NDk0NQ--| Yahoo! Groups Terms of Use http://docs.yahoo.com/info/terms/ | Unsubscribe [EMAIL PROTECTED] Recent Activity - 103 New Membershttp://groups.yahoo.com/group/flexcoders/members;_ylc=X3oDMTJnYzVyb21nBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRzZWMDdnRsBHNsawN2bWJycwRzdGltZQMxMjEyMTU0OTQ1 Visit Your Group http://groups.yahoo.com/group/flexcoders;_ylc=X3oDMTJmbXJkYmMwBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwSWQDMTcwNTAwNzIwNwRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEyMTIxNTQ5NDU- Yahoo! Finance It's Now Personalhttp://us.ard.yahoo.com/SIG=13oe6djm3/M=493064.12016257.12445664.8674578/D=groups/S=1705007207:NC/Y=YAHOO/EXP=1212162145/L=/B=bmCdAELaX.g-/J=1212154945412781/A=4507179/R=0/SIG=12de4rskk/*http://us.rd.yahoo.com/evt=50284/*http://finance.yahoo.com/personal-finance Guides, news, advice more. Discover Tips on healthy livinghttp://us.ard.yahoo.com/SIG=13okh7qmf/M=493064.12662709.12980595.8674578/D=groups/S=1705007207:NC/Y=YAHOO/EXP=1212162145/L=/B=b2CdAELaX.g-/J=1212154945412781/A=5349283/R=0/SIG=11ks6tatn/*http://advision.webevents.yahoo.com/HealthyLiving/ and healthy eating on Yahoo! Groups. Cat Zone on Yahoo! Groupshttp://us.ard.yahoo.com/SIG=13o2n9f8r/M=493064.12016263.12445670.8674578/D=groups/S=1705007207:NC/Y=YAHOO/EXP=1212162145/L=/B=cGCdAELaX.g-/J=1212154945412781/A=4836039/R=0/SIG=11olbte0b/*http://advision.webevents.yahoo.com/catzone/index.html Join a Group all about cats. . __,_._,_
Re: [flexcoders] Problems accessing a class method from an mxml file
Can you share your code? I am sure I could tell you whats wrong if I can see what your doing but I am just not sure from the little bit of info I have. Dan On Fri, May 30, 2008 at 10:28 AM, justSteve [EMAIL PROTECTED] wrote: Thankx...if i set code as you suggest I eliminate the compiler error but it causes this problem: The class I'm trying to hit has already instantiated by the time the MXML file calls getData (it's called from the creationComplete handler). Creating a new one from my MXML file won't work cuz the constructor won't get valid data. On Fri, May 30, 2008 at 8:46 AM, Dan Vega [EMAIL PROTECTED]danvega%40gmail.com wrote: The static error leads me to believe you have not instantiated your object yet. Have you created the object or are you directly trying to call the method? var obj:myObject = new myObject(); obj.getData(); On Fri, May 30, 2008 at 9:42 AM, justSteve [EMAIL PROTECTED]steve%40stevelearnsflex.com wrote: I have a public class that defines a method as: public function getData( ):String { return mData; } In an mxml file, I've imported that package and attempt to call ( _nav = getData(); ) but get '1061: Call to a possibly undefined method getData through a reference with static type Class.' I've tried fully qualifying the object (_nav = com.myObject.getData(); ) with the same result. Obviously I'm missing something very, very basic. thx --steve... Messages in this topic (1) Reply (via web post) | Start a new topic Messages -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe Recent Activity 103 New Members Visit Your Group Yahoo! Finance It's Now Personal Guides, news, advice more. Discover Tips on healthy living and healthy eating on Yahoo! Groups. Cat Zone on Yahoo! Groups Join a Group all about cats. . __,_._,_ -- Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] DataGrid Item Editor Question
I have this data grid that holds a list of files. These files are fileReferences that are selected by a user browsing the system. After the select a file the data shows the name/ext/size. What I want is a 4th column for the user to select a value from the drop down. I get an error with the code below because there is no default value. I am not sure how I would go about this because the fileReference object does not hold this data so I can not give it a dataField. I am sure this is because Im a new, any help is appreciated! mx:DataGrid id=dgFiles width=100% height=100% dataProvider={_files} editable=true mx:columns mx:DataGridColumn headerText=File Name dataField=name editable=false/ mx:DataGridColumn headerText=File Type dataField=extension editable=false/ mx:DataGridColumn headerText=File Size dataField=size labelFunction=bytesToKilobytes editable=false/ mx:DataGridColumn headerText=Rating editable=true mx:itemEditor mx:Component mx:ComboBox editable=true mx:dataProvider mx:String1/mx:String mx:String2/mx:String mx:String3/mx:String mx:String4/mx:String mx:String5/mx:String /mx:dataProvider /mx:ComboBox /mx:Component /mx:itemEditor /mx:DataGridColumn /mx:columns /mx:DataGrid -- Thank You Dan
Re: [flexcoders] DataGrid Item Editor Question
In the end I want to post the data to a form. I already have a working model that uploads file to ColdFusion but I want to be able to pass additional data as well. If I understand you correctly I should create a new data type that extends FileReference and just add to it what i need? Dan On Fri, Jun 6, 2008 at 4:35 PM, Alex Harui [EMAIL PROTECTED] wrote: The answer depends on what you plan to do with the rating? Are you storing the rating somewhere? Sending it to the server? Normally, you will need to keep track of that field somewhere on the client and the best place is in your data, so adding a field to FileReference via subclassing or aggregation (a new class that contains a FileReference plus a new field) is recommended. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Friday, June 06, 2008 12:27 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] DataGrid Item Editor Question I have this data grid that holds a list of files. These files are fileReferences that are selected by a user browsing the system. After the select a file the data shows the name/ext/size. What I want is a 4th column for the user to select a value from the drop down. I get an error with the code below because there is no default value. I am not sure how I would go about this because the fileReference object does not hold this data so I can not give it a dataField. I am sure this is because Im a new, any help is appreciated! mx:DataGrid id=dgFiles width=100% height=100% dataProvider={_files} editable=true mx:columns mx:DataGridColumn headerText=File Name dataField=name editable=false/ mx:DataGridColumn headerText=File Type dataField=extension editable=false/ mx:DataGridColumn headerText=File Size dataField=size labelFunction=bytesToKilobytes editable=false/ mx:DataGridColumn headerText=Rating editable=true mx:itemEditor mx:Component mx:ComboBox editable=true mx:dataProvider mx:String1/mx:String mx:String2/mx:String mx:String3/mx:String mx:String4/mx:String mx:String5/mx:String /mx:dataProvider /mx:ComboBox /mx:Component /mx:itemEditor /mx:DataGridColumn /mx:columns /mx:DataGrid -- Thank You Dan -- Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] DataGrid Item Editor Question
Alex, That worked out great! Thanks for the tip.. Dan On Fri, Jun 6, 2008 at 7:05 PM, Alex Harui [EMAIL PROTECTED] wrote: Yes, or aggregate. It is more or less up to you. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Friday, June 06, 2008 2:51 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] DataGrid Item Editor Question In the end I want to post the data to a form. I already have a working model that uploads file to ColdFusion but I want to be able to pass additional data as well. If I understand you correctly I should create a new data type that extends FileReference and just add to it what i need? Dan On Fri, Jun 6, 2008 at 4:35 PM, Alex Harui [EMAIL PROTECTED] wrote: The answer depends on what you plan to do with the rating? Are you storing the rating somewhere? Sending it to the server? Normally, you will need to keep track of that field somewhere on the client and the best place is in your data, so adding a field to FileReference via subclassing or aggregation (a new class that contains a FileReference plus a new field) is recommended. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Friday, June 06, 2008 12:27 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] DataGrid Item Editor Question I have this data grid that holds a list of files. These files are fileReferences that are selected by a user browsing the system. After the select a file the data shows the name/ext/size. What I want is a 4th column for the user to select a value from the drop down. I get an error with the code below because there is no default value. I am not sure how I would go about this because the fileReference object does not hold this data so I can not give it a dataField. I am sure this is because Im a new, any help is appreciated! mx:DataGrid id=dgFiles width=100% height=100% dataProvider={_files} editable=true mx:columns mx:DataGridColumn headerText=File Name dataField=name editable=false/ mx:DataGridColumn headerText=File Type dataField=extension editable=false/ mx:DataGridColumn headerText=File Size dataField=size labelFunction=bytesToKilobytes editable=false/ mx:DataGridColumn headerText=Rating editable=true mx:itemEditor mx:Component mx:ComboBox editable=true mx:dataProvider mx:String1/mx:String mx:String2/mx:String mx:String3/mx:String mx:String4/mx:String mx:String5/mx:String /mx:dataProvider /mx:ComboBox /mx:Component /mx:itemEditor /mx:DataGridColumn /mx:columns /mx:DataGrid -- Thank You Dan -- Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org -- Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] Component Questions
I built a small app that has 4 screens and everything is working great. I want to learn more about breaking up the views into different components before I move on to mvc in Flex. My question is lets say I have my main application and then each of my screens are views. In my main application I have a public variable called _client. On the first view I am trying to access that object and the compiler is telling me it is undefined. In my code you will the line _client = selected. My question is how does the component know about the data declared in the main application ? ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% layout=vertical title=Rogers Image Uploader - Start backgroundColor=#000 creationComplete=init() mx:Script ![CDATA[ import mx.events.ListEvent; private function init():void { // disable the next button until a client is selcted btnNextStart.enabled = false; // listen for changes on the client grid dgClients.addEventListener(ListEvent.CHANGE,onSelectClient); } private function onSelectClient(event:ListEvent):void { var selected:Object = event.itemRenderer.data; _client = selected; btnNextStart.enabled = true; } ]] /mx:Script mx:DataGrid id=dgClients dataProvider={_clients} width=100% height=100% mx:columns mx:DataGridColumn headerText= labelFunction=rowNumber width=40/ mx:DataGridColumn headerText=Client dataField=client_name width=250/ mx:DataGridColumn headerText=City dataField=city/ mx:DataGridColumn headerText=State dataField=state/ mx:DataGridColumn headerText=Zip dataField=zip/ mx:DataGridColumn headerText=Phone dataField=phone/ mx:DataGridColumn headerText=Status dataField=status labelFunction=statusRenderer/ /mx:columns /mx:DataGrid mx:ControlBar mx:Button label=Previous enabled=false/ mx:Spacer width=100%/ mx:Label text=Select a client and click next. color=#ff/ mx:Spacer width=100%/ mx:Button id=btnNextStart label=Next click={this.currentState='uploader'}/ /mx:ControlBar /mx:Panel Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Component Questions
Thanks for the quick reply Douglas.. I know about the _ for private variables, I am just in the process of breaking my app up. Am I doing things thre right way then ? I have an ojbect that 3 of the 4 screens either need to read or update. Do I create a public var and pass it around ? On Sat, Jul 12, 2008 at 3:23 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: You need to inject data from parents into children. If children need to send data up the chain to parents, use a event. Thus, in the below add a public variable client and set this upon creation like this comp:MyPanel client={_client} .. note its odd to name a publicly available variable with a _ DK On Sat, Jul 12, 2008 at 2:46 PM, Dan Vega [EMAIL PROTECTED]danvega%40gmail.com wrote: I built a small app that has 4 screens and everything is working great. I want to learn more about breaking up the views into different components before I move on to mvc in Flex. My question is lets say I have my main application and then each of my screens are views. In my main application I have a public variable called _client. On the first view I am trying to access that object and the compiler is telling me it is undefined. In my code you will the line _client = selected. My question is how does the component know about the data declared in the main application ? ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% layout=vertical title=Rogers Image Uploader - Start backgroundColor=#000 creationComplete=init() mx:Script ![CDATA[ import mx.events.ListEvent; private function init():void { // disable the next button until a client is selcted btnNextStart.enabled = false; // listen for changes on the client grid dgClients.addEventListener(ListEvent.CHANGE,onSelectClient); } private function onSelectClient(event:ListEvent):void { var selected:Object = event.itemRenderer.data; _client = selected; btnNextStart.enabled = true; } ]] /mx:Script mx:DataGrid id=dgClients dataProvider={_clients} width=100% height=100% mx:columns mx:DataGridColumn headerText= labelFunction=rowNumber width=40/ mx:DataGridColumn headerText=Client dataField=client_name width=250/ mx:DataGridColumn headerText=City dataField=city/ mx:DataGridColumn headerText=State dataField=state/ mx:DataGridColumn headerText=Zip dataField=zip/ mx:DataGridColumn headerText=Phone dataField=phone/ mx:DataGridColumn headerText=Status dataField=status labelFunction=statusRenderer/ /mx:columns /mx:DataGrid mx:ControlBar mx:Button label=Previous enabled=false/ mx:Spacer width=100%/ mx:Label text=Select a client and click next. color=#ff/ mx:Spacer width=100%/ mx:Button id=btnNextStart label=Next click={this.currentState='uploader'}/ /mx:ControlBar /mx:Panel Thank You Dan Vega [EMAIL PROTECTED] danvega%40gmail.com http://www.danvega.org -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Component Questions
Ok, I re wrote the 1st screen into a component. Here is the code for my component. When a user selects a client from the data grid I want to dispatch an event of clientSelected My question now is in my main app I have the following code. How do I tell my main application to listen for that event? addEventListener(clientSelected,onClientSelect) does not work? Also all of my screens have next and previous buttons and when the app was all in one file i was able to change states. Now that I am in a component how can i change the state? Thanks for your help!! mx:State name=start mx:AddChild views:ClientSelector id=startPanel/ /mx:AddChild /mx:State ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% layout=vertical title=Rogers Image Uploader - Start backgroundColor=#000 initialize=init(); mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; import mx.collections.ArrayCollection; import mx.events.ListEvent; [Bindable] // clients list pulled from ro private var _clients:ArrayCollection; // an object to hold data of the selected client public var _client:Object; private function init():void { // populate the cients grid Clients.listClients(); // disable the next button until a client is selcted btnNext.enabled = false; btnPrevious.enabled = false; } // getter/setter for client object; holds client data public function set client(obj:Object):void { _client = obj; dispatchEvent(new Event(clientSelected)); } [Bindable(event=clientSelected)] public function get client():Object { return _client; } private function listClients(event:ResultEvent):void { _clients = event.result as ArrayCollection; } private function onClientSelect(event:ListEvent):void { client = event.itemRenderer.data; btnNext.enabled = true; } private function onNext(event:MouseEvent):void { this.currentState = uploader; } // DataGrid Status Label Renderer private function statusRenderer(item:Object,column:DataGridColumn):String { var status:String = ; if(item.status == A){ status = Active; } else { status = Inactive; } return status; } // Label function to add row numbers to the grid private function rowNumber(item:Object,column:DataGridColumn):String { var index:int = _clients.getItemIndex(item) + 1; return String(index); } ]] /mx:Script mx:RemoteObject id=Clients destination=ColdFusion source=src.cfc.Clients showBusyCursor=true mx:method name=listClients result=listClients(event)/ /mx:RemoteObject mx:DataGrid id=dgClients dataProvider={_clients} width=100% height=100% change=onClientSelect(event) textRollOverColor=#ff rollOverColor=#242424 selectionColor=#242424 textSelectedColor=#ff mx:columns mx:DataGridColumn headerText= labelFunction=rowNumber width=40/ mx:DataGridColumn headerText=Client dataField=client_name width=250/ mx:DataGridColumn headerText=City dataField=city/ mx:DataGridColumn headerText=State dataField=state/ mx:DataGridColumn headerText=Zip dataField=zip/ mx:DataGridColumn headerText=Phone dataField=phone/ mx:DataGridColumn headerText=Status dataField=status labelFunction=statusRenderer/ /mx:columns /mx:DataGrid mx:ControlBar mx:Button id=btnPrevious label=Previous/ mx:Spacer width=100%/ mx:Label text=Select a client and click next. color=#ff/ mx:Spacer width=100%/ mx:Button id=btnNext label=Next click=onNext(event)/ /mx:ControlBar /mx:Panel
Re: [flexcoders] Component Questions
I agree with you but is there an easy way to do this without diving into a framework right away? I understand frameworks in general but I am still learning the ins and outs of Flex. I am just trying to go up the 45 degree ramp instead of the 90 :) THanks! I seem to be in the minority opinion on this topic, and you must also know that I develop framework components and not full-fledged production applications, but if you are headed to MVC, there should be a central model class that contains the data, and the UI should only reference the model's data and not really own it, or the services that fetch the data, and when the UI is manipulated, the UI should update the model, and not really dispatch events for other UI to manage.
Re: [flexcoders] Component Questions
Any examples would be a big help!. On Sat, Jul 12, 2008 at 7:30 PM, Dan Vega [EMAIL PROTECTED] wrote: I agree with you but is there an easy way to do this without diving into a framework right away? I understand frameworks in general but I am still learning the ins and outs of Flex. I am just trying to go up the 45 degree ramp instead of the 90 :) THanks! I seem to be in the minority opinion on this topic, and you must also know that I develop framework components and not full-fledged production applications, but if you are headed to MVC, there should be a central model class that contains the data, and the UI should only reference the model's data and not really own it, or the services that fetch the data, and when the UI is manipulated, the UI should update the model, and not really dispatch events for other UI to manage.
Re: [flexcoders] Component Questions
That is a ton of information Greg, thanks so much! I have viewed the Lynda videos before so I guess its about time to revisit them. I think once I wrap my head around how to move data around I will be ready to jump into a framework, after that sky is the limit! Thanks again for the info.. Dan On Sat, Jul 12, 2008 at 7:31 PM, greg h [EMAIL PROTECTED] wrote: Hi Dan, For more of a walk through on Dispatching Events from Custom Components see this online training title from Lynda.com: Flex 3 Essential Training with: David Gassner http://movielibrary.lynda.com/html/modPage.asp?ID=438 If you do not already have an account for the lynda.com Online Training Library, you can sign up for a 7-day Free Trial here (requires only an email address to sign up): http://www.lynda.com/freepass For your immediate requirement see: 10. Programming with Events Dispatching Events from Custom Components Creating and using custom event classes Dispatching and handling custom events Regarding Alex's comment, I concur. The following Lynda.com Online Training title can introduce you to the basics on Centralizing data storage with the ModelLocator pattern. Flex 2 Beyond the Basics with: David Gassner http://movielibrary.lynda.com/html/modPage.asp?ID=290 9. Client-Side Data Handling Centralizing data storage with the ModelLocator pattern Note: This lynda.com training video on the ModelLocator pattern references (but does not use) the Cairngorm microarchitecture. The training video covers just using a microarchitecture free implementation of a singleton ModelLocator class. This will give you the simplest, most straightforward understanding of what Alex is referring too. (Highly recommended.) Several microarchitectures are sometimes used in Flex developement that implement more design patterns than just ModelLocator. Two that I am most familiar with are Cairngorm and PureMVC.org. Just be forewarned that in structuring your codebase around these microarchitectures you will be committing to some significant overhead in terms of learning and the ultimate organization of your codebase. (Meaning, save them for some project after your first ever MVC in Flex project :-) Using microarchitetures like Cairngorm do ensure the use of a singleton ModelLocator classes. For primers on Cairngorm see: http://cairngormdocs.org/ http://labs.adobe.com/wiki/index.php/Cairngorm And this must read: Why I think you shouldn't use Cairngorm http://weblogs.macromedia.com/swebster/archives/2006/08/why_i_think_you.html For Cairngorm specific support see: http://tech.groups.yahoo.com/group/cairngorm-documentation/ hth, g
[flexcoders] Passing objects to components
If I want to pass a string to my custom component its pretty easy. Lets say you have a custom button component and in that component you declare a public var str, when you create your custom button you can simply do the following. local:CustomButton str=Hello World/ This works fine, but If I create an object and I want to pass an object into the custom component it does not seem to be working. The button is displayed but the button label is not displayed. Here is a quick example to show what I am doing. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:local=* creationComplete=init() mx:Script ![CDATA[ [Bindable] public var obj:Object; private function init():void { obj = new Object(); obj.str=Hello Object; } ]] /mx:Script local:Screen obj={obj}/ /mx:Application Custom Component ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ [Bindable] public var obj:Object = new Object(); ]] /mx:Script mx:Button label={obj.str}/ /mx:Canvas -- Dan
Re: [flexcoders] Re: Passing objects to components
So there is no way to push the object down to my component? On Sun, Jul 13, 2008 at 2:40 PM, Michael VanDaniker [EMAIL PROTECTED] wrote: You've declared that the instance obj should be bindable, but that doesn't make the properties on the class Object bindable. What you can do is create a class for the object you want to pass your custom component and add the bindable metadata tag to the properties you want to bind on. You can also add the metadata tag to the class definition. That will make all of the properties of the class bindable. package { [Bindable] public class Obj extends Object { public function Obj() { super(); } public var str:String = ; } } --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Dan Vega [EMAIL PROTECTED] wrote: If I want to pass a string to my custom component its pretty easy. Lets say you have a custom button component and in that component you declare a public var str, when you create your custom button you can simply do the following. local:CustomButton str=Hello World/ This works fine, but If I create an object and I want to pass an object into the custom component it does not seem to be working. The button is displayed but the button label is not displayed. Here is a quick example to show what I am doing. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:local=* creationComplete=init() mx:Script ![CDATA[ [Bindable] public var obj:Object; private function init():void { obj = new Object(); obj.str=Hello Object; } ]] /mx:Script local:Screen obj={obj}/ /mx:Application Custom Component ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ [Bindable] public var obj:Object = new Object(); ]] /mx:Script mx:Button label={obj.str}/ /mx:Canvas -- Dan
[flexcoders] Application Design
Maybe I am going about this the wrong way. I would like to explain my small application and get some feedback. This app started out as 1 big file but I decided to break it into smaller components. The main file is pretty small as you can see below. What the main app does is use a view stack to display the 4 screens I have broken into components. The first screen is the client selector, once a client is selected you move on to the second screen. In my client selector i dispatch an event that lets anyone listening know that a client was selected, this custom event pushes the client data back to the main app. The next two screens do something very similar in pushing data back out of the custom component and the main app grabs.it. Once the first 3 screens are done its time to goto the reivew screen. The final screen needs all of this data I have collected. As you can see below I simply try and just pass the data but it does not work. Why can't I pass complex data but strings will pass just fine? Im sure my being a newb to Flex has a lot to do with this but I am just wondering 2 things. 1.) What am I doing wrong here? 2.) How do others layout a small application similair to this ? Thank you so much for the help ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical width=760 height=500 backgroundColor=#00 creationComplete=init() xmlns:components=components.* xmlns:views=views.* mx:Style source=assets/css/styles.css/ mx:Script ![CDATA[ import mx.controls.Alert; import mx.collections.ArrayCollection; import events.OptionsSavedEvent; import events.ClientSelectedEvent; import events.FileAddedEvent; public var client:Object; public var options:Object; public var files:ArrayCollection; private function init():void { } private function onClientSelected(event:ClientSelectedEvent):void { client = event.client; } private function onFileAdded(event:FileAddedEvent):void { files = event.files; } private function onOptionsSaved(event:OptionsSavedEvent):void { options = event.options; } ]] /mx:Script mx:ViewStack id=vs width=100% height=100% views:ClientSelector id=startPanel vs={vs} clientSelected=onClientSelected(event)/ views:FileChooser id=fileChooser vs={vs} fileAdded=onFileAdded(event)/ views:Options id=optionsPanel vs={vs} optionsSaved=onOptionsSaved(event)/ views:Review id=reviewPanel vs={vs} client={client} options={options} files={files}/ /mx:ViewStack /mx:Application Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Application Design
I am just passing vs so that my next and previous buttons can increment or decrement the selectedIndex of the view state. Basically when I get to my final review screen and pass the data / files / client I try and output them and I get this error TypeError: Error #1009: Cannot access a property or method of a null object reference. I also put a breakpoint in the init method of the component and all of the data is null at that point. Here is a quick piece of the component. mx:Script ![CDATA[ import mx.containers.ViewStack; import mx.collections.ArrayCollection; private var _totalBytes:int = 0; public var vs:ViewStack; public var client:Object; public var options:Object; [Bindable] public var files:ArrayCollection; private function init():void { //client data lblClientName.text = client.client_name; lblClientCity.text = client.city; lblClientState.text = client.state; lblClientZip.text = client.zip; lblClientPhone.text = client.phone; Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Application Design
at views::Review/init()[H:\Program Files\Apache\htdocs\Uploader\src\views\Review.mxml:27] which is this line lblClientPhone.text = client.phone; Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 5:38 PM, Tracy Spratt [EMAIL PROTECTED] wrote: You get that error on what line? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:23 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design I am just passing vs so that my next and previous buttons can increment or decrement the selectedIndex of the view state. Basically when I get to my final review screen and pass the data / files / client I try and output them and I get this error TypeError: Error #1009: Cannot access a property or method of a null object reference. I also put a breakpoint in the init method of the component and all of the data is null at that point. Here is a quick piece of the component. mx:Script ![CDATA[ import mx.containers.ViewStack; import mx.collections.ArrayCollection; private var _totalBytes:int = 0; public var vs:ViewStack; public var client:Object; public var options:Object; [Bindable] public var files:ArrayCollection; private function init():void { //client data lblClientName.text = client.client_name; lblClientCity.text = client.city; lblClientState.text = client.state; lblClientZip.text = client.zip; lblClientPhone.text = client.phone; Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Application Design
ON the first screen when a user picks a client from the data grid private function onClientSelect(event:ListEvent):void { _client = event.itemRenderer.data; btnNext.enabled = true; dispatchEvent(new ClientSelectedEvent(clientSelected,_client)); } Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 5:51 PM, Tracy Spratt [EMAIL PROTECTED] wrote: How/when are you instantiating the client object? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:30 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design at views::Review/init()[H:\Program Files\Apache\htdocs\Uploader\src\views\Review.mxml:27] which is this line lblClientPhone.text = client.phone; Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 5:38 PM, Tracy Spratt [EMAIL PROTECTED] wrote: You get that error on what line? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:23 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design I am just passing vs so that my next and previous buttons can increment or decrement the selectedIndex of the view state. Basically when I get to my final review screen and pass the data / files / client I try and output them and I get this error TypeError: Error #1009: Cannot access a property or method of a null object reference. I also put a breakpoint in the init method of the component and all of the data is null at that point. Here is a quick piece of the component. mx:Script ![CDATA[ import mx.containers.ViewStack; import mx.collections.ArrayCollection; private var _totalBytes:int = 0; public var vs:ViewStack; public var client:Object; public var options:Object; [Bindable] public var files:ArrayCollection; private function init():void { //client data lblClientName.text = client.client_name; lblClientCity.text = client.city; lblClientState.text = client.state; lblClientZip.text = client.zip; lblClientPhone.text = client.phone; Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Application Design
That is just the local variable for that screen. I was told If I wanted to share information with the main application i had to push it back through an event. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 6:06 PM, Tracy Spratt [EMAIL PROTECTED] wrote: No, that is setting _client. You need to be setting client. Or change to: client={_client} You just need to debug this. You reference passing methodology is correct. Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:44 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design ON the first screen when a user picks a client from the data grid private function onClientSelect(event:ListEvent):void { _client = event.itemRenderer.data; btnNext.enabled = true; dispatchEvent(new ClientSelectedEvent(clientSelected,_client)); } Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 5:51 PM, Tracy Spratt [EMAIL PROTECTED] wrote: How/when are you instantiating the client object? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:30 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design at views::Review/init()[H:\Program Files\Apache\htdocs\Uploader\src\views\Review.mxml:27] which is this line lblClientPhone.text = client.phone; Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 5:38 PM, Tracy Spratt [EMAIL PROTECTED] wrote: You get that error on what line? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:23 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design I am just passing vs so that my next and previous buttons can increment or decrement the selectedIndex of the view state. Basically when I get to my final review screen and pass the data / files / client I try and output them and I get this error TypeError: Error #1009: Cannot access a property or method of a null object reference. I also put a breakpoint in the init method of the component and all of the data is null at that point. Here is a quick piece of the component. mx:Script ![CDATA[ import mx.containers.ViewStack; import mx.collections.ArrayCollection; private var _totalBytes:int = 0; public var vs:ViewStack; public var client:Object; public var options:Object; [Bindable] public var files:ArrayCollection; private function init():void { //client data lblClientName.text = client.client_name; lblClientCity.text = client.city; lblClientState.text = client.state; lblClientZip.text = client.zip; lblClientPhone.text = client.phone; Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Application Design
Thank you so much to everyone for your help and suggestions. Tracy - I think it was because the objects are not bindable like you said. In the review panel i was passing client but on startup its just an empty object. mx:ViewStack id=vs width=100% height=100% views:ClientSelector id=startPanel vs={vs} clientSelected=onClientSelected(event)/ views:FileChooser id=fileChooser vs={vs} fileAdded=onFileAdded(event)/ views:Options id=optionsPanel vs={vs} optionsSaved=onOptionsSaved(event)/ views:Review id=reviewPanel vs={vs} client={client}/ /mx:ViewStack Instead of that i just set it in my custom event handler. private function onClientSelected(event:ClientSelectedEvent):void { client = event.client; reviewPanel.client = client; } ** Thanks again for your help! So this is typical design of small applications? I know i need to get into mvc approach but im still learning. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 6:35 PM, Dan Vega [EMAIL PROTECTED] wrote: I changed it so it get instantiated on the main init. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical width=760 height=500 backgroundColor=#00 creationComplete=init() xmlns:components=components.* xmlns:views=views.* mx:Style source=assets/css/styles.css/ mx:Script ![CDATA[ import mx.controls.Alert; import mx.collections.ArrayCollection; import events.OptionsSavedEvent; import events.ClientSelectedEvent; import events.FileAddedEvent; public var client:Object; public var options:Object; public var files:ArrayCollection; private function init():void { client = new Object(); options = new Object(); } private function onClientSelected(event:ClientSelectedEvent):void { client = event.client; } private function onFileAdded(event:FileAddedEvent):void { files = event.files; } private function onOptionsSaved(event:OptionsSavedEvent):void { options = event.options; } ]] /mx:Script mx:ViewStack id=vs width=100% height=100% views:ClientSelector id=startPanel vs={vs} clientSelected=onClientSelected(event)/ views:FileChooser id=fileChooser vs={vs} fileAdded=onFileAdded(event)/ views:Options id=optionsPanel vs={vs} optionsSaved=onOptionsSaved(event)/ views:Review id=reviewPanel vs={vs} client={client} options={options} files={files}/ /mx:ViewStack /mx:Application Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 6:44 PM, Tracy Spratt [EMAIL PROTECTED] wrote: Huh? My question was: How/when are you instantiating the client object? You just need to debug. Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 6:20 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design That is just the local variable for that screen. I was told If I wanted to share information with the main application i had to push it back through an event. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 6:06 PM, Tracy Spratt [EMAIL PROTECTED] wrote: No, that is setting _client. You need to be setting client. Or change to: client={_client} You just need to debug this. You reference passing methodology is correct. Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:44 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design ON the first screen when a user picks a client from the data grid private function onClientSelect(event:ListEvent):void { _client = event.itemRenderer.data; btnNext.enabled = true; dispatchEvent(new ClientSelectedEvent(clientSelected,_client)); } Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Sun, Jul 13, 2008 at 5:51 PM, Tracy Spratt [EMAIL PROTECTED] wrote: How/when are you instantiating the client object? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Sunday, July 13, 2008 5:30 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Application Design at views::Review/init()[H:\Program Files\Apache\htdocs\Uploader\src\views\Review.mxml:27] which is this line
[flexcoders] Remote Object Paths
I have a quick questions about Remote Objects ColdFusion paths. For the latest project I am working on the development took place on my local machine. I would have many remote calls similar to the following. mx:RemoteObject id=Clients destination=ColdFusion source=MyProject.src.cfc.Clients showBusyCursor=true mx:method name=listClients result=listClients(event)/ /mx:RemoteObject The problem that I am running into is that when i want to push a release build the source path is going to change. When its published the path looks more like this +projectroot +myproject -myswf.swf +cfc -Clients.cfc My question is what do others do about this. I know that in the web world I could read a config file based on live or dev. The problem is that through out this project I have really learned that I need to stop thinking in terms of basic web application development. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Remote Object Paths
I did not even think of flash vars, I will look into that. Thanks Simon! Thank You Dan Vega On Mon, Jul 14, 2008 at 2:02 PM, Simon Bailey [EMAIL PROTECTED] wrote: In a similar scenario for setting dynamic url strings I simply pass them in via FlashVars or an external XML file. On app startup, send for the XML URL or reach in and grab the FlashVars and then pass it to the relevant class for assigning as the RO source. Simon On 14 Jul 2008, at 18:54, Dan Vega wrote: I have a quick questions about Remote Objects ColdFusion paths. For the latest project I am working on the development took place on my local machine. I would have many remote calls similar to the following. mx:RemoteObject id=Clients destination=ColdFusion source=MyProject.src.cfc.Clients showBusyCursor=true mx:method name=listClients result=listClients(event)/ /mx:RemoteObject The problem that I am running into is that when i want to push a release build the source path is going to change. When its published the path looks more like this +projectroot +myproject -myswf.swf +cfc -Clients.cfc My question is what do others do about this. I know that in the web world I could read a config file based on live or dev. The problem is that through out this project I have really learned that I need to stop thinking in terms of basic web application development. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Remote Object Paths
Douglas, The remote object path is used in the Flex app and therefor if its hard coded it doesn't that get compiled? I think the flash vars is a nice way of doing. I just threw in an initialize event, check to see if it existed and if not set it and pass that path on to my views. private function loadFlashVars():void { // load flash vars _ropath = Application.application.parameters.ropath; if(_ropath == null){ // must be development _ropath = MyProject.src.cfc; } } This works for me but I am open to any suggestions, Im still learning. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Mon, Jul 14, 2008 at 2:17 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: why not keep the paths the same? Either directly or through application.cfc. DK On Mon, Jul 14, 2008 at 1:54 PM, Dan Vega [EMAIL PROTECTED]danvega%40gmail.com wrote: I have a quick questions about Remote Objects ColdFusion paths. For the latest project I am working on the development took place on my local machine. I would have many remote calls similar to the following. mx:RemoteObject id=Clients destination=ColdFusion source=MyProject.src.cfc.Clients showBusyCursor=true mx:method name=listClients result=listClients(event)/ /mx:RemoteObject The problem that I am running into is that when i want to push a release build the source path is going to change. When its published the path looks more like this +projectroot +myproject -myswf.swf +cfc -Clients.cfc My question is what do others do about this. I know that in the web world I could read a config file based on live or dev. The problem is that through out this project I have really learned that I need to stop thinking in terms of basic web application development. Thank You Dan Vega [EMAIL PROTECTED] danvega%40gmail.com http://www.danvega.org -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Remote Object Paths
Turns out this does not work, the flash vars must not get passed at the time I am trying to set them. Anyone know at what stage these variables get passed in ? Dan On Mon, Jul 14, 2008 at 2:24 PM, Dan Vega [EMAIL PROTECTED] wrote: Douglas, The remote object path is used in the Flex app and therefor if its hard coded it doesn't that get compiled? I think the flash vars is a nice way of doing. I just threw in an initialize event, check to see if it existed and if not set it and pass that path on to my views. private function loadFlashVars():void { // load flash vars _ropath = Application.application.parameters.ropath; if(_ropath == null){ // must be development _ropath = MyProject.src.cfc; } } This works for me but I am open to any suggestions, Im still learning. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Mon, Jul 14, 2008 at 2:17 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: why not keep the paths the same? Either directly or through application.cfc. DK On Mon, Jul 14, 2008 at 1:54 PM, Dan Vega [EMAIL PROTECTED]danvega%40gmail.com wrote: I have a quick questions about Remote Objects ColdFusion paths. For the latest project I am working on the development took place on my local machine. I would have many remote calls similar to the following. mx:RemoteObject id=Clients destination=ColdFusion source=MyProject.src.cfc.Clients showBusyCursor=true mx:method name=listClients result=listClients(event)/ /mx:RemoteObject The problem that I am running into is that when i want to push a release build the source path is going to change. When its published the path looks more like this +projectroot +myproject -myswf.swf +cfc -Clients.cfc My question is what do others do about this. I know that in the web world I could read a config file based on live or dev. The problem is that through out this project I have really learned that I need to stop thinking in terms of basic web application development. Thank You Dan Vega [EMAIL PROTECTED] danvega%40gmail.com http://www.danvega.org -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
Re: [flexcoders] Debugging off when having multiple FB3 workspaces?
I am not sure if this is your problem but it may be causing it. One thing is to make sure all projects that you are not working on are close. If you right click on the project you are working on select close unrelated projects. This is more of an eclipse tip but it may be causing issues like this. Just a suggestion. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Mon, Jul 14, 2008 at 2:33 PM, ivo [EMAIL PROTECTED] wrote: Hello all, I ran across a problem I periodically have in Flex Builder where break points are off. This is an AIR project so there shouldnt be any browser caching issues. In the past this has not affected me terribly since I only experienced it on temporary machines, my main dev workstation never had this problem...until today. All I did was switch workspaces to a brand new one and checked out from svn an earlier revision of the same project I was already working on. I then added a trace statement put a break point on the new line but as I step thru the code it is off by one line. I deleted the contents of the bin folders rebuilt but the problem persists. The only way I can make changes stick is to check into svn, blow away the workspace and redownload everything. The original Flex Builder 3 workspace does not seem to have this problem but all new workspaces do. In the past I have never had to work on two workspaces simultaneously so this wasnt a problem but now I need to be able to switch back and forth rapidly (using svn switch takes too long). Does anyone know how to solve this issue? Thanks, - Ivo
Re: [flexcoders] Remote Object Paths
Good point, you need to turn that on in the services config right? Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Mon, Jul 14, 2008 at 3:05 PM, Douglas Knudsen [EMAIL PROTECTED] wrote: right, so have your server code (CFCs) sit in the same folder path in dev, staging, and production so doesn't matter what Flex, Flash, HTML client it is, who cares. ORif you are running ColdFuison 8, you can set application specific mappings in application.cfc. So, in your local dev application.cfc you could have a mapping that looks like production set to whatever you want. DK On Mon, Jul 14, 2008 at 2:24 PM, Dan Vega [EMAIL PROTECTED]danvega%40gmail.com wrote: Douglas, The remote object path is used in the Flex app and therefor if its hard coded it doesn't that get compiled? I think the flash vars is a nice way of doing. I just threw in an initialize event, check to see if it existed and if not set it and pass that path on to my views. private function loadFlashVars():void { // load flash vars _ropath = Application.application.parameters.ropath; if(_ropath == null){ // must be development _ropath = MyProject.src.cfc; } } This works for me but I am open to any suggestions, Im still learning. Thank You Dan Vega [EMAIL PROTECTED] danvega%40gmail.com http://www.danvega.org On Mon, Jul 14, 2008 at 2:17 PM, Douglas Knudsen [EMAIL PROTECTED] douglasknudsen%40gmail.com wrote: why not keep the paths the same? Either directly or through application.cfc. DK On Mon, Jul 14, 2008 at 1:54 PM, Dan Vega [EMAIL PROTECTED]danvega%40gmail.com wrote: I have a quick questions about Remote Objects ColdFusion paths. For the latest project I am working on the development took place on my local machine. I would have many remote calls similar to the following. mx:RemoteObject id=Clients destination=ColdFusion source=MyProject.src.cfc.Clients showBusyCursor=true mx:method name=listClients result=listClients(event)/ /mx:RemoteObject The problem that I am running into is that when i want to push a release build the source path is going to change. When its published the path looks more like this +projectroot +myproject -myswf.swf +cfc -Clients.cfc My question is what do others do about this. I know that in the web world I could read a config file based on live or dev. The problem is that through out this project I have really learned that I need to stop thinking in terms of basic web application development. Thank You Dan Vega [EMAIL PROTECTED] danvega%40gmail.com http://www.danvega.org -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it? -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] DataGrid Header Styles
I have some custom styles for my datagrid that apply to all datagrids. My problem is that the rows of the grid get a rollover color close to black and the text is white. The problem is with the header. When I roll over the header the background color is black but so is the text so I can not tell what the text says. Also the arrows are black so you never see those. Is there a way to customize all of this or just tell the header to act normal (don't apply styles)? DataGrid { textRollOverColor:#ff; rollOverColor:#242424; selectionColor:#242424; textSelectedColor:#ff; headerStyleName: dataGridHeader; } .dataGridHeader { textRollOverColor:#FF; } Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] DataGrid Header Styles
Just to change text styles? That seems like over kill for such simple thing Dan On Tue, Jul 15, 2008 at 2:04 PM, Alex Harui [EMAIL PROTECTED] wrote: You may need to create custom header renderers. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Tuesday, July 15, 2008 8:40 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] DataGrid Header Styles I have some custom styles for my datagrid that apply to all datagrids. My problem is that the rows of the grid get a rollover color close to black and the text is white. The problem is with the header. When I roll over the header the background color is black but so is the text so I can not tell what the text says. Also the arrows are black so you never see those. Is there a way to customize all of this or just tell the header to act normal (don't apply styles)? DataGrid { textRollOverColor:#ff; rollOverColor:#242424; selectionColor:#242424; textSelectedColor:#ff; headerStyleName: dataGridHeader; } .dataGridHeader { textRollOverColor:#FF; } Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] Object not passed as Remote Object parameter
Tom, To pass url variables you should look into the flash.net.URLVariables class package { import flash.display.Sprite; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.net.URLVariables; public class URLVariablesExample extends Sprite { public function URLVariablesExample() { var url:String = http://www.[yourDomain].com/application.jsp;; var request:URLRequest = new URLRequest(url); var variables:URLVariables = new URLVariables(); variables.exampleSessionId = new Date().getTime(); variables.exampleUserLabel = guest; request.data = variables; navigateToURL(request); } } } Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Tue, Jul 15, 2008 at 4:41 PM, Tom McNeer [EMAIL PROTECTED] wrote: Hi, I am building a product configurator, which creates an Estimate object. The Estimate contains a Customer object and an array of Configuration objects, each of which contains an array of Products. The objects are built properly in Flex. But when I attempt to send the Estimate object back to a ColdFusion CFC, the CFC acts as if there was no parameter passed. Specifically, if I call productService.saveEstimate(estimate), I get an error saying the parameter estimate is required, but not passed in. In debugging, just at the point of the RemoteObject (productService) call, I can see that the estimate object does exist in the proper scope. And if I create a string or array and put one in the method call: productService.saveEstimate(blah), or productService.saveEstimate(myArray) ... the method fires properly on the CFC. (The arg type in the CFC is set to any for testing, so any data type is accepted.) Why would the Estimate object (which exists) not be passed? Any thoughts would be greatly appreciated. -- Thanks, Tom Tom McNeer MediumCool http://www.mediumcool.com 1735 Johnson Road NE Atlanta, GA 30306 404.589.0560
Re: [flexcoders] What is the underscore '_'
Its just standard practice to use an underscore for private variables. Dan On Wed, Jul 16, 2008 at 10:38 AM, Scott [EMAIL PROTECTED] wrote: … being used for in flex code? I see example code out there that has variables like _myVar = myVar, what is this doing? TIA!
[flexcoders] drag and drop in air cairngorm app
I have tested some code in a seperate application and everything is fine. In my app I am using Cairngorm and I have a custom view. My main file is pretty simple as you can see below. The problem I having is that in the custom view I can never get the dragdrop to fire. The enter and exit trace statements execute just fine. As I said, I set up a test app and this seems to work fine. Anyone know what im doing wrong here? MAIN mx:ViewStack id=viewStackManager selectedIndex={modelLocator.workflowState} width=100% height=100% view:LoginForm/ view:CustomView/ /mx:ViewStack CUSTOM VIEW ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=init() mx:Script ![CDATA[ import com.**.uploader.model.ModelLocator; import flash.events.NativeDragEvent; [Bindable] private var modelLocator:ModelLocator = ModelLocator.getInstance(); private function init():void { this.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP,onDrop); this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER,onEnter); this.addEventListener(NativeDragEvent.NATIVE_DRAG_EXIT,onExit); trace(init); } private function onDrop(event:NativeDragEvent):void { trace(Drag Drop); } private function onEnter(event:NativeDragEvent):void { trace(Drag Enter); NativeDragManager.acceptDragDrop(this); } private function onExit(event:NativeDragEvent):void { trace(Drag Exit); } ]] /mx:Script mx:List id=fileList width=100% height=100% backgroundColor=#ff dropEnabled=true paddingTop=10 paddingRight=10 paddingBottom=10 paddingLeft=10 /mx:List /mx:Canvas Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] DataGrid Row Icon
I am having an issue displaying an icon in the first column of a row. Using the following code I pass two variables to a function the type and name. The type lets me know if the current row is a Directory or a file, if its a directory I return the source for the folder image, if its a file I a parse the filename to get the extension and show that Icon. mx:DataGridColumn width=30 sortable=false mx:itemRenderer mx:Component mx:Image source={outerDocument.setIcon(data.Type,data.Name)} verticalAlign=middle horizontalAlign=center scaleContent=false/ /mx:Component /mx:itemRenderer /mx:DataGridColumn While this is working I keep getting the errors below.. Any help is appreciated. warning: unable to bind to property 'Type' on class 'Object' (class is not an IEventDispatcher) warning: unable to bind to property 'Name' on class 'Object' (class is not an IEventDispatcher) Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] DataGrid Row Icon
As you said that I started looking at it more and started to write a reply. The item is declared bindable but when you are in the component it could not see my variable because it was declared private. i declared the variable and it works with no warnings now! mx:DataGridColumn width=30 sortable=false mx:itemRenderer mx:Component mx:Image source={outerDocument.setIcon(data.Type,data.Name)} verticalAlign=middle horizontalAlign=center scaleContent=false/ /mx:Component /mx:itemRenderer /mx:DataGridColumn Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Fri, Jul 25, 2008 at 2:13 PM, Alex Harui [EMAIL PROTECTED] wrote: It means your data objects are just plain objects and any changes to type or name won't be detected. You can make your object [Bindable] or better yet, define a custom data class with the appropriate [Bindable()] events, but I don' think these warning will harm you in this case although it will slow down the app. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Friday, July 25, 2008 6:45 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] DataGrid Row Icon I am having an issue displaying an icon in the first column of a row. Using the following code I pass two variables to a function the type and name. The type lets me know if the current row is a Directory or a file, if its a directory I return the source for the folder image, if its a file I a parse the filename to get the extension and show that Icon. mx:DataGridColumn width=30 sortable=false mx:itemRenderer mx:Component mx:Image source={outerDocument.setIcon(data.Type,data.Name)} verticalAlign=middle horizontalAlign=center scaleContent=false/ /mx:Component /mx:itemRenderer /mx:DataGridColumn While this is working I keep getting the errors below.. Any help is appreciated. warning: unable to bind to property 'Type' on class 'Object' (class is not an IEventDispatcher) warning: unable to bind to property 'Name' on class 'Object' (class is not an IEventDispatcher) Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] File Manager
I am not quite sure how to put this so I will try and explain the problem best I can. I built a small file manager utility that allows you to dbl click on folders and drill down through them. Once you are nested there is a toolbar icon that allows you to go back up. Most file managers have the up folder as the first row in the grid. Picture a data grid listing all of the folders first / all of the files next. I want to insert a blank row where the first column would have this up arrow image and on click would call my upNav method. Does anyone know of a way to dynamically insert this? I would think this needs to be done after the grid is created. Thank You Dan Vega
Re: [flexcoders] File Manager
I understand how to create a cell renderer but I have a query that pulls all the directory information, how do i insert a row after that query comes back from the server. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Mon, Jul 28, 2008 at 9:50 AM, Tom Chiverton [EMAIL PROTECTED] wrote: On Monday 28 Jul 2008, Dan Vega wrote: next. I want to insert a blank row where the first column would have this up arrow image and on click would call my upNav method. Does anyone know of a way to dynamically insert this? I would think this needs to be done after How about a custom cell renderer that detects it's 'data' property is '..' (or whatever you use for 'parent') and renders an mx:Image rather than mx:Text ? -- Tom Chiverton This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
Re: [flexcoders] File Manager
That was my next option, I was just wondering if I should do it on the server or after the grid was completed. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org On Mon, Jul 28, 2008 at 10:02 AM, Tom Chiverton [EMAIL PROTECTED] wrote: On Monday 28 Jul 2008, Dan Vega wrote: I understand how to create a cell renderer but I have a query that pulls all the directory information, how do i insert a row after that query comes back from the server. Just have whatever your server code does add a row at the start of the results. Without knowing your server-side language I can't be more specific. -- Tom Chiverton This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
Re: [flexcoders] MouseEvent's not firing
Patrick, Check out rawChildren, this works just fine for me. *private function addUI():void { var mySprite:Sprite = new Sprite(); mySprite.graphics.beginFill(0xFF); mySprite.graphics.drawCircle(30, 30, 30); mySprite.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver); rawChildren.addChild(mySprite); } private function onMouseOver(event:MouseEvent):void { trace(move over sprite); }* Thank You Dan Vega On Tue, Jul 29, 2008 at 2:50 PM, Patrick J. Jankun [EMAIL PROTECTED] wrote: Hi Everyone, I got a strange problem which i can't really understand, i loaded an .swf through the loader, initialised it as an movieclip, then initialised objects in it's library as classes to generate some navigation items, put those itmes in an holder, added that holder to stage. it looks all nice and how it's suppose to look like. But, when i add an MouseEvent Listener to the holder object, those mouseevents are never fired (?!?) and i clearly don't know why, since this is the first time i run into such problem, can anyone help me out? navHolder = new Sprite; navHolder.addEventListener(MouseEvent.MOUSE_OVER, navOnMouseOver); navHolder.addEventListener(MouseEvent.MOUSE_OUT, navOnMouseOut); navHolder.addEventListener(MouseEvent.CLICK, navOnMouseClick); addChild(navHolder); this code should work out of the box, but it does not :| and i can't trace the issue, if i put the eventlisteners directly on stage, the same events are fired on mouse actions.. any tips would be great, cheers, Patrick
[flexcoders] dynamic remote objects
I have a remote object that is very dynamic.The user is actually selecting the source of the component and the method name. So how can I refer to the remote objects methods dynamically? ro[methodname].addEventListenter() ??? var ro:RemoteObject = new RemoteObject(); ro.destination = ColdFusion; ro.source = something.text ro.METHODNAME.addEventListener(result, getListResultHandler); ro.addEventListener(fault, faultHandler); ro..METHODNAME(deptComboBox.selectedItem.data); Thank You Dan Vega
Re: [flexcoders] dynamic remote objects
Ok, I figured out what I was doing wrong but I am still getting an error. I think this is the right way to use remote object in AS3 import mx.rpc.remoting.RemoteObject; import mx.rpc.remoting.Operation; // setup the remote method var service:RemoteObject = new RemoteObject(ColdFusion); service.source = component.text; // the method needs to know about the remote object var operation:Operation = new Operation(service); operation.name = method.selectedItem.NAME; operation.addEventListener(ResultEvent.RESULT,loadGridData); operation.send(); But I am still getting this error and I am not sure why? Can not resolve a multiname reference unambiguously. mx.rpc.remoting.mxml:RemoteObject (from C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\libs\rpc.swc(mx/rpc/remoting/mxml/RemoteObject)) and mx.rpc.remoting:RemoteObject (from C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\libs\rpc.swc(mx/rpc/remoting/RemoteObject)) are available.RemoteObject/srcMain.mxmlUnknown1217435341365 1308 Thank You Dan Vega On Wed, Jul 30, 2008 at 11:46 AM, Tom Chiverton [EMAIL PROTECTED] wrote: On Wednesday 30 Jul 2008, Dan Vega wrote: I have a remote object that is very dynamic.The user is actually selecting the source of the component and the method name. Send the component name, method and arguments list to a generic service method that does the invoke for you. And be sure to check that the object name and method are at least members of a list you expect to receive, or you risk creating a security problem. -- Tom Chiverton This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
Re: [flexcoders] dynamic remote objects
That makes total sense because I also have an mxml tag in the document.I changed the code // setup the remote method var service:mx.rpc.remoting.RemoteObject = new mx.rpc.remoting.RemoteObject(); service.destination = ColdFusion; service.source = component.text; // the method needs to know about the remote object var operation:Operation = new Operation(service); operation.name = method.selectedItem.NAME; operation.addEventListener(ResultEvent.RESULT,loadGridData); operation.send(); and it still gives me the same error. Thank You Dan Vega On Wed, Jul 30, 2008 at 2:29 PM, Sid Maskit [EMAIL PROTECTED] wrote: ActionScript has two RemoteObject classes. The compiler is telling you that it does not know which of them you want to use when you say 'var service:RemoteObject = new RemoteObject(ColdFusion);'. From the looks of the error message, I would guess that you have a RemoteObject tag in your MXML, or that you are otherwise importing the mx.rpc.remoting.mxml:RemoteObject class. You either need to remove whatever tag or script that is using the MXML version of RemoteObject, or you need to fully qualify the class name in your statement, something like this: var service:mx.rpc.remoting.RemoteObject = new mx.rpc.remoting.RemoteObject(ColdFusion);' Hope that helps, Sid - Original Message From: Dan Vega [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, July 30, 2008 9:29:54 AM Subject: Re: [flexcoders] dynamic remote objects Ok, I figured out what I was doing wrong but I am still getting an error. I think this is the right way to use remote object in AS3 import mx.rpc.remoting. RemoteObject; import mx.rpc.remoting. Operation; // setup the remote method var service:RemoteObjec t = new RemoteObject(ColdFusion); service.source = component.text; // the method needs to know about the remote object var operation:Operation = new Operation(service) ; operation.name = method.selectedItem .NAMEhttp://method.selectedItem.NAME ; operation.addEventL istener(ResultEv ent.RESULT, loadGridData) ; operation.send( ); But I am still getting this error and I am not sure why? Can not resolve a multiname reference unambiguously. mx.rpc.remoting. mxml:RemoteObjec t (from C:\Program Files\Adobe\ Flex Builder 3\sdks\3.0.0\ frameworks\ libs\rpc. swc(mx/rpc/ remoting/ mxml/RemoteObjec t)) and mx.rpc.remoting: RemoteObject (from C:\Program Files\Adobe\ Flex Builder 3\sdks\3.0.0\ frameworks\ libs\rpc. swc(mx/rpc/ remoting/ RemoteObject) ) are available.RemoteObject/ srcMain.mxmlUnknown 12174353413651308 Thank You Dan Vega On Wed, Jul 30, 2008 at 11:46 AM, Tom Chiverton tom.chiverton@ halliwells. com [EMAIL PROTECTED] wrote: On Wednesday 30 Jul 2008, Dan Vega wrote: I have a remote object that is very dynamic.The user is actually selecting the source of the component and the method name. Send the component name, method and arguments list to a generic service method that does the invoke for you. And be sure to check that the object name and method are at least members of a list you expect to receive, or you risk creating a security problem. -- Tom Chiverton * * * * This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells. comhttp://www.halliwells.com . - - -- -- Flexcoders Mailing List FAQ: http://groups. yahoo.com/ group/flexcoders /files/flexcoder sFAQ.txthttp://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail- archive.com
[flexcoders] popup window
I have a popup window (a quick about win) and I am having an issue. How can I add a bunch of text to the title windows content area. If I just add the text it runs off the screen. I can set the width but that seems like a bit of a hack to me. I know im probably just missing something dumb here. private function showAbout(event:MouseEvent):void { // the popup window _popup = new TitleWindow(); _popup.title = About this component; _popup.width = 400; _popup.height = 200; _popup.showCloseButton = true; _popup.addEventListener(CloseEvent.CLOSE,closeAboutWindow); var label:Label= new Label(); label.text = * + * + * + * + _popup.addChild(label); _popup.autoLayout = true; PopUpManager.addPopUp(_popup,container); PopUpManager.centerPopUp(_popup); } Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
Re: [flexcoders] popup window
I understand the width as a percentage but in as3 you can't do that because its looking for a number. If i do var text:Text = new Text(); text.width = 100%; I get an error. Is there a way to figure out available space? On Wed, Jul 30, 2008 at 11:55 PM, Sid Maskit [EMAIL PROTECTED] wrote: Two things. First, a label can only display a single line. If you want multiline text, you should use a Text component. Second, Text components automatically wrap if, and only if, they have their width set. I believe you can set it to a percentage, and it will still wrap, but you have to set it to something. On a side note, this may seem like a hack, but how else can the system know what it should do? - Original Message From: Dan Vega [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, July 30, 2008 8:24:50 PM Subject: [flexcoders] popup window I have a popup window (a quick about win) and I am having an issue. How can I add a bunch of text to the title windows content area. If I just add the text it runs off the screen. I can set the width but that seems like a bit of a hack to me. I know im probably just missing something dumb here. private function showAbout(event: MouseEvent) :void { // the popup window _popup = new TitleWindow( ); _popup.title = About this component; _popup.width = 400; _popup.height = 200; _popup.showCloseBut ton = true; _popup.addEventList ener(CloseEvent. CLOSE,closeAbout Window); var label:Label= new Label(); label.text = * * * * * + * * * * * + * * * * * + * * * * * + _popup.addChild( label); _popup.autoLayout = true; PopUpManager. addPopUp( _popup,container ); PopUpManager. centerPopUp( _popup); } Thank You Dan Vega [EMAIL PROTECTED] com [EMAIL PROTECTED] http://www.danvega. org http://www.danvega.org
Re: [flexcoders] popup window
Perfect! Thank you so much... Thank You Dan Vega On Thu, Jul 31, 2008 at 1:50 AM, Alex Harui [EMAIL PROTECTED] wrote: text.percentWidth=100 -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Dan Vega *Sent:* Wednesday, July 30, 2008 9:04 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] popup window I understand the width as a percentage but in as3 you can't do that because its looking for a number. If i do var text:Text = new Text(); text.width = 100%; I get an error. Is there a way to figure out available space? On Wed, Jul 30, 2008 at 11:55 PM, Sid Maskit [EMAIL PROTECTED] wrote: Two things. First, a label can only display a single line. If you want multiline text, you should use a Text component. Second, Text components automatically wrap if, and only if, they have their width set. I believe you can set it to a percentage, and it will still wrap, but you have to set it to something. On a side note, this may seem like a hack, but how else can the system know what it should do? - Original Message From: Dan Vega [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, July 30, 2008 8:24:50 PM Subject: [flexcoders] popup window I have a popup window (a quick about win) and I am having an issue. How can I add a bunch of text to the title windows content area. If I just add the text it runs off the screen. I can set the width but that seems like a bit of a hack to me. I know im probably just missing something dumb here. private function showAbout(event: MouseEvent) :void { // the popup window _popup = new TitleWindow( ); _popup.title = About this component; _popup.width = 400; _popup.height = 200; _popup.showCloseBut ton = true; _popup.addEventList ener(CloseEvent. CLOSE,closeAbout Window); var label:Label= new Label(); label.text = * * * * * + * * * * * + * * * * * + * * * * * + _popup.addChild( label); _popup.autoLayout = true; PopUpManager. addPopUp( _popup,container ); PopUpManager. centerPopUp( _popup); } Thank You Dan Vega [EMAIL PROTECTED] com [EMAIL PROTECTED] http://www.danvega. org http://www.danvega.org
[flexcoders] CFMultiUploader
Anyone on here who uses ColdFusion I could really use your help. I built a multi file uploader using Flex that you can configure via xml. I need a couple people to test a very early alpha version before I relase it. You should be able to just unzip it to root and follow easy installation instructions. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] Re: CFMultiUploader
I just posted a quick intro to the component http://www.danvega.org On Thu, Jul 31, 2008 at 9:38 AM, Dan Vega [EMAIL PROTECTED] wrote: Anyone on here who uses ColdFusion I could really use your help. I built a multi file uploader using Flex that you can configure via xml. I need a couple people to test a very early alpha version before I relase it. You should be able to just unzip it to root and follow easy installation instructions. Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] Remove Child
I have a variable and based on its true/false value I want to display a link. This is the link button, I don't just want to make it invisible because it still takes up available space, I would actually like to remove the child from the stage. mx:LinkButton id=aboutMeLink label=? click=showAbout(event)/ If I use the following this.removeChild(aboutMeLink); I get the following error, just wondering what im doing wrong. The supplied DisplayObject must be a child of the caller. Thank You Dan Vega
Re: [flexcoders] Re: Remove Child
Thats exactly what was going on... thanks for the response. Thank You Dan Vega On Mon, Aug 4, 2008 at 10:29 AM, Michael VanDaniker [EMAIL PROTECTED] wrote: My guess is that you have something like this... mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Canvas id=canvas mx:LinkButton id=aboutMeLink /mx:Canvas /mx:Application If that's the case, the aboutMeLink is a child of canvas and you'll need to call canvas.removeChild(aboutMeLink); If you just want the LinkButton to not take up space you can set its includeInLayout property to false. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Dan Vega [EMAIL PROTECTED] wrote: I have a variable and based on its true/false value I want to display a link. This is the link button, I don't just want to make it invisible because it still takes up available space, I would actually like to remove the child from the stage. mx:LinkButton id=aboutMeLink label=? click=showAbout(event)/ If I use the following this.removeChild(aboutMeLink); I get the following error, just wondering what im doing wrong. The supplied DisplayObject must be a child of the caller. Thank You Dan Vega
[flexcoders] Selected Items in a datagrid
I have a datagrid with a custom renderer for the id column. What I want to accomplish is letting the user select as many rows as they want by clicking on the checkbox in the first column. When they click the export button I will do some logic to export only the selected records to a txt file. Going by the solution below how can i figure out what indexes are selected? Even if i can't easily get a list of all the id's I can run over the index list and get the actuall id's. If there is a better way to do this and I am going about this the wrong way please speak up! Thanks in advance! mx:DataGrid id=contacts width=100% height=100% dataProvider={_data} mx:columns mx:DataGridColumn dataField=id headerText=Select width=40 textAlign=center mx:itemRenderer mx:Component mx:CheckBox click=/ /mx:Component /mx:itemRenderer /mx:DataGridColumn mx:DataGridColumn dataField=companyName headerText=Company/ mx:DataGridColumn dataField=firstName headerText=First Name/ mx:DataGridColumn dataField=lastName headerText=Last Name/ mx:DataGridColumn dataField=city headerText=City/ mx:DataGridColumn dataField=state headerText=State/ /mx:columns /mx:DataGrid Thank You Dan Vega [EMAIL PROTECTED] http://www.danvega.org
[flexcoders] File Explorer
I am building a full featured file explorer and I am stuck on one part of the application. On the left hand side I will have a base root directory (root) and a listing of all directories that fall under it (no end). When you click on a folder they will show up in the datagrid to the right. My question is actually 2 parts. 1.) What approach should I take. Do I make one call to my server and build the entire folder structure, then return either and arraycollection or xmllistcollection or should I just grab the list of directories and show an arrow next to directories with sub directories indicating that there are sub directories. When you click on that folder make another call to the server to grab that sub directory list and so on. 2.) The second part of the question is i heard that If I am going to be updating this collection (deleting / adding / renaming directories) that I should be using an ArrayCollection. The question is when I have data like there is below, how do I break it down into parent/child nodes? Every example I have seen of the tree always uses xml as the data and in those examples its clear how to break down child / parent relationships. ** Any help on this how to move forward with this would be great help ** [0] (Object)#3 Attributes = DateLastModified = Sat Nov 1 13:21:02 GMT-0400 2008 Directory = H:\JRun4 hasDirs = 0 Mode = Name = bin Path = H:\JRun4\bin Size = 0 Type = Dir [1] (Object)#4 Attributes = DateLastModified = Fri Aug 3 21:55:23 GMT-0400 2007 Directory = H:\JRun4 hasDirs = 1 Mode = Name = docs Path = H:\JRun4\docs Size = 0 Type = Dir Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] File Explorer
Thank you so much! After screwing around with this for awhile I am finding that to be the real problem. When you get into unlimited numbers of sub directories the array collection becomes very hard to manage. I think to return my list of files an arrayCollection will work just fine but for the directory structure I am going to produce xml. Also I think when we we are just talking about directories, I might as well go build them all out now __,_,_ Thank You Dan Vega
Re: [flexcoders] File Explorer
So I am working with the file explorer and I came across another problem. Server side I am writing out the following xml root node label=Root Directory node label=bin path=H:\JRun4\bin isBranch=false/ node label=docs path=H:\JRun4\docs isBranch=true/ node label=jnbridge path=H:\JRun4\jnbridge isBranch=true/ node label=jre path=H:\JRun4\jre isBranch=true/ node label=lib path=H:\JRun4\lib isBranch=true/ node label=logs path=H:\JRun4\logs isBranch=false/ node label=servers path=H:\JRun4\servers isBranch=true/ node label=uninstall path=H:\JRun4\uninstall isBranch=true/ node label=verity path=H:\JRun4\verity isBranch=true/ /node /root __,_._,_ My 1st problem is when its an array collection I know how to get the 1st item (getItemAt(0)) but here i have no idea how to tell the tree to expand. private function buildTree(event:ResultEvent):void { _treedata = new XML(event.result); tree.expandChildrenOf(_treedata,true); } Also, now that I have my basic structure, i am not quite sure what the approach is. Here i have a listener function so that when the folder is opened we can make another trip the server. private function onItemOpen(event:TreeEvent):void { var path:String = event.it...@path; //trip to the server. } ** on that trip back to the server do I have a different function that re writes my xml strucutre or am I just inserting the new xml block somewhere? If I am just inserting how do I replace the block node label=logs path=H:\JRun4\logs isBranch=false/ If anyone has an example of what I am doing please let me know.
Re: [flexcoders] Re: File Explorer
This is great stuff, thanks so much to all of you. For the record I am not arguing with anyone, I am just trying to learn the most efficient way of doing things. With that being said and a ton of screwing around with code I have come up with my solution (half way there). I have decided to only load the top level directories for a given path for speed purposes. I will start a new thread so that you can check out where i am Thanks to all! Dan
[flexcoders] Tree and array data
I am in the middle of building a file explorer and I have come to a stumbling block. I have a simple screen that has a tree on the left and a grid on the right. My ColdFusion components return an array and I end up with something that looks like this. So far it works great but all of my directories are showing up as leafs. When I was messing around with the xml side I was able to provide an attribute called isBranch. This gave the representation that there were sub directories to this folder. The haschildren variable is letting me know if this directory has any child dirs. How can I represent to the user that this is a branch. After that I a pretty sure I can work through making another call to the server and updating my array. Thanks for the help in advance! (Array)#0 [0] (Object)#1 HASCHILDREN = true LASTMODIFIED = 1222802792572 NAME = Avaya_Support PATH = C:\Avaya_Support [1] (Object)#2 HASCHILDREN = true LASTMODIFIED = 1190926722375 NAME = dell PATH = C:\dell ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical verticalScrollPolicy=off horizontalScrollPolicy=off creationComplete=init(); mx:Script ![CDATA[ // imports import flash.events.Event; import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.utils.ObjectUtil; public static var ROOT:String = C:\\; [Bindable] private var _directories:Array = new Array(); [Bindable] private var _files:Array = new Array(); // init private function init():void { // grab the top level directories FileManager.getDirectories(ROOT); // set the status bar setStatusText(ROOT); } private function listDirectories(event:ResultEvent):void { _directories = event.result as Array; } private function listFiles(event:ResultEvent):void { _files = event.result as Array; } private function onItemChange(event:Event):void { var currentPath:String = event.currentTarget.selectedItem.PATH; FileManager.getFiles(currentPath); setStatusText(currentPath); } private function setStatusText(msg:String):void { txtStatus.text = Current Location: + msg; } ]] /mx:Script mx:RemoteObject id=FileManager destination=ColdFusion source=FFManager.src.cfc.FileManager showBusyCursor=true mx:method name=getDirectories result=listDirectories(event)/ mx:method name=getFiles result=listFiles(event)/ /mx:RemoteObject mx:Panel width=100% height=100% title=Extranet File Manager mx:HBox width=100% height=20 mx:Spacer width=100%/ mx:Label text=List/ mx:Label text=Thumbnails/ /mx:HBox mx:HDividedBox width=100% height=100% horizontalScrollPolicy=off verticalScrollPolicy=off mx:Tree id=tree width=30% height=100% dataProvider={_directories} labelField=NAME showRoot=true change=onItemChange(event)/ mx:DataGrid id=filelist width=70% height=100% dataProvider={_files} allowMultipleSelection=true dragEnabled=true/ /mx:HDividedBox mx:ControlBar mx:Label id=txtStatus text=status bar/ /mx:ControlBar /mx:Panel /mx:Application
Re: [flexcoders] Tree and array data
but not every folder will be a branch, only those who have children. I can set the default leaf icon to a standar folder but I am stuck on how to treat branches using my example.
Re: [flexcoders] Tree and array data
I don't think its just icon though is it? It needs to be a branch with an arrow next to it so that you can click on it to expand the folder. Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Thu, Dec 18, 2008 at 2:43 PM, Fotis Chatzinikos fotis.chatzini...@gmail.com wrote: use iconFunction=yourFunction() where yourfunction checks your isLeaf variable and assigns a folder or leaf icon On Thu, Dec 18, 2008 at 9:07 PM, Dan Vega danv...@gmail.com wrote: but not every folder will be a branch, only those who have children. I can set the default leaf icon to a standar folder but I am stuck on how to treat branches using my example. -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation fotis.chatzini...@gmail.com,
Re: [flexcoders] Re: Tree and array data
I think I am finally getting some where. In case you don't know what I have been up to I will bring you up to speed. I am building a file explorer where the left side will only be directories. When you select a directory the contents (files) will show up in a datagrid on the right. I was having some issue with display branches but I solved that by inserting an empty array on any folder i knew had children. Now I am trying to append the directories when the user starts drilling down. So first I have an onItemOpen() method for when the folder is opened. All this does is figure out the path and call my server side function that will retrieve me a list of directories for a given path. private function onItemOpen(event:TreeEvent):void { var path:String = event.item.path; FileManager.getDirectories(path); } I have a onResult method for the getDirectories() method called listDirectories(). What I am doing here is 1. getting the list of directories. 2. if the tree data provider (_directorheies) is null we know this is the base. 3. if not I am trying to figure out a way to append this array (or swap out) with the children empty array i have as a placeholder. Is this the right approach? I am obviously doing something wrong, hope someone can point that out! private function listDirectories(event:ResultEvent):void { var dirs:Array = event.result as Array; var parent:String = dirs[0].parent; var pos:uint = -1; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { // we know the parent of the item that was clicked, find the array position for(var i in _directories){ if(_directories[i].path == parent){ pos = i; break; } } //if we found the position append the directories to the children node _directories[i].children = dirs; trace(ObjectUtil.toString(_directories)); } }
Re: [flexcoders] Re: Tree and array data
nm..im a dummy! got it On Fri, Dec 19, 2008 at 3:06 PM, Dan Vega danv...@gmail.com wrote: I think I am finally getting some where. In case you don't know what I have been up to I will bring you up to speed. I am building a file explorer where the left side will only be directories. When you select a directory the contents (files) will show up in a datagrid on the right. I was having some issue with display branches but I solved that by inserting an empty array on any folder i knew had children. Now I am trying to append the directories when the user starts drilling down. So first I have an onItemOpen() method for when the folder is opened. All this does is figure out the path and call my server side function that will retrieve me a list of directories for a given path. private function onItemOpen(event:TreeEvent):void { var path:String = event.item.path; FileManager.getDirectories(path); } I have a onResult method for the getDirectories() method called listDirectories(). What I am doing here is 1. getting the list of directories. 2. if the tree data provider (_directorheies) is null we know this is the base. 3. if not I am trying to figure out a way to append this array (or swap out) with the children empty array i have as a placeholder. Is this the right approach? I am obviously doing something wrong, hope someone can point that out! private function listDirectories(event:ResultEvent):void { var dirs:Array = event.result as Array; var parent:String = dirs[0].parent; var pos:uint = -1; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { // we know the parent of the item that was clicked, find the array position for(var i in _directories){ if(_directories[i].path == parent){ pos = i; break; } } //if we found the position append the directories to the children node _directories[i].children = dirs; trace(ObjectUtil.toString(_directories)); } }
[flexcoders] Tree problems
I am still having some tree / array issues that I am hoping to get some help on. My tree loads an array of data that looks like this. Items with a children array tell me that this folder should be a branch and it has children. When you click on the branch I want to go retrieve the list of directories for that folder and update the array with the new directory data. (Array)#0 [0] (Object)#1 lastModified = 1225560062218 name = bin parent = H:\JRun4 path = H:\JRun4\bin [1] (Object)#2 children = (Array)#3 lastModified = 1186192523437 name = docs parent = H:\JRun4 path = H:\JRun4\docs My itemOpen listener event basically get the path of the folder being opened and fetch the directories for that path. private function onItemOpen(event:TreeEvent):void { var path:String = event.item.path; holder = event.item.children; FileManager.getDirectories(path); } When the list of directories is called this method is the result handler. IF the tree data provider is null we know its top level. What I thought I could do is setup a variable called holder that would the array object of the item above. I thought this would pass the reference of that object and using that reference i could set the new dirs into that empty array. This is not really working so I was wondering if anyone has some ideas or what the right approach should be. private function listDirectories(event:ResultEvent):void { var dirs:Array = event.result as Array; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { // what do we do now? holder = dirs; } } Thanks for the help! Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Tree problems
If you read through the post I am actually passed that and now trying to figure out how to dynamically insert / remove nodes. Dan
Re: [flexcoders] Tree problems
I am not sure what you mean by getChildren() though, when a branch is clicked this method is called. private function onItemOpen(event:TreeEvent):void { var path:String = event.item.path; FileManager.getDirectories(path); } The getDirectories() method of the remote object call has a result handler called listDirectories(). So based on the path of the node that is clicked (request for drill down) we make a remote call to get a list of directories for that path. Im not sure between these 2 stpes how to add my new array of directories to the empty children array of the node that was clicked. private function listDirectories(event:ResultEvent):void { var dirs:Array = event.result as Array; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { //? } } hope that makes a little more sense.
Re: [flexcoders] Tree problems
The current target of the event is that, I don't think that will work? mx.rpc.remoting.mxml.Operation (@2a9494c1) On Sat, Dec 20, 2008 at 11:01 AM, ivo cervantes_v...@yahoo.com wrote: The way I have handled it is by getting a reference to the children array and update the array with the retrieved data, somethin akin to: private function listDirectories( event:ResultEven t):void { var _node:Object = event.currentTarget; _node.children = event.result as Array; } - Ivo -- *From:* Dan Vega danv...@gmail.com *To:* flexcoders@yahoogroups.com *Sent:* Friday, December 19, 2008 10:28:29 PM *Subject:* Re: [flexcoders] Tree problems I am not sure what you mean by getChildren( ) though, when a branch is clicked this method is called. private function onItemOpen(event: TreeEvent) :void { var path:String = event.item.path; FileManager. getDirectories( path); } The getDirectories( ) method of the remote object call has a result handler called listDirectories( ). So based on the path of the node that is clicked (request for drill down) we make a remote call to get a list of directories for that path. Im not sure between these 2 stpes how to add my new array of directories to the empty children array of the node that was clicked. private function listDirectories( event:ResultEven t):void { var dirs:Array = event.result as Array; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { //? } } hope that makes a little more sense.
Re: [flexcoders] Tree problems
Well i used that approach before and now I am back to using the same approach. A placholder to that array works great but the problem I had before is coming up again. when I click the folder no data shows up but the data is in the array. If i close it and open it again it shows up. The tree is just not updating for whatever reason. Is there something I need to do to refresh everything? Dan On Sat, Dec 20, 2008 at 2:17 PM, Dan Vega danv...@gmail.com wrote: The current target of the event is that, I don't think that will work? mx.rpc.remoting.mxml.Operation (@2a9494c1) On Sat, Dec 20, 2008 at 11:01 AM, ivo cervantes_v...@yahoo.com wrote: The way I have handled it is by getting a reference to the children array and update the array with the retrieved data, somethin akin to: private function listDirectories( event:ResultEven t):void { var _node:Object = event.currentTarget; _node.children = event.result as Array; } - Ivo -- *From:* Dan Vega danv...@gmail.com *To:* flexcoders@yahoogroups.com *Sent:* Friday, December 19, 2008 10:28:29 PM *Subject:* Re: [flexcoders] Tree problems I am not sure what you mean by getChildren( ) though, when a branch is clicked this method is called. private function onItemOpen(event: TreeEvent) :void { var path:String = event.item.path; FileManager. getDirectories( path); } The getDirectories( ) method of the remote object call has a result handler called listDirectories( ). So based on the path of the node that is clicked (request for drill down) we make a remote call to get a list of directories for that path. Im not sure between these 2 stpes how to add my new array of directories to the empty children array of the node that was clicked. private function listDirectories( event:ResultEven t):void { var dirs:Array = event.result as Array; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { //? } } hope that makes a little more sense.
Re: [flexcoders] Tree problems
Same result .. private function listDirectories(event:ResultEvent):void { var dirs:Array = event.result as Array; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { hold.children = dirs; } //trace( ObjectUtil.toString(_directories) ); (tree.dataProvider as ArrayCollection).dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)); }
Re: [flexcoders] Tree problems
I actually stuck a placeholder on to the empty array and now everything seems to be working out ok, thanks for the help guys! Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Sat, Dec 20, 2008 at 4:29 PM, Dan Vega danv...@gmail.com wrote: Same result .. private function listDirectories(event:ResultEvent):void { var dirs:Array = event.result as Array; // if the _directories array is null this is our root request if(_directories == null) { _directories = dirs; }else { hold.children = dirs; } //trace( ObjectUtil.toString(_directories) ); (tree.dataProvider as ArrayCollection).dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)); }
Re: [flexcoders] Re: Tree problems
I would rather take that approach because there can be an infinite number of children and I want it to be fast. Thats why Ithink loading when requested is better for this scenario. How can I tell the tree to refresh its view? Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] ActionScript RemoteObject - Trying to learn so please be patient :-)
Your RO variable is out of scope, you defined as a local variable to the constructor. You need to set it up outside of there. public class ProjectGateway { private var RO:RemoteObject; ProjectGateway() { RO = new RemoteObject(); RO.destination = ColdFusion; RO.source = com.isavepets.projects.projectGateway; RO.addEventListener(FaultEvent.FAULT, faultHandler); var list:Operation = new Operation(RO, list); } ProjectGateway.as package com.isavepets.projects { import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.remoting.Operation; import mx.rpc.remoting.RemoteObject; public class ProjectGateway { public function ProjectGateway() { var RO:RemoteObject = new RemoteObject(); RO.destination = ColdFusion; RO.source = com.isavepets.projects.projectGateway; RO.addEventListener(FaultEvent.FAULT, faultHandler); var list:Operation = new Operation(RO, list); } public function list():ArrayCollection { var projectData:ArrayCollection = RO.list(); return projectData; } private function faultHandler(e:FaultEvent):void { Alert.show(e.fault.message, 'Project Gateway Error'); } } } Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Re: Tree problems
I appreciate the help! Does anyone have an example of this? I have a hard time believing that I am the first person to attempt something like this. For small sub directories it seems to be working fine but any large data set does not work, you need to close the node and then re open it.
Re: [flexcoders] Re: Tree problems
Ok, I think I found the solution but it was basically through guessing, can anyone tell me why I need both of these ? tree.invalidateList(); tree.invalidateDisplayList();
[flexcoders] Center a Popup window
I am trying to center a popup window that is being displayed from a tree. If you just call the static centerPopUp it centers it in the tree. When you add the popup though i noticed the second argument is the parent object. How can I get a reference to the stage itself so I can center this popup correctly. //add modal window PopUpManager.addPopUp(_renamedir,this,true); //center modal window PopUpManager.centerPopUp(_renamedir); Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Center a Popup window
I forgot to mention, I am inside of a custom renderer. I tried both suggestions and they did not work.
Re: [flexcoders] Center a Popup window
This is my example. I am not creating one as it is already available, just trying to add it and center it. _renamedir = new RenameDirectory //add modal window PopUpManager.addPopUp(_renamedir,this,true); //center modal window PopUpManager.centerPopUp(_renamedir); Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Sat, Dec 27, 2008 at 4:12 PM, Manish Jethani manish.jeth...@gmail.comwrote: On Sun, Dec 28, 2008 at 2:19 AM, Dan Vega danv...@gmail.comdanvega%40gmail.com wrote: I forgot to mention, I am inside of a custom renderer. I tried both suggestions and they did not work. Here's a small example: ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns=* mx:Script ![CDATA[ import mx.managers.PopUpManager; import mx.containers.Panel; private function testIt():void { var p:* = PopUpManager.createPopUp(DisplayObject(Application.application), Panel); p.width = 200; p.height = 200; p.title = Pop-Up Window; PopUpManager.centerPopUp(p); } ]] /mx:Script mx:Button click=testIt() label=Test / /mx:Application You could run the testIt method from anywhere (even from within an item renderer), and the result would be the same. I'd have to see your code to really figure out why this isn't working for you. -- Visit me at manishjethani.com
Re: [flexcoders] Center a Popup window
I get a compile time error if i do this _renamedir = new RenameDirectory //add modal window PopUpManager.addPopUp(_renamedir,Application.application,true); //center modal window PopUpManager.centerPopUp(_renamedir); *** Implicit coercion of a value with static type object to possibly undefined type flash.display.DisplayObject
Re: [flexcoders] Center a Popup window
Thank you so much for the help Manish, that solution ended up working out great! Dan
[flexcoders] Custom Event Problem
For the file manager I am writing I am having an issue with dispatching a custom event. I have a tree on the left with a custom tree item renderer. In that renderer I have setup a context menu so the user can rename/remove/add directories easily. private function renameDirectory(event:ContextMenuEvent):void { _renamedir = new RenameDirectory _renamedir.oldDirectoryName = data.name; _renamedir.parentPath = data.parent; //add modal window PopUpManager.addPopUp(_renamedir,DisplayObject(Application.application),true); //center modal window PopUpManager.centerPopUp(_renamedir); } My RenameDirectory component works well and does the renaming just fine. The problem I am having is once the folder is renamed i need to refresh the tree to show the changes. I figured for all of my options (add/remove/delete) would just dispatch a custom event. Here is my RenameDirectory.mxml That is dispatching my custom event. ?xml version=1.0 encoding=utf-8? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Rename Directory width=300 height=125 showCloseButton=true creationComplete=centerWindow() close=closeWindow() mx:Metadata [Event(name=refreshTree,type=events.RefreshTreeEvent)] /mx:Metadata mx:Script ![CDATA[ import mx.rpc.remoting.mxml.RemoteObject; import mx.controls.Alert; import mx.managers.PopUpManager; import events.RefreshTreeEvent; public var parentPath:String; public var oldDirectoryName:String; private var ro:RemoteObject = new RemoteObject(); private function centerWindow():void { PopUpManager.centerPopUp(this); } private function closeWindow():void { PopUpManager.removePopUp(this); } private function renameDirectory(event:Event):void { var _old = parentPath + \\ + oldDirectoryName; var _new = parentPath + \\ + newDirectoryName.text; if(_new != _old) { // rename the directory ro.destination = ColdFusion; ro.source = FFManager.src.cfc.FileManager; ro.renameDirectory(_old,_new); ro.showBusyCursor = true; dispatchEvent(new RefreshTreeEvent(refreshTree)); closeWindow(); } } ]] /mx:Script mx:HBox verticalCenter=0 horizontalCenter=0 mx:TextInput id=newDirectoryName text={oldDirectoryName} width=200/ mx:Button label=Save click=renameDirectory(event)/ /mx:HBox /mx:TitleWindow And my custom event. package events { import flash.events.Event; public class RefreshTreeEvent extends Event { public static const REFRESH_TREE:String = refreshTree; public function RefreshTreeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } } } The problem I am having is that I am unable to listen for this event in my main application. If I add this.addEventListener(RefreshTreeEvent.REFRESH_TREE,reloadTree); The reloadTree method is never called. What am I doing wrong? Thanks again..
Re: [flexcoders] File Uploading
I have one written in Flex/ColdFusion http://cfmu.riaforge.org Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Mon, Dec 29, 2008 at 2:28 AM, Fernando Cabredo fcabred...@yahoo.comwrote: Hi, The PHP file is not included in the source file. Do you know where to find it? Thank you. Pando -- *From:* freak182 eman.noll...@gmail.com *To:* flexcoders@yahoogroups.com *Sent:* Monday, December 29, 2008 11:51:46 AM *Subject:* RE: [flexcoders] File Uploading Hello, Thank you for your help...I just found nice flex uploading here: http://weblog. cahlan.com/ files/file_ uploads/FileUplo ad.html.. .theyhttp://weblog.cahlan.com/files/file_uploads/FileUpload.html...theyuse php for server side ...actually it works but it gives me IOError #2038 ...im using servlet to upload file and my server is embeded jetty server run using mvn jetty:run-war. Is there any workaround with this? Thanks a lot Cheers Gregor Kiddie wrote: What's the problem you are having? Give a bit more information and we can see if we can help. Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co. uk blocked::http://www.inps. co.uk/ http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact is.helpdesk@ inps.co.uk is.helpdesk%40inps.co.uk _ _ __ From: flexcod...@yahoogro ups.com flexcoders%40yahoogroups.com[mailto:flexcod...@yahoogro ups.com flexcoders%40yahoogroups.com] On Behalf Of freak182 Sent: 28 December 2008 15:01 To: flexcod...@yahoogro ups.com flexcoders%40yahoogroups.com Subject: Re: [flexcoders] File Uploading Hello, Did you solve your problem in file uploading, because im having problem too with file upload in flex. Thanks a lot. Cheers. ericbichara wrote: O btw, i get no error message, just a Complete event back in flex /Eric -- View this message in context: http://www.nabble. com/File- Uploading- tp17081739p21193 016.htmlhttp://www.nabble.com/File-Uploading-tp17081739p21193016.html http://www.nabble. com/File- Uploading- tp17081739p21193 016.htmlhttp://www.nabble.com/File-Uploading-tp17081739p21193016.html Sent from the FlexCoders mailing list archive at Nabble.com. -- View this message in context: http://www.nabble. com/File- Uploading- tp17081739p21198 780.htmlhttp://www.nabble.com/File-Uploading-tp17081739p21198780.html Sent from the FlexCoders mailing list archive at Nabble.com.
Re: [flexcoders] Re: Custom Event Problem
I thought about that as well but it did not work. Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Mon, Dec 29, 2008 at 12:01 PM, valdhor valdhorli...@embarqmail.comwrote: Try changing the bubbles property to true. The event needs to bubble to the top so that the application sees it. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Dan Vega danv...@... wrote: For the file manager I am writing I am having an issue with dispatching a custom event. I have a tree on the left with a custom tree item renderer. In that renderer I have setup a context menu so the user can rename/remove/add directories easily. private function renameDirectory(event:ContextMenuEvent):void { _renamedir = new RenameDirectory _renamedir.oldDirectoryName = data.name; _renamedir.parentPath = data.parent; //add modal window PopUpManager.addPopUp(_renamedir,DisplayObject(Application.application),true); //center modal window PopUpManager.centerPopUp(_renamedir); } My RenameDirectory component works well and does the renaming just fine. The problem I am having is once the folder is renamed i need to refresh the tree to show the changes. I figured for all of my options (add/remove/delete) would just dispatch a custom event. Here is my RenameDirectory.mxml That is dispatching my custom event. ?xml version=1.0 encoding=utf-8? mx:TitleWindow xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute title=Rename Directory width=300 height=125 showCloseButton=true creationComplete=centerWindow() close=closeWindow() mx:Metadata [Event(name=refreshTree,type=events.RefreshTreeEvent)] /mx:Metadata mx:Script ![CDATA[ import mx.rpc.remoting.mxml.RemoteObject; import mx.controls.Alert; import mx.managers.PopUpManager; import events.RefreshTreeEvent; public var parentPath:String; public var oldDirectoryName:String; private var ro:RemoteObject = new RemoteObject(); private function centerWindow():void { PopUpManager.centerPopUp(this); } private function closeWindow():void { PopUpManager.removePopUp(this); } private function renameDirectory(event:Event):void { var _old = parentPath + \\ + oldDirectoryName; var _new = parentPath + \\ + newDirectoryName.text; if(_new != _old) { // rename the directory ro.destination = ColdFusion; ro.source = FFManager.src.cfc.FileManager; ro.renameDirectory(_old,_new); ro.showBusyCursor = true; dispatchEvent(new RefreshTreeEvent(refreshTree)); closeWindow(); } } ]] /mx:Script mx:HBox verticalCenter=0 horizontalCenter=0 mx:TextInput id=newDirectoryName text={oldDirectoryName} width=200/ mx:Button label=Save click=renameDirectory(event)/ /mx:HBox /mx:TitleWindow And my custom event. package events { import flash.events.Event; public class RefreshTreeEvent extends Event { public static const REFRESH_TREE:String = refreshTree; public function RefreshTreeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } } } The problem I am having is that I am unable to listen for this event in my main application. If I add this.addEventListener(RefreshTreeEvent.REFRESH_TREE,reloadTree); The reloadTree method is never called. What am I doing wrong? Thanks again..
Re: [flexcoders] Re: Custom Event Problem
Just so I am clear are you saying because I told the PopUpManager that the parent was the application my event is not bubbling up correctly? Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Re: Custom Event Problem
got ya,thanks! Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Re: Custom Event Problem
I think you make a great point but im just not sure how to do it. The data provider for the tree is not getting updated just yet. What I am doing is throwing a popup on the screen with what you want to rename the folder to. I do the renaming on the server side. Somehow I have to tell my main application to call the getDirectories() method again. I can do it from the view without really repeating a ton of stuff. Im just kind of stuck on how to make another call back to the server to list the dirs again. Thank You Dan Vega danv...@gmail.com http://www.danvega.org
[flexcoders] Searching Multi Demensional arrays
I have an infinite number of objects child objects that looks something like this below. I know this if it was just one level I could probably accomplish what i need but I am not sure how to do this. All of the path items are always going to be unique. Is there a way to search (drilling down as far as needed) and say give me the object where path = xyz; (Array)#0 [0] (Object)#1 children = (Array)#2 [0] (Object)#3 children = (Array)#4 lastModified = 1230587039867 name = parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\ [1] (Object)#5 lastModified = 1230580833728 name = another_one parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\another_one [2] (Object)#6 children = (Array)#7 lastModified = 1230587312776 name = dan parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\dan [3] (Object)#8 lastModified = 1230581177910 name = ggg parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\ggg [4] (Object)#9 lastModified = 1230581240020 name = hjkl parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\hjkl [5] (Object)#10 lastModified = 1230580116200 name = l parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\l [6] (Object)#11 lastModified = 1230575547578 name = nnn parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\nnn [7] (Object)#12 lastModified = 1230575859098 name = test parent = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data\test mx_internal_uid = B8E4886E-A00D-6D89-CBAA-84C60F791112 name = Home path = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\FFManager\src\data Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Searching Multi Demensional arrays
I am grabbing these values from a server side service like so var dirs:Array = event.result as Array; So in the end with an endless amount of children am I still going to have to loop through everything to map them as they come in? Thank You Dan Vega danv...@gmail.com http://www.danvega.org
[flexcoders] Real World Flex/ColdFusion
I just wanted to let everyone know about the series of articles I have been working on. I got a lot of help on this project from this list so I thought you might want to see how it turned out. http://www.danvega.org/blog/index.cfm/2009/1/2/Real-World-FlexColdFusion-Part-1 http://www.danvega.org/blog/index.cfm/2009/1/2/Real-World-FlexColdFusion-Part-2 http://www.danvega.org/blog/index.cfm/2009/1/3/Real-World-FlexColdFusion-Part-3 http://www.danvega.org/blog/index.cfm/2009/1/6/Real-World-FlexColdFusion-Part-4 http://www.danvega.org/blog/index.cfm/2009/1/6/Real-World-FlexColdFusion-Part-5 Thank You Dan Vega danv...@gmail.com http://www.danvega.org
[flexcoders] Custom Tree Item Renderer
I have a custom tree item renderer that is working out great except one little small problem. In my item renderer I have some actions for adding / removing / renaming directories. The only time I don't want the remove or rename context menu items is when its the home directory. I know that I can hack it and hard code it here because the data object is passed to each function. What I am trying to do though is going back to the main part of the applicaiton (or pass in) the baseDirectory so I can account for change. Has anyone got data in/or out of a renderer before? If it was just another class it would be easy to put in the constructor but there is no constructor when you add it to the tree. itemRenderer=com.rocketfm.CustomTreeItemRenderer package com.rocketfm { import flash.display.DisplayObject; import flash.events.ContextMenuEvent; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; import mx.collections.*; import mx.controls.treeClasses.*; import mx.core.Application; import mx.managers.PopUpManager; import views.AddDirectory; import views.DeleteDirectory; import views.RenameDirectory; public class CustomTreeItemRenderer extends TreeItemRenderer { private var renameWin:RenameDirectory; private var addWin:AddDirectory; private var delWin:DeleteDirectory; public function CustomTreeItemRenderer(basePath) { super(); var menu:ContextMenu = new ContextMenu(); var add:ContextMenuItem = new ContextMenuItem(Add Folder); var remove:ContextMenuItem = new ContextMenuItem(Remove Folder); var rename:ContextMenuItem = new ContextMenuItem(Rename Folder); var download:ContextMenuItem = new ContextMenuItem(Download All); add.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,addDirectory); remove.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,removeDirectory); rename.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,renameDirectory); menu.hideBuiltInItems(); menu.customItems.push(add); menu.customItems.push(remove); menu.customItems.push(rename); this.contextMenu = menu; } private function addDirectory(event:ContextMenuEvent):void { addWin = new AddDirectory(); addWin.dirPath = data.path; addWin.parentPath = data.parent; addWin.item = data; // add window PopUpManager.addPopUp(addWin,DisplayObject(Application.application),true); } private function removeDirectory(event:ContextMenuEvent):void { delWin = new DeleteDirectory(); delWin.item = data; // delete window PopUpManager.addPopUp(delWin,DisplayObject(Application.application),true); } private function renameDirectory(event:ContextMenuEvent):void { renameWin = new RenameDirectory(); renameWin.item = data; renameWin.oldDirectoryName = data.name; renameWin.parentPath = data.parent; // rename window PopUpManager.addPopUp(renameWin,DisplayObject(Application.application),true); } } } Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Custom Tree Item Renderer
Thats exactly what I am looking for, a way to access public variables from within the custom item renederer. Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Fri, Jan 9, 2009 at 5:27 PM, Tracy Spratt tspr...@lariatinc.com wrote: I am not exactly sure what you are trying to do. Are you trying to test the data Item to see if it is the root node of the tree? What is the dataProvider? If it is xml, you could test for parent() == null. If it is nested collections then your connections would need to exponse a parent poperty. Of course, within an itemRender instance, as with any instance you can access public members through the dom properties, like parentDocument, and Application.application Tracy Spratt Lariat Services Flex development bandwidth available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Dan Vega *Sent:* Friday, January 09, 2009 3:50 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Custom Tree Item Renderer I have a custom tree item renderer that is working out great except one little small problem. In my item renderer I have some actions for adding / removing / renaming directories. The only time I don't want the remove or rename context menu items is when its the home directory. I know that I can hack it and hard code it here because the data object is passed to each function. What I am trying to do though is going back to the main part of the applicaiton (or pass in) the baseDirectory so I can account for change. Has anyone got data in/or out of a renderer before? If it was just another class it would be easy to put in the constructor but there is no constructor when you add it to the tree. itemRenderer=com.rocketfm.CustomTreeItemRenderer package com.rocketfm { import flash.display.DisplayObject; import flash.events.ContextMenuEvent; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; import mx.collections.*; import mx.controls.treeClasses.*; import mx.core.Application; import mx.managers.PopUpManager; import views.AddDirectory; import views.DeleteDirectory; import views.RenameDirectory; public class CustomTreeItemRenderer extends TreeItemRenderer { private var renameWin:RenameDirectory; private var addWin:AddDirectory; private var delWin:DeleteDirectory; public function CustomTreeItemRenderer(basePath) { super(); var menu:ContextMenu = new ContextMenu(); var add:ContextMenuItem = new ContextMenuItem(Add Folder); var remove:ContextMenuItem = new ContextMenuItem(Remove Folder); var rename:ContextMenuItem = new ContextMenuItem(Rename Folder); var download:ContextMenuItem = new ContextMenuItem(Download All); add.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,addDirectory); remove.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,removeDirectory); rename.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,renameDirectory); menu.hideBuiltInItems(); menu.customItems.push(add); menu.customItems.push(remove); menu.customItems.push(rename); this.contextMenu = menu; } private function addDirectory(event:ContextMenuEvent):void { addWin = new AddDirectory(); addWin.dirPath = data.path; addWin.parentPath = data.parent; addWin.item = data; // add window PopUpManager.addPopUp(addWin,DisplayObject(Application.application),true); } private function removeDirectory(event:ContextMenuEvent):void { delWin = new DeleteDirectory(); delWin.item = data; // delete window PopUpManager.addPopUp(delWin,DisplayObject(Application.application),true); } private function renameDirectory(event:ContextMenuEvent):void { renameWin = new RenameDirectory(); renameWin.item = data; renameWin.oldDirectoryName = data.name; renameWin.parentPath = data.parent; // rename window PopUpManager.addPopUp(renameWin,DisplayObject(Application.application),true); } } } Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Custom Tree Item Renderer
Tracy you are genius! :) Are there cases like this where you just need to do this or is it bad practice? Thank You Dan Vega danv...@gmail.com http://www.danvega.org
[flexcoders] Loading Images Using CSS
I was looking through the archives and I came to what I thought was an answer to my problem but I can't get it to work. I have logo / icon sets that I want to be able to switch between. All of the sets have there own style sheets and its working great for the buttons but i am having an issue with the logo. There is no way to define a css image but I read that you can do something like this *main.mxml* mx:Image id=logo initialize=logo.source = StyleManager.getStyleDeclaration('logo').getStyle('source')/ *stylesheet *.logo { source: assets/images/robp/rocketfm_logosmall.png; } I tried this and got the following error. I am sure I am probably just doing something wrong, anyone know what it is? TypeError: Error #1009: Cannot access a property or method of a null object reference. Thank You Dan Vega danv...@gmail.com http://www.danvega.org
[flexcoders] Loading images using binary data
I have a data grid that lists the contents of a folder an the server.What I want to do is have a button that allows the user to swap between a data grid and a list of thumbnails. There maybe a chance that these directories have more than images but for now lets just pretend they are all images. Using a remote object call I can go to the server and get the binary data for an image, like I have in the example below. I was wondering if anyone has an example of this in an item renderer and second once I grab the binary data, how can I create thumbnails of that image? ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=init() mx:Script ![CDATA[ import mx.rpc.events.ResultEvent; private var imgData:ByteArray; private function init():void { var imgData = new ByteArray(); ImageService.readImage(C:\\dan\\rocket_step7_a.png); } private function onReadImage(event:ResultEvent):void { imgData = event.result as ByteArray; var loader:Loader = new Loader(); loader.loadBytes(imgData); imageCanvas.rawChildren.addChild( loader ); } ]] /mx:Script mx:RemoteObject id=ImageService destination=ColdFusion source=ImageLoader.src.ImageService showBusyCursor=true mx:method name=readImage result=onReadImage(event)/ /mx:RemoteObject mx:Canvas id=imageCanvas width=100 height=100/ /mx:Application Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Loading images using binary data
I am able to read in images via the server returning the binary data of the image. My question is can I then create a thumbnail or should I be doing that on the server as well? Thank You Dan Vega danv...@gmail.com http://www.danvega.org