[flexcoders] Re:This component won't populate with data
DOH! (slaps himself on the head) I really should avoid continuing to work when I'm already dead tired. :( Thanks guys.
[flexcoders] Re:How do I detect 'enter' key on a textInput control?
Here is one way to do it. Let's say this is your mxml: Then your keydown handler would be: // Waiting for return key private function txtKeyDownHandler(event:KeyboardEvent):void { if (event.keyCode == 13) { // do something } }
[flexcoders] Re: Datagrid question
>> ".iterate through each row." You absolutely *cannot* do that, because all >> the DG rows do not exist, only the rows currently visible exist. >> >>You need to have your renderer update the dataProvider with the generated >> value, then iterate through the dataProvider. This should not be difficult. >> >> Tracy Spratt, I guess I would have to add an additional "license" field in my dataProvider, and I will just have my component itemrenderer put the data into that field, and I'd be able to iterate through my dataProvider to access the data. Okay, thank you for your advise on this, and this is all great and dandy. But please allow me to pick your brain a little more. Let's say my application still contained the same data format as described so far. But this time, my application is limited to a fixed 3 row x 3 column grid where everything is visible (and such, all are existent), is there a way to access the data without using the dataProvider? In other words, is there a way I can get a reference to each row, which presumably will be an array of columns, and then access the data similar to the way you would a two-dimensional array, keeping in mind that some of the cells can contain MXML components, and hence, require obtaining the reference of that MXML component in order to access its properties?
[flexcoders] Re: Datagrid question
Thanks for responding, Tracy. Let's say this is an application that allows generation of license numbers. Imagine this: You have 3 columns in the datagrid. The first and second columns are the first and last names of a person. The third column is a button (which is really part of an MXML component) that has it's 'label' set as "Click to generate license number". When the user clicks the button, the logic to generate the license number is within the component and will be output to the label property of the button, and the button will no longer be clickable. The application allows multiple people to be listed in the datagrid. Outside the datagrid, there is a button that says "Click to print all". Given the specs I described so far, it's clear that I have to be able to iterate through each row in the datagrid, extracting the data from each column of each row. Typically, I would just get the dataProvider array collection object, and the problem would be solved. But because the license number is being output through the label property of the button (which is part of a MXML component) and is not part of the original dataProvider data, I can't go that route. I figured I now have to somehow iterate through each row, grabbing the data of each column of the row and storing it somehow. Is there a way for me to get the license number from the label property of the buttons?
[flexcoders] Re: Another on try-catch-finally ...
There is a possible benefit to having a try/catch with an empty catch block -- that your application won't stop execution. If the problem that occurred in the try block does cause a subsequent problem down the road, that's a different story.
[flexcoders] RE: Passing array to component
In the application where the component resides, I have a 3-element array of strings called "myArray" that needs to be passed to my component. So my code is: where "myComponent" is my custom component, and "myArray" is the 3-element array of strings. Inside the component, I have this attribute defined: When I do: alert(arrObj[0]); from within the component, it's not showing what I had passed in, which tells me the 3-element array of strings is not being passed into my component correctly. I figured that perhaps I'm not doing it syntactically right in my component? Any help would be greatly appreciated. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] RE: SharedObject stores data unpredictably?
I have an editable combobox where I am saving the entries entered by users. I am saving them to a SharedObject. When I later retrieve the data from this SharedObject, I noticed that the data are no longer in the original order. For example, if the data currently in the combobox dropdown were the strings A, B, C, and D from top to bottom, after I do a: var comboBoxSharedObject = SharedObject.getLocal("myCookie"); delete comboBoxSharedObject.data.dataProvider; comboBoxSharedObject.data.dataProvider = dataProvider; // where dataProvider is the combobox's dataProvidercomboBoxSharedObject.flush(); When I later retrieve this same set of data later, the order of A, B, C, and D are no longer preserved. Instead, it comes back in some other sort order. Any suggestions on how I can prevent this problem? Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: Tree component confusion
My objective is to allow the user to drag a tree node and drop it on another node, and then reflect visually the changes he/she has made. I since learned this is a lot more complicated than meets the eye because the index of the drop location seems to change. From what I have seen, the moment a branch opens,its index becomes 0, and when it's closed, it's index becomes relative to its parent node. So if Node A is the topmost node, and Node B is its child node, whileNode B is closed, it's index is 1, but the moment I open Node B, it's index becomes 0. This is aproblem because the only method I see that I can use for my purpose is the addTreeNodeAt(index). And if there were multiple branches open in the entire tree, we end up having multiple nodes with the SAME index! Can anyone give me an example of a drag-n-drop operation entirely within a tree? The examples I have found deal with dragging datagrid items on a tree, or dragging items from a tree to a list box. What about an example that drags a tree item and drops on another tree item within the same tree?
How to open a tree branch by default
I noticedI could simply add an isBranch="true" to an xml node, and it would know to use the branch icon as opposed to the leaf icon. Is there something similar to makea branch OPEN or CLOSE? I know there is the setIsOpen() method, but that requires me to have a reference to a node to work. What I wanted to accomplish was just being able to pass XML to a tree, already pre-specifying which nodes will be open and which nodes will be closed. Does anybody know how to do this with having to use the setIsOpen() method? Thanks.
How do I get references to children of a container?
If I had a which had 3 buttons, how can I access references to these 3 buttons programmatically? I have tried : for (var p in cvs) alert(p); But I seeno property I can use to iterate through the children, nor do I see the "id" of these 3 buttons. Thanks.
Getting mouse coordinates at a drop operation
How can Iget the mouse xy-coordinates? I'm trying to drop an object into a Canvas, and I'd like the object to position itself where it is dropped, and I can't do that unless I knew what the mouse xy-coordinatse are at the time. Thanks.
htmlText property doesn't support tag?
I have a control where i'm equating its htmlText property with a full-fledged html document. The results didn't come out too well. I'd like to say it doesn't support the tag, but in the final rendering, it seems that boldfaced and italicized text are coming out right, and I don't see tags in the result either. So it seems to me that Flex was able to parse the tags but just didn't render it right. All formatting expected from the use of didn't seem evident to me. I just wanted to get something official from the Flex community. So the htmlText attribute of the does not handle tags? Thanks.
How do I create a listener WITH parameters for a button dynamically?
Here is an example where I am creating a button using mxml: Notice mythat the click event refers to a function, btnOKClicked, passing 4 parameters to it. Here is an example of me creating the same button, BUT dynamically: var temp = this.createChild(mx.controls.Button, null, { id:"btnOK" label:"OK" }); Now here is my question. How do I dynamically define a listener for this that allows passing multiple parameters? I would normally do this: temp.addEventListener("click", mx.utils.Delegate.create(this, btnOKClicked)); But this includes only the function name (btnOKClicked), but I want the click event handler of this dynamically-created button to pass the strings, "hello", "blue", and "bird" as well. How can I do this?
RE: Halotheme.fla
I know Flex allows programmatic skinning, but we have a graphic designer who needs to modify the theme in a non-programmatic fashion. In Flash, it was easy to find Halotheme.fla and modify it, but I can't find the corresponding theme file for Flex. Does anyone know what filename the theme file is for Flex and where to find it? Thanks.
RE: Mouse cursor change question
How can Ichange the mouse cursor to a hand, just like the hand cursor we get when the mouse is hovered over a mx:Link control? And how do I change it back to the normal cursor? Thanks.
RE: Drag proxy question
The reference guides say that the third parameter of DragManager.doDrag() is: "dragImage: Object - Reference to a class or the linkage ID of a symbol that specifies the imageto drag around. To specify a symbol, use a string that specifies the symbols name. To specify a class, pass in the constructor for the class." If I had a mx:VBox with a label and image in it, and I wanted the drag image to be the entire VBox (just what I see on the screen), how/what would I specify in this third parameter? Is it even possible? Thanks.
Drag-and-drop question
Does Flex's drag-and-drop support dropping of mx:Button or mx:Text objects into a container like a mx:VBox? Or am I limited to dragging only items from a Tree, a List,or a datagrid? When I try to drag a mx:Text control onto a mx:VBox, everything seems to go find until the DragDrop event where I try to do: var dragItems = event.dragSource.dataForFormat("items"); and dragItems is always returning "undefined". Does anybody have any suggestions? Thanks.
RE: htmlText question
I am posed with a requirement where a display of mixed fontweights and fonts is needed. For that reason, I chose to use a mx:Text control via its htmlText property, applying the appropriate HTML to accomplish this. More specifically, the mx:Text box was supposed to contain a company name on the first line in bold face, and a person's name on the second line in italics. But then,I was told that both of them were supposed to be hyperlinks that FLEX was supposed to respond to! The only way I know of creating a link which Flex can respond to is via the mx:Link control. However, if I go that route, I lose the ability to display mixed fontweights and fonts. Can anyone give me any suggestions on how to accomplish these two things: 1) Be able to display mixed fonts and fontweights, AND 2) Be able to have links in the display text that FLEX (not the browser) will respond to. Thanks.