Iam trying to do a highscore list which is generated on a website as Xml and then send to Flash. I have got the Xml to be loaded into Flash but the probelm is that i want them to be sorted in so the highest score is on the top and then its going to down to the lowest score.
I am creating a visual map in flash of my database bookings table. I have my xml loaded into AS3 and I think that the next stage is to sort the data by the room numbers and place the data into separate arrays, how do I approach this?
I have a datagrid with multiple columns. I can click a column header to sort the rows, but I don't know how to sort on two or more rows. For example, last name, age, then racing time.
I'm new to actionscript but have some basic programming skills. I've downloaded some code that finds and displays fields from an attribute table of a feature, from my limited knowledge it seems to be adding this data into an array collection, the problem is I need the data fields to be displayed in alphabetical order, or in the order they are originally stored. I tried to use the sort function to order the array but can't get it to work.
The source code is below: <mx:Script> <![CDATA[ import com.esri.ags.events.DrawEvent; import com.esri.ags.events.IdentifyEvent; import com.esri.ags.geometry.Extent; import com.esri.ags.geometry.Geometry; [Code] .....
There are 12 color variables, and each answer adds a number to each variable.At the end of the quiz, all the variables are put into an array, and sorted. Then the 3 highest variables are displayed. I have gotten this far. My problem is that I need to link the variable name (color) with the number it returns.[code]
I have a flex datagrid. it is bound to an array collection. if the user sorts on column X it works fine. then, if the user causes the array collection to change, the datagrid forgets that it was sorted on column X.what do I need to do to preserve this sort preference so that the new array data will appear sorted by column X?
Created an editable flex grid which exposes a method called getGridData() to javascript. I am using the JSON.encode() method of the [url]....library to convert the grid object's dataProvider into JSON before returning it.
ExternalInterface.addCallback("getGridData", getGridData); public function getGridData():String {[code].....
However, when I sort a column in the user interface, the encode method is failing throwing the following error
Property usingCustomCompareFunction not found on mx.collections.SortField and there is no default value.
I have a list of 99 item (something like a phone book) and I will like to sort them in different method. Part of the 99 item might be empty, so the requirement is to move the empty field behind the sorted data in every sorting behavior, here the code we have so far:
would anyone beable to help with sorting out an XML file, what I have is a tooltip that loads in via XML and exported from flash. the XML loads in 2 text fields, field and field2. what I am trying to do is add a button also to the tooltip so that you can click and go to a url. this is what I have in my XML file;
var dataArray:Array = [ 5, 6, 3, 8, 10, 11, 32, 2 ]; var dataObjectArray:Array [ { "uid": 5 }, { "uid": 6 .... Similar to above ... } ]; I have the above 2 arrays in AS3. and i wish to sort them numerically (1 ~ X) in order [Skipping those that does not exist]. What is the best and most efficient way to do so for dataArray / dataObjectArray.
I've just started making a RPG game.I want to add alot of monsters, and I'm looking for a way to keep all my monsters in one class maybe? So I'd have a class called "Monsters" and in it it would be like:
Is there a way I can store my monsters like that, AND read them from my main timeline, so when my character enters my dungeon, it will take a random monster from that class file? And also I would need to get the stats from the monster, so I can calculate the damage dealth.I would also need a system like this for sorting out all my weapons in game, where the stats are kept too.
Code: var appleCount:Number = 8; var bananaCount:Number = 5; var carrotCount:Number = 2;
[Code].....
What I want to do is sort them by value.
Basically I have some fruit and veg objects, and I want to add 5 randomly to the scene. So the first time you run the application, you might get a banana, apple, carrot, kiwi and grape. Then another time it might be apple, kiwi, cabbage, pineapple and banana.
But I want to make it based on how many times they have been seen previously. So if the count variables are as shown above, how can I sort the fruit and veg objects in to order, so I only add the lowest 5? Bearing in mind, the numbers might all be the same. I.e. the first time it's played, the count for all objects will be 0. So I want to choose 5 random fruit/veg with the lowest value.
I assumed the best way to do this would be to put them in to an array, sort it and select [0], [1], [2], [3] and [4]. But how can I put the values in to the array and sort them without losing the fruit/veg they are associated with?
I.e. if I end up with an array of {2,3,5,5,5,5,8}, I have no idea which fruit and veg they represent.
I'm creating a table that displays information from a MySQL database, I'm using foreignkeys all over the place to cross-reference data.
Basically I have a datagrid with a column named 'system.' The system is an int that represents the id of an object in another table. I've used lableFunction to cross-reference the two and rename the column. But now sorting doesn't work, I understand that you have to create a custom sorting function. I have tried cross-referencing the two tables again, but that takes ~30sec to sort 1200 rows. Now I'm just clueless as to what I should try next.
Is there any way to access the columns field label inside the sort function?
public function order(a:Object,b:Object):int { var v1:String = a.sys;
Quick Question, I just started learning the psuedo 3D methods in FP10, and as a sample I am creating a virtual rolodex. It is dynamically generated with a user inputted number of cards. The cards are then added to the stage and are rotated around a central axis using the function below.
[Code]....
After this is created I have an Enter Frame listener that rotates the cards around that axis based on mouse position. Problem is that they get depth sorted based on the order that they are created, cardArray[0] in back all the way up to whatever the number of cards is. I have tried a few of the simple Z sorting classes and noticed that my cards dont actually change there Z property, only their rotationX. I was just wondering if anyone might know of an easy way to depth sort these. Otherwise the best idea I can come up with is to check the rotation based on 360 degrees and assign a depth. That seems like a lot of ugly math though if you want to see what the swf looks like check here.
I'm not quite sure how to do this - I'm building an admin interface to sort the order of a series of flash slides into a dynamic presentation. The admin interface pulls the slides from xml and displays each as a thumbnail. The thumbnails, when dragged, reorder themselves in the array appropriately. The problem is, I want the actual array of slides to reorganize itself accordingly. My code is this:
function onThumbPress( e:MouseEvent ):void { e.target.startDrag(); } function onThumbRelease( e:MouseEvent ):void { e.currentTarget.stopDrag(); sortSlides(); [Code] .....
So what I want to do is take the change in the array (say 0 moves in front of 1 in project_thumbs_array) - and make sure that my other array (project_clips_array) moves item 0 in front of 1 as well. I thought something like this might work but it doesn't: project_clips_array.sortOn ('project_thumbs_array.x',Array.NUMERIC);
iSo let's say I have three different arrays of objects, and I want to combine them into one sorted array. I want the order to be such that the items from each array are evenly distributed throughout the sorted array.
If there were 3 xItems, 3 yItems, and 3 zItems, the sorted array would have this order: x, y, z, x, y, z, x, y, z
HOWEVER, even if the arrays are differing lengths, I still need to make them alternate as much as possible. If there were 6 xItems, 4 yItems, and 2 zItems, the sorted array should have this order: x, y, x, y, x, z, x, y, x, y, x, z
I have a list containing display objects from throughout the application (insertion order). I want to process the list either top-down (parent, child) or bottom up (child, parent). The only requirement is that either a parent is processed before any child or vice versa a child before its parent. What is a good approach? This question is not about sorting a list. It's about retrieving the depth of a particular display object.
Example Display list: A (root) B1 C1 C2 D1 B2 ......
My list: list = [E1, F4, A, B2, B1, C3, ..., N9, N8]
Bottom-up: N9, N8, F4, E1, C3, B2, B1, A
Top-down: A, B2, B1, C3, E1, F4, N9, N8 Does not matter if N9 before N8 or N8 before N9. Important is that any N is before M (first run) or any M before its children N* (second run).
I have been deveolping my new site, which is in it's early stages and have most things working ok but i need to open new windows from buttons in the main swf file. please check out my link to see for yourself! new windows load in the same window ad the main swf. [URL] I have been using this code on the thumbs on my design and illustration sections
on (release) { getURL("javascript:NewWindow=window.open('url.html ','newWin','width=1133,height=425,left=425,top=113 3,screenX=1133,screenY=425');NewWindow.focus();voi d(0);"); } each of the thumb windows being a different specified size.
Is there any way in Flex where in we can sort an arraycollection based on strings .I have a dataprovider with strings like "Critical" "High" "Medium" "Low" where in I need to sort it in such a way that I need Critical to be displayed on the top and next High , Medium and Low follows.
I have an advancedDataGrid and I would like to sort the adg according one AdvancedDataGridColumn(studyDate) which use strings in format DD/MM /YYYY(I receive like this from the server):But i find another problem, I need to sort the columns of the adg the first time it displays so I used the following function but It doesn't sort from the recent day to old one, I do not know what I can I do cause I set sort.descending= true, any ideas?[code]
I have a one comboBox that I fill as: for (var key:String in values) { conns.addItem(key); }
After that I sorted my ComboBox as: private function sortConnection():void { var dataSortField:SortField = new SortField(); dataSortField.name = "data"; dataSortField.numeric = true; var numericDataSort:Sort = new Sort(); numericDataSort.fields = [dataSortField]; conns.sort = numericDataSort; conns.refresh(); }
And on finish I want to select item on my specific value in ComboBox. How can I do that? I try: for (var ii:Number=0; ii<combo.rowCount; ii++) { var item:String = combo.getChildAt(ii); if (item == name) { index = ii; }} But does not work. I do not know where I made mistake, and how I can select on specific item in my combobox.
i just started with isometrics. i got the 3d to 2d coordinates working but i cant seem to get the z sorting to work. please check the fla if you have knowledge in the subject.
Trying to re-sort an array of objects from: var arr:Array = new Array({num:0},{num:1},{num:2},{num:3}) to var arr:Array = ({num:0},{num:3},{num:1},{num:2})