ActionScript 2.0 :: Makes A List Of Nodes From Xml?
Oct 4, 2007I made a flash program that makes a list of nodes from xml. They go like this 1 2 3 4 5..How can i make them go like 5 4 3 2 1 ?
View 1 RepliesI made a flash program that makes a list of nodes from xml. They go like this 1 2 3 4 5..How can i make them go like 5 4 3 2 1 ?
View 1 RepliesI do not know flash at all and i am writing some code in Action Script 3 and am having some trouble.
Basically i have a list that is read from an XML file.
I am busy writing a function to allow a user to enter a search word that will allow him/her to find the closest matching node.
For example, if the nodes are:
1) movies
2) music
3) books
4) plays
typing "m" will search and scroll through 1 and 2 continuosly after every button click but typing "mo" will find only 1.
Using mytree.findNode("label", search_word); //will only find nodes of EXACT name Using mytree.getNextIndexAtLetter(search_word, i); //Will only find nodes with starting letter of search word
say I have an xmllist like this (but with many other attributes not shown for brevity):
<node metal="white gold"/>
<node metal="yellow gold"/>
<node metal="silver"/>
[code].....
I have a basic Tree built in Flex. The Tree works fine. I'm attempting to get a list of all of the visible nodes. I know there is a Tree.openItems, but that does not suffice because (for example) if you open all the items in your tree and then close the root, the invisible opened items are still counted.
View 1 RepliesI'm looking for a way to list all XMLNode that have a certain attribute, in my case, the "link" attribute.So i do :
Code:
var list:XMLList = xml..@link;
for each(var i in list){
trace(i);
}
But this traces the value of the attribute and not the node containing the attribute... How to trace the node??
I develop a piece of code that brings me to an xml, all Nodes i use this code:
for(var i=0; i< menu_xml.childNodes.length; i++){
corrent_node = menu_xml.childNodes[i].length;corrent_item.action = corrent_node.attributes.action;corrent_item.variables = corrent_node.attributes.variables;corrent_item.name.text = corrent_node.attributes.name;
[code]....
What I need is for each of the nodes highlighted in green to return the child Nodes. Example: when I move the mouse over the menu Indoor lighting, the results should be: Indoorlighting | LED 10W> 3W LED> LED 6W
For those unfamiliar with tree structures, tree structures are usually dynamic lists where every node has a pointer to two other nodes. They are arranged so it makes for faster searching and stuff and are very useful in programming languages that offer direct access to heap memory. Although I don't know if there would be benefits of making tree structures in AS would be of any help but I decided to have a go at it anyway. Since there are no pointers in flash I tried to just replace pointers to nodes with nodes themselves. Such things usually work in java I think because the language just automatically makes pointers for variables.
[Code]...
I'm using flex 4.1 to write an application. i read in the documents that has the rowCount property to set how many items to display. the does not have that property. how can I limit the list to display 3 items ?
View 3 RepliesI am working on an older Flash project created in CS3 ActionScript 2.0 How can I make the pointer cursor change to the hand when hover over a list item?_root.slidePanel.myList'myList' is the list. I have traced out the contents of the List MC and it has a child MC called 'content_mc'. I assumed this was the object containing all of my list items but the only members of this MC I can see (when tracing them out) are 'setRGB' and 'searchKey'.
View 1 RepliesFlex 3 List control had a itemRollOver event. Flex 4 List doesn't have it. Is there an equivalent or a workaround for this issue?
View 2 RepliesCreating a dynamic list and associating a picture with each list item. i need the list to be scrollable, and i want the list and it's associated picture to be displayed randomly when the application is re-launched. i.e it doesnt show the same list everytime.
I also what to be able to sort the displayed list items. e.g if the list items is about restaurants, i want users to be able to sort the displayed items by either; district, cusine type and gastro type.
I have a combobox and list component on the stage. The combobox has 3 selections. How do I get it so that each selection triggers the specific xml file to load into the list component? I can't get them to communicate to each other.
View 1 RepliesHere is a snip from within my code:
[Code]...
The 'recommendations' dataProvider is an ArrayCollection of String, which are generally sentences about as long as this one. By setting the variableRowHeight and wordWrap properties as shown, if a sentence is too long to fit on a single line, everything works fine- the row expands and the messages show on two lines, or occasionally three.
The space allocated for this panel within the entire canvas means if the total text size of 'recommendations' exceeds six lines, I need for the entire list scroll. This is also working just fine. The trouble is when using the mouse wheel to do the scrolling- Flex scrolls both the entire list and the single item where the mouse is hovering. Often this results in only the second half of a sentence being visible. Non-programmer friends I have asked to look at this noticed this, and tell me it as a problem. If a user does not notice the dual scrolling, and sees only a fragment of a sentence, it will be perceived as an error in the application.
[Code]....
I want to add a SimpleButton to a list item in a list component. I am getting the CellRenderer for the list item I want and using the addChild method to add the simple button. The button appears in the right spot on the list item but it doesn't function like a button. It's like the contents of the buttons first frame is added to the CellRenderer and nothing else.
View 1 RepliesWhen a user selects a category from the first drop down box then i want the 2nd drop down to be updated based on the selection of the first drop down. I have created multiple ArrayCollections whose names are set to the "data" values of the first drop down, for instance:
[Bindable]
public var countries:ArrayCollection = new ArrayCollection([
{label:"USA",data:"USA"},
[code].....
I am currently working on a project in Flex and I am having a hard time having a list's contents ALL be selected by default. Wondering how to do this.
<mx:List id="list" dataProvider="{dp}" allowMultipleSelection="true"/>
I'm just trying to have the list all selected.
Why I have to press 2 times the arrow key down to get a navigation through the list items in a list component of Flash?
Theres any workaround for this? I have a listener for keyboard event that checks if keyCode is equal to 40 if it is then I use 'stage.focus = list', but I have to press 2 times key arrow down to start navigating through list items.
I'm trying to animate a list as I delete the top row. All the examples I can find use itemsChangeEffect to bind to the effect, but this property exists only in MX lists, not spark lists.
Any idea how I can get the same effect done in Spark Lists?
I'm trying to remove the top most item in the list with a slight fade out effect before the rest of the items move up to replace the gap.
This is sooo anoying! I can't type anything properly! The longer a line gets, the further the blinking line thing intersects with what you typed, and punctuation obstructs the text
View 3 RepliesDoes anyone have an idea as to why this happens?The dropdown menus work fine (they are a flash app)The dropdown menus do not work.I'm unfamiliar with how to make a redirect if they just type the url without the 'www'
View 4 RepliesI have this script on a specific frame and when this frame is called it should load an external movie into a mc that I have on my stage. The mc is named as holder and thumbURL down there is a vatiable which holds the name of the swf I'm trying to load into the holder.
My problem is that the mc dissappears when I try to load this new swf into it. Could it be something with relative/static paths?
onEnterFrame = function(){
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
[Code]....
What are the rules for something to be a GC root in Flash? I'm using the Flash Builder 4 profiler, and I'm finding odd things are labeled as GC roots in the object reference details (e.g., an Image control that is no longer in the display list, nor static).
View 2 RepliesUsing Flash CS5, when activating Export SWC in the Flash Publish Settings, I end up with a much bigger file (500 ko) than when the SWC is not activated (around 100 ko).
Why is the SWC 5 times bigger ?
I want to make an app that allows the user to add their own content (pics, movie clips, songs) and then the app saves/exports the content as a SWF so that the users can use the exported swf wherever they like. Can this be done? What do I need to look into?
View 1 RepliesI have made a game which successfully uses SharedObject as a highscore system (if you know SharedObject, you'll know what I mean) But after the first time playing the game, when it loads the highscore using SharedObject, it goes noticablly slower My computer when new only had 1gb ram so is slow as it is. Is it just a speed issue with my computer or is this a regualar occurance?
View 0 Repliesi have a red colored box, and i want it to gradually tween into being green.. is that possible only using actionscript?
View 1 RepliesI am trying to make a flash footer for this forum. A footer is 300 by 60. If the user mouses on the top half of the footer, then my image inside will scroll up. Vice versa for mousing on the bottom half. It aint seem to work. I put the below on the image, which is a movie clip.
Code:
onClipEvent (load) {
//because the footer is 30 pixels high
newHeight = this._height+30;
}
[code]...
I am creating a map of the USA and when a user mouses over a particular state,I want to display a movie clip (which is just a text list of our dealers in that state). When the user mouses out I want the list to disappear.However, I want the user to be able to mouse over the list to scroll the list and whenever I try it, obviously the state loses focus and the MOUSE_OUT Event fires.How to I get around this?Here is the code I have currently:
Code:
PA.addEventListener(MouseEvent.MOUSE_OVER, showDealers);
PA.addEventListener(MouseEvent.MOUSE_OUT, hideDealers);[code]............
while i using drag & drop from listbox1 to listbox2 ,how can i get all the items of listbox2 in flex
View 1 RepliesThe traditional way to assign an icon would be to use the icon field of the item renderer,which reads the value of "icon" property in your data, for example:
listData.addItem({label: "Logout", icon: "com.classpth.DefualtThemeLogoutIconClass"});
But i want the DefualtThemeLogoutIconClass to changed to another class: ightThemeLogoutIconClass when the theme is changed.The only way to do this would be to use a style declaration containing a classReference to the icon, and change its the value in each of the CSS files of the various themes.The question is, is there any way to assign this style to an icon in a List, something as easy as intuitive as list[0].getIcon().setStyle("styleName");