[flexcoders] Re: dynamically created access and event elements problem and
can somebody help me please this is second post with question and yet nobody answers and I am sure this is pretty easy I count on people here, but if you think I should try to find better place for help please let me know Alex ... This piece of code helps me create dynamically checkboxes in one of the Tabs in my TabNavigator my problem is how to access now to this elements so I can check their value and how to make event to make unselected some other checkbox on click checkboxes are grouped in Left and Right and only Left or Right can be selected, that's why I need an event basiclly with hand placed CheckBoxes click=3Dcb_r.selected=3Dfalse is enough but for dynamically created I need your help THANKS in ADVANCE ;)
RE: [flexcoders] Re: Reference to a class variable
The AsyncToken is dynamic. You can add pretty much anything you want to it: var callToken:AsyncToken = myDataService.send(); callToken.myProperty = whateverIWantToPutInHere: private function onResult(oEvent:ResultEvent):void { var callToken:AsyncToken = oEvent.token; var whateverIWantToPutInHere = calltoken.myProperty; Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of manfred.maierhofer Sent: Tuesday, April 03, 2007 12:31 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Reference to a class variable Thanks, but could you please give an example, how to attach the model to the token (I guess build a subclass of the AsyncToken and implement a new property that includes my model???) and most important how to reference it later in the Handler? I don't know how to reference to the class property of a current instance without creating a new instance of the ModelClass. Thanks, Mane
Re: [flexcoders] Re: Scriptable data binding
I know all that. Problem with [Bindable] keyword is that i can't use it with custom number of values I receive from server side. I suppose [Bindable] is managed at compile time. 04 Apr 2007 11:09:30 -0700, craig.drabik [EMAIL PROTECTED]: Have a look at the BindingUtils in the flex docs. That will enable you to programatically bind properties in actionscript. Make sure the properties you're binding to in your model are marked [Bindable]. As for creating buttons in actionscript, you create them like any other object and use the container's addChild and/or addChildAt methods: mx:Panel id=myPanel / mx:Script ![CDATA[ import mx.binding.utils.BindingUtils; [Bindable] public var buttonLabel:String = Hello World; var myButton:Button = new Button(); BindingUtils.bindProperty(myButton, label, buttonLabel); ]] /mx:Script
[flexcoders] Tiling a Background Image
I've just started work on the UI/Graphic Design for a Flex application and I need to tile a seamless image as the application's background. I've found that while it is possible to specify an image for the application background, I see no way to tile the image. I assume that I'll need to write my own code to tile the image, but could someone perhaps give me a tip as to where I should begin looking? Do I need to do something like subclass the Application class or is there some simple way to insert a custom component so that it becomes the application's background? Thanks! Paul
RE: [flexcoders] Re: Tree and Array
I would loop over the array and build XML. The Tree likes XML. Either use the e4x methods to build the XML, or just build a string and parse it into XML using varxml:XML = XML(strXML); Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mapper2255 Sent: Wednesday, April 04, 2007 9:18 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Tree and Array Here are a couple links: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- walking-the-tree-method/ I know it was for the Cairgorm Store but I did a keyword on these archives of: events tree cairgorm and got 52 results a lot with the tree component. Hope it helps some. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Sal [EMAIL PROTECTED] wrote: how? can't find a sample... can't find docs on it... does that mean i'll need to build a tree structure inside an array and then pass it to the data provider? if so... are there docs or samples on this? how to add an array child of an array element? Thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: You have to build up the dataprovider and pass it into the tree. If you change the dataprovider later, the tree will notice in most cases. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Sal Sent: Tuesday, April 03, 2007 5:38 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Tree and Array hi, i have an array of records received from an amfphp call and i need to fill a tree control with that data. the array has this format: aArr[0].id aArr[0].description aArr[0].parent aArr[0].order aArr[1].id aArr[1].description aArr[1].parent aArr[1].order ... and so on i didn't find any method of the control that adds node or that sets node parent. Any ideas? Thanks.
RE: [flexcoders] HTTP Response
Try: text={userRequest.lastResult.toXMLString()} But I advise using a result event handler function instead of binding directly to lastResult. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Manolet Gmail Sent: Wednesday, April 04, 2007 12:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTP Response hi, i have a code to receive a xml (httpservice) and put it into a datagrid, but i want to show the full response text into a text area... what should i do? i try with this but dont work mx:TextArea width=300 height=132 id=response text={userRequest.lastResult} / thanks in advance
[flexcoders] Re: Binding xml to dataGrid - dynamic columns
Thanks for your reply. actually, my bind function looks like: this.invalidateList(); this.invalidateProperties(); this.invalidateProperties(); this._boundData = new XMLList(data_); this.dataProvider = this._boundData..Row; It will redraw the table, but it will not generate more columns if the next dataset has more columns. I might be on completly the wrong track, but I tried to trace where it ignores the new data, and it appears to occur in DataGrid's generateCols() function. inside, there is this obj introspection - var info:Object = ObjectUtil.getClassInfo(iterator.current, [uid, mx_internal_uid]); but in this it will always check internal cache for xml objs, therefore ignoring the new xml obj. I think I am going about this wrong, or I am missing something - Thanks! --- In flexcoders@yahoogroups.com, Yiðit Boyar [EMAIL PROTECTED] wrote: did you try dataGrid.invalidateList() and or (inavlidateDisplayList) i think one of them should solve the problem... - Original Message From: kho7002 [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, April 4, 2007 1:20:56 AM Subject: [flexcoders] Binding xml to dataGrid - dynamic columns Hi, I have a dataGrid which I bind to an xml which I get from the server. The xml is of the following format: Element Value Columns3/ Columns Header h0=col 1 h1=col 2 h2=col 3 / Row c0=a1 c1=a2 c2=a3 / Row c0=b1 c1=b2 c2=b3 / /Value /Element The first time through everything works perfectly, but when we set the grid's dataProvider to a new xml, with more columns, it continues to render the original number of columns. [The dataProvider definitely has the new columns, its just that the datagrid is ignoring them. ] How can I get the grid to render the number of columns as described in the xml? thanks- !-- #ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean, sans-serif;} #ygrp-mlmsg table {font-size:inherit;font:100%;} #ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, sans-serif;} #ygrp-mlmsg pre, code {font:115% monospace;} #ygrp-mlmsg * {line-height:1.22em;} #ygrp-text{ font-family:Georgia; } #ygrp-text p{ margin:0 0 1em 0;} #ygrp-tpmsgs{ font-family:Arial; clear:both;} #ygrp-vitnav{ padding-top:10px;font-family:Verdana;font-size:77%;margin:0;} #ygrp-vitnav a{ padding:0 1px;} #ygrp-actbar{ clear:both;margin:25px 0;white-space:nowrap;color:#666;text- align:right;} #ygrp-actbar .left{ float:left;white-space:nowrap;} .bld{font-weight:bold;} #ygrp-grft{ font-family:Verdana;font-size:77%;padding:15px 0;} #ygrp-ft{ font-family:verdana;font-size:77%;border-top:1px solid #666; padding:5px 0; } #ygrp-mlmsg #logo{ padding-bottom:10px;} #ygrp-vital{ background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;} #ygrp-vital #vithd{ font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text- transform:uppercase;} #ygrp-vital ul{ padding:0;margin:2px 0;} #ygrp-vital ul li{ list-style-type:none;clear:both;border:1px solid #e0ecee; } #ygrp-vital ul li .ct{ font-weight:bold;color:#ff7900;float:right;width:2em;text- align:right;padding-right:.5em;} #ygrp-vital ul li .cat{ font-weight:bold;} #ygrp-vital a { text-decoration:none;} #ygrp-vital a:hover{ text-decoration:underline;} #ygrp-sponsor #hd{ color:#999;font-size:77%;} #ygrp-sponsor #ov{ padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;} #ygrp-sponsor #ov ul{ padding:0 0 0 8px;margin:0;} #ygrp-sponsor #ov li{ list-style-type:square;padding:6px 0;font-size:77%;} #ygrp-sponsor #ov li a{ text-decoration:none;font-size:130%;} #ygrp-sponsor #nc { background-color:#eee;margin-bottom:20px;padding:0 8px;} #ygrp-sponsor .ad{ padding:8px 0;} #ygrp-sponsor .ad #hd1{ font-family:Arial;font-weight:bold;color:#628c2a;font- size:100%;line-height:122%;} #ygrp-sponsor .ad a{ text-decoration:none;} #ygrp-sponsor .ad a:hover{ text-decoration:underline;} #ygrp-sponsor .ad p{ margin:0;} o {font-size:0;} .MsoNormal { margin:0 0 0 0;} #ygrp-text tt{ font-size:120%;} blockquote{margin:0 0 0 4px;} .replbq {margin:4;} -- __ __ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121
RE: [flexcoders] Re: HTTP Response
Always use toXMLString() with XML. toString() and trace() do not handle single nodes properly. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of iko_knyphausen Sent: Wednesday, April 04, 2007 12:49 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: HTTP Response I assume you have e4x as responseFormat and you are getting XML from the service. Try mx:TextArea width=300 height=132 id=response text={userRequest.lastResult.toString()} / --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Manolet Gmail [EMAIL PROTECTED] wrote: hi, i have a code to receive a xml (httpservice) and put it into a datagrid, but i want to show the full response text into a text area... what should i do? i try with this but dont work mx:TextArea width=300 height=132 id=response text={userRequest.lastResult} / thanks in advance
[flexcoders] Is Cairngorm 2.2 available yet?
Has Cairngorm 2.2 been released yet? I saw that they beta was available over on the cairngorm-devel group a few months ago but there has been no discussion of it since and there is nothing about it on Adobe Labs. I posted on that groups but it looks like that group does not have much traffic. Anyone know if this has been/will be released and where to find out more about it?
[flexcoders] Re: Nested Repeater Issues
Bump --- In flexcoders@yahoogroups.com, Geoffrey [EMAIL PROTECTED] wrote: I have a Repeater of CheckBoxes, which may or may not have a sublayer of CheckBoxes. It should look something like: [] archive 1 [] archive 2 [] dataSource 1 [] dataSource 2 [] dataSource 3 [] archive 3 By default all CheckBoxes are unselected, and any sublayer CheckBoxes are not enabled. If you select a CheckBox(archive 2) that has sublayer CheckBoxes (dataSource 1- 3), they are enabled. If you unselect a CheckBox that has sublayer CheckBoxes, they are disabled and unselected. I'm using the Cairngorm framework, so the call results from the database are returned to my model. This model is used as the dataProvider for the Repeater. The issue is that I can not update my model and have the sublayer Repeater update properly. For example, if there are three sublayer CheckBoxes (like above), selecting the parent CheckBox (archive 2) will enable only the first 2 sublayer CheckBoxes (dataSource 1 2). Then deselecting the parent CheckBox will disable the first 2 sublayer CheckBoxes, but enable the third (dataSource 3). From this point on the enabled property for dataSource 12 will be in a opposite state from dataSource 3. Below are code snippets: Library.mxml: mx:Repeater id=archiveRepeater dataProvider={__model.archiveElements} mx:CheckBox id=archive label={archiveRepeater.currentItem.archiveName} click=__model.archiveChanged(event)/ mx:Repeater id=dataSourceRepeater dataProvider= {archiveRepeater.currentItem.archiveDataRepositories} mx:CheckBox id=dataSource label={dataSourceRepeater.currentItem.repositoryName} enabled={dataSourceRepeater.currentItem.enabled} selected={dataSourceRepeater.currentItem.selected} click=__model.dataSourceChanged(event) /mx:CheckBox /mx:Repeater /mx:Repeater LibraryModel.as: public function archiveChanged( event:MouseEvent ):void { var selectionChoice:Boolean = event.target.selected; var selectionName:String = event.target.label; var al:ArchiveLocation = ArchiveLocation(event.target.getRepeaterItem()); al.selected = selectionChoice; // Go through any data repositories // and toggle their enabled property if (al.archiveDataRepositories != null) { var adr:Array = al.archiveDataRepositories; if (selectionChoice == false) { // Deselect and disable all CheckBoxes for (var i:uint = 0; i adr.length; i++) { // Update the model adr[i].selected = false; adr[i].enabled = false; } else { // Enable all CheckBoxes for (i = 0; i adr.length; i++) { adr[i].enabled = true; } } } } } As you can tell, there are ValueObjects that store the enabled and selected attributes for the dataSource CheckBoxes. What's even weirder, is that the ValueObjects that make up the dataProvider for the Repeater are updated correctly (their selected and enabled properties), but the last CheckBox of any sublayer remains in a state that is opposite of the other grouped sublayer CheckBoxes. I've gotten around this by directly updating the display by using: event.target.document.dataSource[i][j].enabled = false; But I don't want to rely on this as it will cause issues later on. I feel that I should be able to update the dataProvider for the various Repeaters and this should update the display properly. Any suggestions would be greatly appreciated. ~Geoff~
[flexcoders] implements, include, MX and AS...
I have an interface definition and an AS include file which contains a concrete implementation which I include in various places around my code. For all my AS classes this is a very economical programming model which I have used to great effect. I just tried to use it for an MX control and I get a compilation message saying that my MX component has no implementation in spite of the fact that I am explicitly including it in the script portion of the code. Here is a snipped version of what I am doing... package pmco.interfaces { ... public interface IActionsOwner { ... function addAction(a:Action):void; ... } } I have an include file in which I have some impementations, ConcreteActionOwner.as ... public function addAction(a:Action):void { if (actions == null) actions = new ArrayCollection(); actions.addItem(a); } ... In regular AS classes I can do this... public class X implements IActionsOwner { include ConcreteActionOwner.as } and the compiler is happy. However when I do this... mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; implements=pmco.interfaces.IActionOwner mx:Script ![CDATA[ include ConcreteActionOwner.as ]] /mx:Script I get a compiler error that my class based on Canvas does not contain an implementation of IActionOwner. Anyone know whether I can do this and how?
[flexcoders] Re: Module Interface Problems
In my context, a module loading another module using ModuleLoader. The reference to the child of the ModuleLoader is always null. I have even set up a timer event that keeps checking back to see if the child is not null. Is there something specific about what I am trying to do that would cause the child to be null? - Mike --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: ModuleLoader is a convenience container. It loads in the module via ModuleManager and when READY, it starts to create the children. If you listen to READY you may see it before moduleloader had a chance to see it and create the child. -Alex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Ritchie Sent: Tuesday, April 03, 2007 1:04 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Module Interface Problems I ruled out the timing issue, but your post has some great information how to handle this. I think I have isolated the specific module loading issue to one factor. I have a module that loads another module using a mx:ModuleLoader and I am trying to access the second ModuleLoader child through the interface. I can't seem get a reference to the child of the second ModuleLoader, it always reports null. I have a successfully loaded a module and talked using the interface, but if move this within the context of another module, I get the null reference. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , - FI / Jonas Eliasson + jonas.eliasson@ wrote: That sounds like a still existing Flash issue if you try to load a swf that has a shared library attached to it. Then you will get a loaded callback before it's actually loaded. So in Flash you can check on the loaded event if current frame == 0. In that case you can't access any properties and no code will be executed yet. But you can still write to the object. In our scenario we have attached a callback event method. So when the swf is really loaded it will check if the callback exist and then execute it. Which will tell the loader that it's ready to be initiated. Something similar should be easy to implement on the module but not with a check for a frame number :-) . Should be a better solution for this. I don't want to go back to old Flash hacks hehe. //as2 example private function onLibraryLoaded(libraryClip:MovieClip, cb:CallBack):Void { var me:SharedLibraryLoader = getInstance(); if(libraryClip._currentframe == 0){ libraryClip.onComplete = new CallBack(me, me.onLibraryInitiated, null, cb); }else onLibraryInitiated(libraryClip, cb); } _ From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Michael Ritchie Sent: den 3 april 2007 11:24 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Module Interface Problems From my experience there is a definite timing issue when loading modules. The ModuleLoader ready event is fired before the Module is fully loaded and you have the ability to talk to it through a common interface (hence the error reporting access to a null value). I would term this one as a bug that is not yet documented by Adobe. This could be because some modules take longer than expected to load, I have no idea, just the observed problem with talking with modules within the ready. I also attempted to use an interface to talk with a module when the the progress event had reached 100%, but still no luck. A possible workaround would be to fire some event from inside the loaded module that tells the outside world that it is indeed loaded. The other option is to set a timer interval and keep checking if the module is loaded (meaning not reporting NULL in the ready event handler). Unless someone else as a viable solution? Adobe? Anyone? - mr --- In [EMAIL PROTECTED] mailto:flexcoders%40yahoogroups.com ups.com, kristian_wright2002 karnal69@ wrote: *BUMP* Anyone have any ideas? I still haven't found a solution... K.
RE: [flexcoders] implements, include, MX and AS...
Add import pmco.interfaces.IActionOwner in your code block b.. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of simonjpalmer Sent: Wednesday, April 04, 2007 1:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] implements, include, MX and AS... I have an interface definition and an AS include file which contains a concrete implementation which I include in various places around my code. For all my AS classes this is a very economical programming model which I have used to great effect. I just tried to use it for an MX control and I get a compilation message saying that my MX component has no implementation in spite of the fact that I am explicitly including it in the script portion of the code. Here is a snipped version of what I am doing... package pmco.interfaces { ... public interface IActionsOwner { ... function addAction(a:Action):void; ... } } I have an include file in which I have some impementations, ConcreteActionOwner.as ... public function addAction(a:Action):void { if (actions == null) actions = new ArrayCollection(); actions.addItem(a); } ... In regular AS classes I can do this... public class X implements IActionsOwner { include ConcreteActionOwner.as } and the compiler is happy. However when I do this... mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml implements=pmco.interfaces.IActionOwner mx:Script ![CDATA[ include ConcreteActionOwner.as ]] /mx:Script I get a compiler error that my class based on Canvas does not contain an implementation of IActionOwner. Anyone know whether I can do this and how? *** The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed. If you have received this e-mail in error please notify the sender by return e-mail delete this e-mail and refrain from any disclosure or action based on the information. ***
[flexcoders] charting and predefined axis styles
I have been working through the Flex 1.5 charting tutorial (http://www.adobe.com/devnet/flex/articles/charting.html). Page 5 (Using CSS to Style Subcomponents - 2) says: Flex ships with a number of predefined axis styles; for this tutorial, use the linedNumericAxis and hangingCategoryAxis styles. I have not been able to find any information about predefined axis styles for the current version. Can anyone point me in the right direction, or did these die in Flex 2? TIA Sandy
[flexcoders] Re: Would you like to debug? No causes browser to crash.
FWIW, I don't get any popups or anything. My browser just hangs/crashes. Ben --- In flexcoders@yahoogroups.com, Michael Schmalle [EMAIL PROTECTED] wrote: BTW, The popup dialog says; The installed Flash Player is the wrong version. Reinstall Flex Builder or a debug version of Flash Player 9. This all started happening AFTER I installed the Apollo plugin. Peace, Mike On 04 Apr 2007 10:24:39 -0700, ben.clinkinbeard [EMAIL PROTECTED] wrote: Hi Mike, thanks for responding. I have the debug version of 9,0,28,0 Happens with IE 6 and FF 1.5 Happens with all Flex apps I also have the Apollo extensions installed. I suppose this could have started then, I've not been working in FB much the past few weeks. Let me know what else I can do to help. Thanks, Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Mike Morearty mike.morearty@ wrote: I haven't seen this or heard reports of it. Some questions: - What version of the Flash player do you have installed? (Right-click on any Flash app, e.g. the one on www.adobe.com, then About Adobe Flash Player 9; I'm looking for a number like 9,0,28,0) - Is this IE or Firefox? - Does it reproduce with only one particular Flex app, or any Flex app? If only one particular one, can you narrow down the cause of the problem, or provide a link to the swf? Thanks - Mike Morearty, Flex Builder --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, ben.clinkinbeard ben.clinkinbeard@ wrote: Seems like maybe this started after installing the hotfix. The title pretty much says it all, but just to be clear, if you choose No when asked that question the browser just hangs and has to be manually killed. Are others experiencing this? Win XP Thanks, Ben -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
[flexcoders] Re: Tree and Array
thanks, but i have already seen all these pages. they all talk about xml lists and collections. nothing about working with arrays. i Know that a tree can also read from an array dataprovider.. so i need to know how to add nodes, branches, elemets , parents or whatever is needed to build a tree from an array of mysql records. --- In flexcoders@yahoogroups.com, mapper2255 [EMAIL PROTECTED] wrote: Here are a couple links: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- walking-the-tree-method/ I know it was for the Cairgorm Store but I did a keyword on these archives of: events tree cairgorm and got 52 results a lot with the tree component. Hope it helps some. --- In flexcoders@yahoogroups.com, Sal nhp_ny@ wrote: how? can't find a sample... can't find docs on it... does that mean i'll need to build a tree structure inside an array and then pass it to the data provider? if so... are there docs or samples on this? how to add an array child of an array element? Thanks --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: You have to build up the dataprovider and pass it into the tree. If you change the dataprovider later, the tree will notice in most cases. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sal Sent: Tuesday, April 03, 2007 5:38 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Tree and Array hi, i have an array of records received from an amfphp call and i need to fill a tree control with that data. the array has this format: aArr[0].id aArr[0].description aArr[0].parent aArr[0].order aArr[1].id aArr[1].description aArr[1].parent aArr[1].order ... and so on i didn't find any method of the control that adds node or that sets node parent. Any ideas? Thanks.
[flexcoders] Save to database
Hi, I don't know how I can save a lot of content that can be modified or not. First, when we load all the content from database for a timeline(main object) and transfert all these table to many Objects in flex. [Bindable] TimelineModelLocator dateType presentation from to divisions (arraycollection with object) autors (arraycollection with object) layerData (arraycollection with object) categoryData (arraycollection with object) entryData (arraycollection with object) ... The user can modify all content, remove items, add items. When the user click save all, what is the best to do? Remove all what was in the database and save the new content in all tables. Loop in all object and compare a checksum to know what have been modify/added/deleted... Other idea??
[flexcoders] Re: implements, include, MX and AS...
Just tried that, doesn't appear to make any difference. --- In flexcoders@yahoogroups.com, Brian Holmes [EMAIL PROTECTED] wrote: Add import pmco.interfaces.IActionOwner in your code block b.. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of simonjpalmer Sent: Wednesday, April 04, 2007 1:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] implements, include, MX and AS... I have an interface definition and an AS include file which contains a concrete implementation which I include in various places around my code. For all my AS classes this is a very economical programming model which I have used to great effect. I just tried to use it for an MX control and I get a compilation message saying that my MX component has no implementation in spite of the fact that I am explicitly including it in the script portion of the code. Here is a snipped version of what I am doing... package pmco.interfaces { ... public interface IActionsOwner { ... function addAction(a:Action):void; ... } } I have an include file in which I have some impementations, ConcreteActionOwner.as ... public function addAction(a:Action):void { if (actions == null) actions = new ArrayCollection(); actions.addItem(a); } ... In regular AS classes I can do this... public class X implements IActionsOwner { include ConcreteActionOwner.as } and the compiler is happy. However when I do this... mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml implements=pmco.interfaces.IActionOwner mx:Script ![CDATA[ include ConcreteActionOwner.as ]] /mx:Script I get a compiler error that my class based on Canvas does not contain an implementation of IActionOwner. Anyone know whether I can do this and how? *** The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed. If you have received this e-mail in error please notify the sender by return e-mail delete this e-mail and refrain from any disclosure or action based on the information. ***
[flexcoders] Re: Tree and Array
is there a sample somewhere? can i start from and empty XML? can i add elements and child elements simply putting a parent id ? thanks --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: I would loop over the array and build XML. The Tree likes XML. Either use the e4x methods to build the XML, or just build a string and parse it into XML using varxml:XML = XML(strXML); Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mapper2255 Sent: Wednesday, April 04, 2007 9:18 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Tree and Array Here are a couple links: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- walking-the-tree-method/ I know it was for the Cairgorm Store but I did a keyword on these archives of: events tree cairgorm and got 52 results a lot with the tree component. Hope it helps some. --- In flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com , Sal nhp_ny@ wrote: how? can't find a sample... can't find docs on it... does that mean i'll need to build a tree structure inside an array and then pass it to the data provider? if so... are there docs or samples on this? how to add an array child of an array element? Thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: You have to build up the dataprovider and pass it into the tree. If you change the dataprovider later, the tree will notice in most cases. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Sal Sent: Tuesday, April 03, 2007 5:38 PM To: flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com Subject: [flexcoders] Tree and Array hi, i have an array of records received from an amfphp call and i need to fill a tree control with that data. the array has this format: aArr[0].id aArr[0].description aArr[0].parent aArr[0].order aArr[1].id aArr[1].description aArr[1].parent aArr[1].order ... and so on i didn't find any method of the control that adds node or that sets node parent. Any ideas? Thanks.
RE: [flexcoders] Re: implements, include, MX and AS...
Can you avoid using include and perhaps use MXML to extend a custom AS base class that implements your interface and still extends Canvas? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of simonjpalmer Sent: Wednesday, April 04, 2007 4:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: implements, include, MX and AS... Just tried that, doesn't appear to make any difference. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Brian Holmes [EMAIL PROTECTED] wrote: Add import pmco.interfaces.IActionOwner in your code block b.. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of simonjpalmer Sent: Wednesday, April 04, 2007 1:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] implements, include, MX and AS... I have an interface definition and an AS include file which contains a concrete implementation which I include in various places around my code. For all my AS classes this is a very economical programming model which I have used to great effect. I just tried to use it for an MX control and I get a compilation message saying that my MX component has no implementation in spite of the fact that I am explicitly including it in the script portion of the code. Here is a snipped version of what I am doing... package pmco.interfaces { ... public interface IActionsOwner { ... function addAction(a:Action):void; ... } } I have an include file in which I have some impementations, ConcreteActionOwner.as ... public function addAction(a:Action):void { if (actions == null) actions = new ArrayCollection(); actions.addItem(a); } ... In regular AS classes I can do this... public class X implements IActionsOwner { include ConcreteActionOwner.as } and the compiler is happy. However when I do this... mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml implements=pmco.interfaces.IActionOwner mx:Script ![CDATA[ include ConcreteActionOwner.as ]] /mx:Script I get a compiler error that my class based on Canvas does not contain an implementation of IActionOwner. Anyone know whether I can do this and how? *** The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed. If you have received this e-mail in error please notify the sender by return e-mail delete this e-mail and refrain from any disclosure or action based on the information. ***
[flexcoders] Re: Save to database
If you are connecting to a db on the server then you have a couple of obvious choices. 1. You can use the built-in capabilities of flex data services which will manage the modifications for you and only notify your server components of changes. 2. You can use an ORM like Hibernate to do the same thing between your server code and the RDBMS. 3. You can write all that code yourself. You can in fact combine any or all of them too. There are probably other options too, but one of these ought to do you. It is generally bad practice for you to be truncating your data before writing. Unless you are absolutely sure the data is that transient you shouldn't do it. I suggest you do a bit of reading about FDS in the Flex docs. Also it is probably worth picking up a book on Hibernate and giving it a thorough read, especially regarding transactions and commit strategies. SP. --- In flexcoders@yahoogroups.com, nxzone [EMAIL PROTECTED] wrote: Hi, I don't know how I can save a lot of content that can be modified or not. First, when we load all the content from database for a timeline(main object) and transfert all these table to many Objects in flex. [Bindable] TimelineModelLocator dateType presentation from to divisions (arraycollection with object) autors (arraycollection with object) layerData (arraycollection with object) categoryData (arraycollection with object) entryData (arraycollection with object) ... The user can modify all content, remove items, add items. When the user click save all, what is the best to do? Remove all what was in the database and save the new content in all tables. Loop in all object and compare a checksum to know what have been modify/added/deleted... Other idea??
Re: [flexcoders] Save to database
Modify data elements as they are changed. Use LiveCycle Data Services 2.5 to achieve collaboration model that allows many users to collaborate as they view/edit data - all clients would have to by sync'd with changes to data. For those who love PHP but don't like Java this same sort of thing (with minor timing penalties) could be achieved using WebOrb/PHP. - Original Message From: nxzone [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, April 4, 2007 1:08:35 PM Subject: [flexcoders] Save to database Hi, I don't know how I can save a lot of content that can be modified or not. First, when we load all the content from database for a timeline(main object) and transfert all these table to many Objects in flex. [Bindable] TimelineModelLocato r dateType presentation from to divisions (arraycollection with object) autors (arraycollection with object) layerData (arraycollection with object) categoryData (arraycollection with object) entryData (arraycollection with object) ... The user can modify all content, remove items, add items. When the user click save all, what is the best to do? Remove all what was in the database and save the new content in all tables. Loop in all object and compare a checksum to know what have been modify/added/ deleted.. . Other idea??
RE: [flexcoders] Re: Tree and Array
You must build either XML, or an ArrayCollection of ArrayCollections. Are you asking how to construct the logic to read your array and build the dataProvider? It will depend on the exact character of the array data. For example, are you assured that a parent will be defined before any of its children are? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nhp_ny Sent: Wednesday, April 04, 2007 3:52 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Tree and Array thanks, but i have already seen all these pages. they all talk about xml lists and collections. nothing about working with arrays. i Know that a tree can also read from an array dataprovider.. so i need to know how to add nodes, branches, elemets , parents or whatever is needed to build a tree from an array of mysql records. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , mapper2255 [EMAIL PROTECTED] wrote: Here are a couple links: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- walking-the-tree-method/ I know it was for the Cairgorm Store but I did a keyword on these archives of: events tree cairgorm and got 52 results a lot with the tree component. Hope it helps some. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Sal nhp_ny@ wrote: how? can't find a sample... can't find docs on it... does that mean i'll need to build a tree structure inside an array and then pass it to the data provider? if so... are there docs or samples on this? how to add an array child of an array element? Thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: You have to build up the dataprovider and pass it into the tree. If you change the dataprovider later, the tree will notice in most cases. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Sal Sent: Tuesday, April 03, 2007 5:38 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Tree and Array hi, i have an array of records received from an amfphp call and i need to fill a tree control with that data. the array has this format: aArr[0].id aArr[0].description aArr[0].parent aArr[0].order aArr[1].id aArr[1].description aArr[1].parent aArr[1].order ... and so on i didn't find any method of the control that adds node or that sets node parent. Any ideas? Thanks.
[flexcoders] Re: implements, include, MX and AS...
good spot Peter. I inserted a class in my inheritance hierarchy which does the interface specification and incorporates the concrete implementations too through include. This seems to work but it is pretty inelegant. Not that I'm complaining about that. Thanks for the reply. --- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote: Can you avoid using include and perhaps use MXML to extend a custom AS base class that implements your interface and still extends Canvas? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of simonjpalmer Sent: Wednesday, April 04, 2007 4:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: implements, include, MX and AS... Just tried that, doesn't appear to make any difference. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Brian Holmes Brian.Holmes@ wrote: Add import pmco.interfaces.IActionOwner in your code block b.. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of simonjpalmer Sent: Wednesday, April 04, 2007 1:27 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] implements, include, MX and AS... I have an interface definition and an AS include file which contains a concrete implementation which I include in various places around my code. For all my AS classes this is a very economical programming model which I have used to great effect. I just tried to use it for an MX control and I get a compilation message saying that my MX component has no implementation in spite of the fact that I am explicitly including it in the script portion of the code. Here is a snipped version of what I am doing... package pmco.interfaces { ... public interface IActionsOwner { ... function addAction(a:Action):void; ... } } I have an include file in which I have some impementations, ConcreteActionOwner.as ... public function addAction(a:Action):void { if (actions == null) actions = new ArrayCollection(); actions.addItem(a); } ... In regular AS classes I can do this... public class X implements IActionsOwner { include ConcreteActionOwner.as } and the compiler is happy. However when I do this... mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml implements=pmco.interfaces.IActionOwner mx:Script ![CDATA[ include ConcreteActionOwner.as ]] /mx:Script I get a compiler error that my class based on Canvas does not contain an implementation of IActionOwner. Anyone know whether I can do this and how? *** The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed. If you have received this e-mail in error please notify the sender by return e-mail delete this e-mail and refrain from any disclosure or action based on the information. ***
[flexcoders] Re: Would you like to debug? No causes browser to crash.
Hmm. Please try uninstalling the Flash Player (using the Control Panel), and then reinstalling it (using Flex Builder's player\debug\Install Flash Player 9 AX.exe to install the Internet Explorer ActiveX plugin, and/or player\debug\Install Flash Player 9.exe to install the Firefox plugin). - Mike Morearty, Flex Builder --- In flexcoders@yahoogroups.com, ben.clinkinbeard [EMAIL PROTECTED] wrote: FWIW, I don't get any popups or anything. My browser just hangs/crashes. Ben --- In flexcoders@yahoogroups.com, Michael Schmalle teoti.graphix@ wrote: BTW, The popup dialog says; The installed Flash Player is the wrong version. Reinstall Flex Builder or a debug version of Flash Player 9. This all started happening AFTER I installed the Apollo plugin. Peace, Mike On 04 Apr 2007 10:24:39 -0700, ben.clinkinbeard ben.clinkinbeard@ wrote: Hi Mike, thanks for responding. I have the debug version of 9,0,28,0 Happens with IE 6 and FF 1.5 Happens with all Flex apps I also have the Apollo extensions installed. I suppose this could have started then, I've not been working in FB much the past few weeks. Let me know what else I can do to help. Thanks, Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Mike Morearty mike.morearty@ wrote: I haven't seen this or heard reports of it. Some questions: - What version of the Flash player do you have installed? (Right-click on any Flash app, e.g. the one on www.adobe.com, then About Adobe Flash Player 9; I'm looking for a number like 9,0,28,0) - Is this IE or Firefox? - Does it reproduce with only one particular Flex app, or any Flex app? If only one particular one, can you narrow down the cause of the problem, or provide a link to the swf? Thanks - Mike Morearty, Flex Builder --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, ben.clinkinbeard ben.clinkinbeard@ wrote: Seems like maybe this started after installing the hotfix. The title pretty much says it all, but just to be clear, if you choose No when asked that question the browser just hangs and has to be manually killed. Are others experiencing this? Win XP Thanks, Ben -- Teoti Graphix http://www.teotigraphix.com Blog - Flex2Components http://www.flex2components.com You can find more by solving the problem then by 'asking the question'.
[flexcoders] Re: How to disable the default drop shadow for a chartseries?
That serves the purpose. Thanks. --- In flexcoders@yahoogroups.com, Ely Greenfield [EMAIL PROTECTED] wrote: set the seriesFilters property on the chart. Ely. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of anewgene Sent: Monday, April 02, 2007 2:41 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: How to disable the default drop shadow for a chartseries? Thanks for the reply. But what is the appropriate style to set for a series. From the reference, I known I can set for fill and stroke. What else I can set to disable the drop shadow? Lei --- In flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com , Tom Chiverton tom.chiverton@ wrote: On Saturday 31 Mar 2007, anewgene wrote: want to disable the drop shadow for the better appearance. However, Have you tried setting the apropiate style ? -- Tom Chiverton Helping to greatly evolve guinine communities on: http://thefalken.livejournal.com 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 St James's Court Brown Street Manchester M2 2JF. 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 Law Society. 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 8008. For more information about Halliwells LLP visit www.halliwells.com.
[flexcoders] Filtering/Sorting data from Flex Data Services
I am using flex data services for accessing lot of records ( more than 1 records). Page size is set to 500 records. Data returned as array collection is bound to datagrid. Is it possible to sort/filter the whole data set on the client side. How does sorting/filtering work on an array collection returned when using Data Services compared to sorting/filtering an array collection. VVV
RE: [flexcoders] charting and predefined axis styles
No, they're there. blockNumericAxis linedNumericAxis dashedNumericAxis blockCategoryAxis hangingCategoryAxis dashedCategoryAxis (You can look in AxisRenderer.initStyles to see where they're set up). Ely. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of myasandy2 Sent: Wednesday, April 04, 2007 12:04 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] charting and predefined axis styles I have been working through the Flex 1.5 charting tutorial (http://www.adobe.com/devnet/flex/articles/charting.html http://www.adobe.com/devnet/flex/articles/charting.html ). Page 5 (Using CSS to Style Subcomponents - 2) says: Flex ships with a number of predefined axis styles; for this tutorial, use the linedNumericAxis and hangingCategoryAxis styles. I have not been able to find any information about predefined axis styles for the current version. Can anyone point me in the right direction, or did these die in Flex 2? TIA Sandy
[flexcoders] How do put HTML in an Alert
How do put HTML in an Alert? Don't work: Alert.show(bHi/b, Alert !, 3, this, handler_alert); Obs: I'm Brazilian. Excuse my terrible English! Thanks a lot ! Carlos H
[flexcoders] Re: How can I tell if I have the latest hotfix installed correctly?
Hmmm... no responses. Does this mean it is impossible to tell what version of the Flex SDK my Flex Builder is using? On 4/3/07, Collin Peters [EMAIL PROTECTED] wrote: I just installed hotfix 1 from http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb401224 How can I tell if it is installed properly? If I goto Help - About Adobe Flex Builder 2 it just says Version 2.0.1. On my co-workers machine he has Version 2.0.143459 If I goto Help - Software Updates - Manage Configuration I have 'Adobe Flex Builder Core Feature 2.0.155577' and again my co-worker has the same except 143459 even though we have both installed the hotfix. Regards, Collin
[flexcoders] Re: Tree and Array
ok... i built tree structures in many other languages, so i know how to do it. In other langauges i usually use methods to do it .. like: Tree.AddItem(Key, Item, Parent) or set Node = GetNode(parent) Node.AddChild(key, item) so, what i need.. are these methods in flex. How can i add data to a tree control? i know that i have to first prepare a dataprovider and that i can't work directly with the tree control, and you told me to use e4x.. so ok... but how? where are the additem() or getparent() or whatever? i saw the manuals for e4x, and found out that its need to manipulate xml files, but all the samples in the manual just show how to delete , add or modify xml data from an existing xml structure. thats not my case... i need to start with an empty xml. hope i've been clear. thanks --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: You must build either XML, or an ArrayCollection of ArrayCollections. Are you asking how to construct the logic to read your array and build the dataProvider? It will depend on the exact character of the array data. For example, are you assured that a parent will be defined before any of its children are? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nhp_ny Sent: Wednesday, April 04, 2007 3:52 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Tree and Array thanks, but i have already seen all these pages. they all talk about xml lists and collections. nothing about working with arrays. i Know that a tree can also read from an array dataprovider.. so i need to know how to add nodes, branches, elemets , parents or whatever is needed to build a tree from an array of mysql records. --- In flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com , mapper2255 mapper2255@ wrote: Here are a couple links: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- walking-the-tree-method/ I know it was for the Cairgorm Store but I did a keyword on these archives of: events tree cairgorm and got 52 results a lot with the tree component. Hope it helps some. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Sal nhp_ny@ wrote: how? can't find a sample... can't find docs on it... does that mean i'll need to build a tree structure inside an array and then pass it to the data provider? if so... are there docs or samples on this? how to add an array child of an array element? Thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: You have to build up the dataprovider and pass it into the tree. If you change the dataprovider later, the tree will notice in most cases. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Sal Sent: Tuesday, April 03, 2007 5:38 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Tree and Array hi, i have an array of records received from an amfphp call and i need to fill a tree control with that data. the array has this format: aArr[0].id aArr[0].description aArr[0].parent aArr[0].order aArr[1].id aArr[1].description aArr[1].parent aArr[1].order ... and so on i didn't find any method of the control that adds node or that sets node parent. Any ideas? Thanks.
RE: [flexcoders] Re: Tree and Array
The main method you will be using is appendChild(). See the docs: http://livedocs.adobe.com/flex/201/langref/XML.html Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nhp_ny Sent: Wednesday, April 04, 2007 8:41 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Tree and Array ok... i built tree structures in many other languages, so i know how to do it. In other langauges i usually use methods to do it .. like: Tree.AddItem(Key, Item, Parent) or set Node = GetNode(parent) Node.AddChild(key, item) so, what i need.. are these methods in flex. How can i add data to a tree control? i know that i have to first prepare a dataprovider and that i can't work directly with the tree control, and you told me to use e4x.. so ok... but how? where are the additem() or getparent() or whatever? i saw the manuals for e4x, and found out that its need to manipulate xml files, but all the samples in the manual just show how to delete , add or modify xml data from an existing xml structure. thats not my case... i need to start with an empty xml. hope i've been clear. thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt [EMAIL PROTECTED] wrote: You must build either XML, or an ArrayCollection of ArrayCollections. Are you asking how to construct the logic to read your array and build the dataProvider? It will depend on the exact character of the array data. For example, are you assured that a parent will be defined before any of its children are? Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nhp_ny Sent: Wednesday, April 04, 2007 3:52 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Tree and Array thanks, but i have already seen all these pages. they all talk about xml lists and collections. nothing about working with arrays. i Know that a tree can also read from an array dataprovider.. so i need to know how to add nodes, branches, elemets , parents or whatever is needed to build a tree from an array of mysql records. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders% 40yahoogroups.com , mapper2255 mapper2255@ wrote: Here are a couple links: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- walking-the-tree-method/ I know it was for the Cairgorm Store but I did a keyword on these archives of: events tree cairgorm and got 52 results a lot with the tree component. Hope it helps some. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Sal nhp_ny@ wrote: how? can't find a sample... can't find docs on it... does that mean i'll need to build a tree structure inside an array and then pass it to the data provider? if so... are there docs or samples on this? how to add an array child of an array element? Thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: You have to build up the dataprovider and pass it into the tree. If you change the dataprovider later, the tree will notice in most cases. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Sal Sent: Tuesday, April 03, 2007 5:38 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Tree and Array hi, i have an array of records received from an amfphp call and i need to fill a tree control with that data. the array has this format: aArr[0].id aArr[0].description aArr[0].parent aArr[0].order aArr[1].id aArr[1].description aArr[1].parent aArr[1].order ... and so on i didn't find any method of the control that adds node or that sets node parent. Any ideas? Thanks.
RE: [flexcoders] Re: Tree and Array
Oh, and to start from scratch, do: var _xml:XML = root; then: var xmlNode:XML = node; [EMAIL PROTECTED] = somevalue; _xml.appendChild(xmlNode) Shold give you: root node attr=somevalue / /root From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, April 04, 2007 9:57 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Tree and Array The main method you will be using is appendChild(). See the docs: http://livedocs.adobe.com/flex/201/langref/XML.html http://livedocs.adobe.com/flex/201/langref/XML.html Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nhp_ny Sent: Wednesday, April 04, 2007 8:41 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Tree and Array ok... i built tree structures in many other languages, so i know how to do it. In other langauges i usually use methods to do it .. like: Tree.AddItem(Key, Item, Parent) or set Node = GetNode(parent) Node.AddChild(key, item) so, what i need.. are these methods in flex. How can i add data to a tree control? i know that i have to first prepare a dataprovider and that i can't work directly with the tree control, and you told me to use e4x.. so ok... but how? where are the additem() or getparent() or whatever? i saw the manuals for e4x, and found out that its need to manipulate xml files, but all the samples in the manual just show how to delete , add or modify xml data from an existing xml structure. thats not my case... i need to start with an empty xml. hope i've been clear. thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt [EMAIL PROTECTED] wrote: You must build either XML, or an ArrayCollection of ArrayCollections. Are you asking how to construct the logic to read your array and build the dataProvider? It will depend on the exact character of the array data. For example, are you assured that a parent will be defined before any of its children are? Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of nhp_ny Sent: Wednesday, April 04, 2007 3:52 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Tree and Array thanks, but i have already seen all these pages. they all talk about xml lists and collections. nothing about working with arrays. i Know that a tree can also read from an array dataprovider.. so i need to know how to add nodes, branches, elemets , parents or whatever is needed to build a tree from an array of mysql records. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders% 40yahoogroups.com , mapper2255 mapper2255@ wrote: Here are a couple links: http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.adobe.com/devnet/flex/quickstart/working_with_tree/ http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree- walking-the-tree-method/ I know it was for the Cairgorm Store but I did a keyword on these archives of: events tree cairgorm and got 52 results a lot with the tree component. Hope it helps some. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Sal nhp_ny@ wrote: how? can't find a sample... can't find docs on it... does that mean i'll need to build a tree structure inside an array and then pass it to the data provider? if so... are there docs or samples on this? how to add an array child of an array element? Thanks --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: You have to build up the dataprovider and pass it into the tree. If you change the dataprovider later, the tree will notice in most cases. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Sal Sent: Tuesday, April 03, 2007 5:38 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Tree and Array hi, i
RE: [flexcoders] Re: Nested Repeater Issues
Can you post a small runnable example? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Sent: Wednesday, April 04, 2007 3:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Nested Repeater Issues Bump --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Geoffrey [EMAIL PROTECTED] wrote: I have a Repeater of CheckBoxes, which may or may not have a sublayer of CheckBoxes. It should look something like: [] archive 1 [] archive 2 [] dataSource 1 [] dataSource 2 [] dataSource 3 [] archive 3 By default all CheckBoxes are unselected, and any sublayer CheckBoxes are not enabled. If you select a CheckBox(archive 2) that has sublayer CheckBoxes (dataSource 1- 3), they are enabled. If you unselect a CheckBox that has sublayer CheckBoxes, they are disabled and unselected. I'm using the Cairngorm framework, so the call results from the database are returned to my model. This model is used as the dataProvider for the Repeater. The issue is that I can not update my model and have the sublayer Repeater update properly. For example, if there are three sublayer CheckBoxes (like above), selecting the parent CheckBox (archive 2) will enable only the first 2 sublayer CheckBoxes (dataSource 1 2). Then deselecting the parent CheckBox will disable the first 2 sublayer CheckBoxes, but enable the third (dataSource 3). From this point on the enabled property for dataSource 12 will be in a opposite state from dataSource 3. Below are code snippets: -- Library.mxml: mx:Repeater id=archiveRepeater dataProvider={__model.archiveElements} mx:CheckBox id=archive label={archiveRepeater.currentItem.archiveName} click=__model.archiveChanged(event)/ mx:Repeater id=dataSourceRepeater dataProvider= {archiveRepeater.currentItem.archiveDataRepositories} mx:CheckBox id=dataSource label={dataSourceRepeater.currentItem.repositoryName} enabled={dataSourceRepeater.currentItem.enabled} selected={dataSourceRepeater.currentItem.selected} click=__model.dataSourceChanged(event) /mx:CheckBox /mx:Repeater /mx:Repeater -- -- LibraryModel.as: public function archiveChanged( event:MouseEvent ):void { var selectionChoice:Boolean = event.target.selected; var selectionName:String = event.target.label; var al:ArchiveLocation = ArchiveLocation(event.target.getRepeaterItem()); al.selected = selectionChoice; // Go through any data repositories // and toggle their enabled property if (al.archiveDataRepositories != null) { var adr:Array = al.archiveDataRepositories; if (selectionChoice == false) { // Deselect and disable all CheckBoxes for (var i:uint = 0; i adr.length; i++) { // Update the model adr[i].selected = false; adr[i].enabled = false; } else { // Enable all CheckBoxes for (i = 0; i adr.length; i++) { adr[i].enabled = true; } } } } } -- As you can tell, there are ValueObjects that store the enabled and selected attributes for the dataSource CheckBoxes. What's even weirder, is that the ValueObjects that make up the dataProvider for the Repeater are updated correctly (their selected and enabled properties), but the last CheckBox of any sublayer remains in a state that is opposite of the other grouped sublayer CheckBoxes. I've gotten around this by directly updating the display by using: event.target.document.dataSource[i][j].enabled = false; But I don't want to rely on this as it will cause issues later on. I feel that I should be able to update the dataProvider for the various Repeaters and this should update the display properly. Any suggestions would be greatly appreciated. ~Geoff~
Re: [flexcoders]PHP and Flex questions
thank you On 04 Apr 2007 01:27:44 -0700, dordea cosmin [EMAIL PROTECTED] wrote: When a Flex application in a browser communicates with a php page for the first time a session is created. This is the same behavior as user receiving a PHP page in their browser. - true , but the session is created only if the php installed in your server is configured to auto start a session or you manually start the session in your scrip. - This session that is created last indefinitely with Flex applications because Flex keeps the connection open / session alive on the server. I am not sure if this is 100% true , but i believe by default , the http headers send Connection: Keep-Alive, so sessions remain alive. In my application it works okay, session doesn't expire while flex application runs. However, I believe if you send custom HTTP headers this behavior can be lost. - Flex keeps the connection alive by periodically pinging the server. same as above - Sessions will never timeout due to this behavior. same as above - When the user navigates away from the Flex application the session will timeout on the server. true , it will timeout in the time specified in your php.ini To manually timeout a session on the server call a page or function that executes this code session.destroy( ); -- not sure what the recommended method to clear the session on the server. - true , depending on your php session you will call the correct function to destroy the session Hope this helps. - Original Message From: dorkie dork from dorktown [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, April 3, 2007 8:37:15 PM Subject: [flexcoders]PHP and Flex questions Can someone tell me if these statements are true or false and if false what is the correct answer? - When a Flex application in a browser communicates with a php page for the first time a session is created. This is the same behavior as user receiving a PHP page in their browser. - This session that is created last indefinitely with Flex applications because Flex keeps the connection open / session alive on the server. - Flex keeps the connection alive by periodically pinging the server. - Sessions will never timeout due to this behavior. - When the user navigates away from the Flex application the session will timeout on the server. - To manually timeout a session on the server call a page or function that executes this code session.destroy( ); -- not sure what the recommended method to clear the session on the server. Any answers will help even partial. -- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut.
[flexcoders] What method to use? DataGrid, Rich Tooltip
Hi there, This is pretty simple, but I am having trouble figuring how I should do it. I have a DataGrid with a dataProvider that has an imageURL property. Here's what I want to do: When the user rolls over a row in the grid, an image pops up (sort of like a tooltip would) displaying the image. What direction should I go in? I am familiar with renderers and such so that means I'm not a total newbie on the issue. But I am wondering what event to trigger on and how I would display said renderer. Thanks so much! -Kenny
Re: [flexcoders] How do put HTML in an Alert
I chose to make my own Flex component based on a Canvas or some other suitable object into which I placed TextArea object that would allow me to display HTML using a suitable message. I did have to write some code to mimic the behaviors of Alert.Show() to make my pop-up modal and on top of other windows but this was not too difficult to do. I got a bit tired of the boring grey pop-up that never seems to look all that professional to me and I wanted to display Error messages in red with a bit of HTML on the side. It took me a bit of work to find the right UIDisplay object I could use with the PopUpManager but then it all fit into place and worked well. - Original Message From: Carlos Humberto [EMAIL PROTECTED] To: Lista - Flexcoders flexcoders@yahoogroups.com Sent: Wednesday, April 4, 2007 4:21:46 PM Subject: [flexcoders] How do put HTML in an Alert How do put HTML in an Alert? Don't work: Alert.show( bHi/b , Alert !, 3, this, handler_alert) ; Obs: I'm Brazilian. Excuse my terrible English! Thanks a lot ! Carlos H
[flexcoders] If you don't pass anything to IModuleInfo load()...
If you don't pass anything (ie. null) to IModuleInfo load() does it load the module into the current domain or does it create a child domain?
RE: [flexcoders] If you don't pass anything to IModuleInfo load()...
child From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of footube42 Sent: Wednesday, April 04, 2007 7:51 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] If you don't pass anything to IModuleInfo load()... If you don't pass anything (ie. null) to IModuleInfo load() does it load the module into the current domain or does it create a child domain?
RE: [flexcoders] Re: How can I tell if I have the latest hotfix installed correctly?
UIComponent has a static version property. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Collin Peters Sent: Wednesday, April 04, 2007 5:38 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: How can I tell if I have the latest hotfix installed correctly? Hmmm... no responses. Does this mean it is impossible to tell what version of the Flex SDK my Flex Builder is using? On 4/3/07, Collin Peters [EMAIL PROTECTED] mailto:cadiolis%40gmail.com wrote: I just installed hotfix 1 from http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb401224 http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb401224 How can I tell if it is installed properly? If I goto Help - About Adobe Flex Builder 2 it just says Version 2.0.1. On my co-workers machine he has Version 2.0.143459 If I goto Help - Software Updates - Manage Configuration I have 'Adobe Flex Builder Core Feature 2.0.155577' and again my co-worker has the same except 143459 even though we have both installed the hotfix. Regards, Collin
RE: [flexcoders] Re: Module Interface Problems
If you don't make an instance of the main class in your module which gets around to tickling the module's ModuleLoader, that ModuleLoader won't load its module. Did you see it get loaded and dispatch READY? This is all within a single domain right? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Ritchie Sent: Wednesday, April 04, 2007 12:40 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Module Interface Problems In my context, a module loading another module using ModuleLoader. The reference to the child of the ModuleLoader is always null. I have even set up a timer event that keeps checking back to see if the child is not null. Is there something specific about what I am trying to do that would cause the child to be null? - Mike --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: ModuleLoader is a convenience container. It loads in the module via ModuleManager and when READY, it starts to create the children. If you listen to READY you may see it before moduleloader had a chance to see it and create the child. -Alex From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Michael Ritchie Sent: Tuesday, April 03, 2007 1:04 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Module Interface Problems I ruled out the timing issue, but your post has some great information how to handle this. I think I have isolated the specific module loading issue to one factor. I have a module that loads another module using a mx:ModuleLoader and I am trying to access the second ModuleLoader child through the interface. I can't seem get a reference to the child of the second ModuleLoader, it always reports null. I have a successfully loaded a module and talked using the interface, but if move this within the context of another module, I get the null reference. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , - FI / Jonas Eliasson + jonas.eliasson@ wrote: That sounds like a still existing Flash issue if you try to load a swf that has a shared library attached to it. Then you will get a loaded callback before it's actually loaded. So in Flash you can check on the loaded event if current frame == 0. In that case you can't access any properties and no code will be executed yet. But you can still write to the object. In our scenario we have attached a callback event method. So when the swf is really loaded it will check if the callback exist and then execute it. Which will tell the loader that it's ready to be initiated. Something similar should be easy to implement on the module but not with a check for a frame number :-) . Should be a better solution for this. I don't want to go back to old Flash hacks hehe. //as2 example private function onLibraryLoaded(libraryClip:MovieClip, cb:CallBack):Void { var me:SharedLibraryLoader = getInstance(); if(libraryClip._currentframe == 0){ libraryClip.onComplete = new CallBack(me, me.onLibraryInitiated, null, cb); }else onLibraryInitiated(libraryClip, cb); } _ From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Michael Ritchie Sent: den 3 april 2007 11:24 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Module Interface Problems From my experience there is a definite timing issue when loading modules. The ModuleLoader ready event is fired before the Module is fully loaded and you have the ability to talk to it through a common interface (hence the error reporting access to a null value). I would term this one as a bug that is not yet documented by Adobe. This could be because some modules take longer than expected to load, I have no idea, just the observed problem with talking with modules within the ready. I also attempted to use an interface to talk with a module when the the progress event had reached 100%, but still no luck. A possible workaround would be to fire some event from inside the loaded module that tells the outside world that it is indeed loaded. The other option is to set a timer interval and keep checking if the module is loaded (meaning not reporting NULL in the ready event handler). Unless someone else as a viable solution? Adobe? Anyone? - mr --- In [EMAIL PROTECTED] mailto:flexcoders%40yahoogroups.com ups.com, kristian_wright2002
RE: [flexcoders] editable combobox
I think that's been reported as a bug. Try setting the .text property to the correct value. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Scotty Scott Sent: Wednesday, April 04, 2007 9:52 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] editable combobox Hi everyone, I am having a problem with an editable combobox displaying the text that is stored in the model. It works the first time the view is created, however once I swap the model object... it goes back to the prompt value always. mx:ComboBox id=referredByComboBox prompt=Select or type a value editable=true dataProvider={model.availableReferredBy} labelField=value change= model.client.referredBy=event.currentTarget.text text={model.client.referredBy} / Note, if I have a textinput bound to {model.client.referredBy} it does display the correct value when the model is swapped. So I know the value is there. Object Descriptions: model is [Bindable] model.availableReferredBy : ArrayCollection of a bindable object model.client : Custom bindable object model.client.referredBy : String So... should this be possible or should I create a component that has a dropdown attached to it that only updates the textinput on itemClick? I can provide more information if needed. Thanks for any help -- Scotty Scott http://www.franciswscott.com http://www.franciswscott.com
RE: [flexcoders] Re: dynamically created access and event elements problem and
You should keep variables referencing the checkboxes, call addEventListener to listen to the change event and set the selected property of the other checkbox From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of alex steel Sent: Wednesday, April 04, 2007 11:33 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: dynamically created access and event elements problem and can somebody help me please this is second post with question and yet nobody answers and I am sure this is pretty easy I count on people here, but if you think I should try to find better place for help please let me know Alex ... This piece of code helps me create dynamically checkboxes in one of the Tabs in my TabNavigator my problem is how to access now to this elements so I can check their value and how to make event to make unselected some other checkbox on click checkboxes are grouped in Left and Right and only Left or Right can be selected, that's why I need an event basiclly with hand placed CheckBoxes click=3Dcb_r.selected=3Dfalse is enough but for dynamically created I need your help THANKS in ADVANCE ;)
RE: [flexcoders] Extending LinkButton - please help, no hair left!
I would set the textfield's props in createChildren after super.createChildren. Calling measure from updateDisplayList is too late. The framework should have called it for you especially if invalidateSize got called. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Giles Roadnight Sent: Wednesday, April 04, 2007 9:46 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Extending LinkButton - please help, no hair left! Hi Guys I've been trying to extend the LinkButton class to let the text wrap onto 2 lines rather than always be on one line. I have the code working but when it initially appears the second line is hidden by an element below the button, it then updates and the size is reported correctly but this isn't good enough. The problem is that the measure function doesn't correctly report the height of the button until there is some text in the textField. when measure is first caleld there is no text there but when updateDisplayList is called there is text there so measure reports the correct height (I call this my self). I would really appreciate it if someone could help me out with this, it's been doing my head in for hours! My code is below: [code] package com.company.util { import mx.controls.LinkButton; import mx.events.FlexEvent; import flash.text.TextLineMetrics; import mx.core.mx_internal; import mx.controls.ButtonLabelPlacement; import flash.events.Event; use namespace mx_internal; public class TextLinkButton extends LinkButton { public function TextLinkButton() { super(); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth,unscaledHeight); trace(updateDisplayList); this.textField.autoSize = left; this.textField.wordWrap = true; this.textField.text = this.label; this.toolTip = null; this.measure(); } override protected function measure():void { trace(measure: + this + : + this.textField); super.measure(); var textHeight:Number = 8; textHeight += this.textField.textHeight; viewIcon(); viewSkin(); var iconHeight:Number = currentIcon ? currentIcon.height : 0; var h:Number = 0; if (labelPlacement == ButtonLabelPlacement.LEFT || labelPlacement == ButtonLabelPlacement.RIGHT) { h = Math.max(textHeight, iconHeight); } else { if (label label.length 0) h = textHeight + iconHeight; else h = iconHeight; if (iconHeight != 0) h += getStyle(verticalGap); } h = Math.max(14, h); measuredMinHeight = measuredHeight = h; } } } [/code]
RE: [flexcoders] Tiling a Background Image
I'd make a custom border class. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Paul Whitelock Sent: Wednesday, April 04, 2007 11:50 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Tiling a Background Image I've just started work on the UI/Graphic Design for a Flex application and I need to tile a seamless image as the application's background. I've found that while it is possible to specify an image for the application background, I see no way to tile the image. I assume that I'll need to write my own code to tile the image, but could someone perhaps give me a tip as to where I should begin looking? Do I need to do something like subclass the Application class or is there some simple way to insert a custom component so that it becomes the application's background? Thanks! Paul
RE: [flexcoders] Re: question about string equality
=== I believe it doesn't affect strings. if name == null and category = new String() then they are not == or ===, but their valueOf may be From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of simonjpalmer Sent: Wednesday, April 04, 2007 9:42 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: question about string equality Good point, I didn't include the declarations. They are both strongly typed Strings, I don't use objects anywhere in my code. co is a custom AS object of type Competitor, here's the declaration of the name member: public var name:String; oc is a custom AS object of type ObjectCategory and here is the declaration of the category member: public var category:String = new String(); The strong typing answers the question about whether they just happen to contain strings. Other than the fact that they belong to custom objects I have written, there is nothing peculiar about either the string variables or their contents. I don't think they are in a custom namespace, but to be honest I'm not exactly sure what that means, so I can't say with certainty that they aren't. I think the answer is no. co.name gets populated by various means, either though a user gesture in a custom page or by retrieval from a java data adaptor to my server. oc.category is populated programmatically during execution of the code in question. I appreciate you guys looking at this. Right now I have it working as I expect but it is a bit worrying that I need to do the comparison in this way only in this instance. That says to me that I don't properly understand something. If I want to check equality of the content of two strings should I always be testing valueOf()? What is the overhead of using ===? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Peter Farland [EMAIL PROTECTED] wrote: What are the type declarations of the properties sc.name and sc.category? Do they just happen to hold String values or are they typed to enforce that they hold String values? Is there anything else unique about these properties? Are they in a custom namespace? Are they read-only? How were they populated in the first place? From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of simonjpalmer Sent: Monday, April 02, 2007 6:14 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] question about string equality take a look at this code snippet... 01 // check one doesn't already exist with this name 02 bFound = false; 03 for (isc = 0; isc ss.scenarios.length !bFound; isc++) 04 { 05 sc = Scenario(ss.scenarios.getItemAt(isc)); 06 if (sc.name.valueOf() == oc.category.valueOf()) bFound = true; 07 } 08 if (!bFound) 09 { 10 // Make a new scenario 11 sc = PlanPointFactory.makeScenario(uli, null, true, false); 12 13 // add it to the snapshot 14 ss.addScenario(sc); 15 16 // add it to the local array of categories 17 oc.objects.push(sc); 18 } line 06 is the offending line. if I have: 06 if (sc.name == oc.category) bFound = true; the bFound flag never gets set true. I have to have the valueOf() function in order for the equality to fire correctly. This is not what I expected. I thought that regular equality would have sufficed here since sc.name and oc.category are both Strings. Why am I wrong and why do I need valueOf()?
RE: [flexcoders] DataGrid, error using DateField as the item editor
editorDataField=selectedDate From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cosma Sent: Wednesday, April 04, 2007 8:34 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] DataGrid, error using DateField as the item editor Hello, I'm trying to create an editable DataGrid using Flex 2.0.1. One of the columns is of Date type, so I want to use a DateField as the item editor. The problem is that I'm getting an error when the focus is taken away from the DateField: TypeError: Error #1034: Assegnazione di tipo forzata non riuscita: impossibile convertire 01/10/1980 in Date. at mx.controls::DataGrid/::itemEditorItemEditEndHandler() It seems that the DataGrid is trying to assign back the raw string value into my data provider object. This is a code snippet that reproduce the problem: mx:Script ![CDATA[ [Bindable] private var rows:ArrayCollection = new ArrayCollection(); private function init():void { // called on creationComplete var testRow:PersonVO = new PersonVO(); testRow.name = Name; testRow.surname = Surname; testRow.birthDate = new Date(1980, 9, 1); rows.addItem(testRow); } ]] /mx:Script mx:DataGrid dataProvider={rows} editable=true mx:columns mx:DataGridColumn dataField=name/ mx:DataGridColumn dataField=surname/ mx:DataGridColumn dataField=birthDate mx:itemEditor mx:Component mx:DateField formatString=DD/MM// /mx:Component /mx:itemEditor /mx:DataGridColumn /mx:columns /mx:DataGrid Do you have any idea of the cause of this behaviour? Thanks Cosma
RE: [flexcoders] Re: datagrid image itemRenderers don't maintainAspectRatio
You could subclass Image, override updateDisplayList and set the contentHolder's width/height afters super.updateDisplayList From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bhaq1972 Sent: Wednesday, April 04, 2007 7:54 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: datagrid image itemRenderers don't maintainAspectRatio I've tried everything you suggested but doesn't work for me. thanks anyway. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Dexter18 [EMAIL PROTECTED] wrote: may set the height and the width of your image component. either to fixed size or to values from yout loaded image. then you can set -horizontalAlign=center- and the -verticalAlign=middle- props of the image component to center your image. you dont need a wrapper component like a hbox or s.th. similar. when this not helps, i always set -maintainAspectRaio=true- carsten --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , bhaq1972 mbhaque@ wrote: I've got a image based component i'm using as an itemRenderer eg dgImage.mxml mx:Image etc /mx:Image its all working, but the images look large and blurry. However, if i wrap with an hbox eg mx:HBox mx:Image/ /mx:HBox the images look perfect. I didn't have a problem with this until i read Alex Harui's blog regarding performance issues using containers in itemRenderes. is there another way i can prevent blurry images?
RE: [flexcoders] Re: Scroll Tip on Roll Over on scroll bar of a grid
SCB doesn't use it, but you will need to. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sanjaypmg Sent: Wednesday, April 04, 2007 3:57 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Scroll Tip on Roll Over on scroll bar of a grid Hi, I have gone through the ScrollControlBase.as but i didnt find any rollOver event.. so can I show a tip on rollover on scroll of a grid Kindly suggest... Thanks in Advance.. Sanjay sharma --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: You'll probably have to add ROLL_OVER handlers to the scrollbar and put up your own tooltip. You can probably borrow a bunch of code from ScrollControlBase.as From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of sanjaypmg Sent: Monday, April 02, 2007 4:18 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Scroll Tip on Roll Over on scroll bar of a grid Hi All, I have a dataGrid and showing a tool tip on sroll by making showScrollTips=true and calling scrollTipFunction=mainScrollTipFunc.. TIP content is written in the funtion mainScrollTipFunc.. public function mainScrollTipFunc(dir : String, pos: Number):String { var tempTip:String = No of Records: +mainGridDP.length.toString(); return tempTip; } Here, the tip is showing when user presses\drags the scroll bar but I want to show the tip when user rolls over the mouse on scroll bar of the grid. How can I do it? kindly suggest... Thanks in Advance... Sanjay
RE: [flexcoders] Re: Need to different images in datagrid column
return o.img + .gif From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Vinoth Sent: Tuesday, April 03, 2007 11:47 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Need to different images in datagrid column thanks for the code, But i could not understand clearly, here is my sample code to apply pdf and word icon under img column --Code starts- ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Image [Bindable] private var initDG:ArrayCollection = new ArrayCollection([ {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99, SalePrice: true,img:pdf }, {Artist:'Pavement', Album:'Brighten the Corners',img:word, Price:11.99, SalePrice: false } ]); ]] /mx:Script mx:DataGrid id=myGrid dataProvider={initDG} variableRowHeight=true mx:columns mx:DataGridColumn dataField=Artist/ mx:DataGridColumn dataField=Album/ mx:DataGridColumn dataField=Price/ mx:DataGridColumn dataField=img/ /mx:columns /mx:DataGrid /mx:Application --Code ends--- - Vinoth --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: Try something like (foo contains 'pdf' or 'word'): mx:Script import mx.controls.Image private function addGif(o, c) { return o.foo + .gif } mx:DataGridColumn labelFunction=addGif itemRenderer=Image / From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Vinoth Babu Sent: Tuesday, April 03, 2007 8:05 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: Re: [flexcoders] Re: Need to different images in datagrid column Thanks for your info . But I need to load images according to the data. for e.g. In a column , if a data is 'pdf' then load 'pdf.gif' or if it's 'word' load 'word.gif' pdf.gif or word.gif or... are shown in one column in a different row each Thanks , Vinoth Jack OMelia [EMAIL PROTECTED] wrote: Try using an itemRenderer. Create a separate component that looks like this: (saved as imageRenderer.mxml in the comps directory) ?xml version=1.0 encoding=utf-8? mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml paddingBottom=0 paddingLeft=0 paddingRight=0 paddingTop=2 width=50 height=20 horizontalAlign=center mx:Image source=images/image.gif width=14 height=14 / /mx:HBox then add it to your datagrid like this: mx:DataGridColumn headerText=! itemRenderer=comps.imageRenderer / HTH, Jack --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Vinoth Babu tjvinoth@ wrote: Hi, Need your help to load an different images in a datagrid column Thanks Vinoth - Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. Never miss an email again! Yahoo! Toolbar http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolb http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolb ar /features/mail/ alerts you the instant new Mail arrives. Check it out. http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolb http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolb ar /features/mail/