I have a vector of Objects. Each object has two properties - a country and a person's name.
I'd like to sort & count the number of people from whatever country they are from...
i.e.
20 USA
18 France
16 England
I've found articles online that deal with sorting, but I'd like to be able to count the objects' "country" properties dynamically because they aren't known beforehand (I don't want to loop through every country).
What I want is to sort a Vector array of objects(not primitive), based on a propery(Number). (think character.zDepth). Generally the same thing as the sortOn function of Arrays, except that we don't have that for Vectors. like myArray.sortOn(x, Array.NUMERIC) Dealing with Vector arrays of primitives not complex objects.
I'm trying to make a volume button for my site and it looks something like this:
- ||||| +
i want the volume bar to start filled and when the user hits the minus button it lowers the volume and when it hit plus it takes the volume up well when I go down and up the volume bars start to get crazy...it just works when I go down the whole way and after it goes up the whole way, when I change direction on the midle of the path it jumps some bars...
Code: volDown.addEventListener(MouseEvent.CLICK, menosVol); volUp.addEventListener(MouseEvent.CLICK, maisVol); var cliques:uint = 0 if (cliques == 7){
ActionScript Code: 1067: Implicit coercion of a value of type __AS3__.vec:Vector.ie.aro.floorplanviewer.model.buildingVOs:ConfigurationVO>[code]....
which surprises me as ConfigurationVO inherits from NodeVO.Is the compiler really not able to figure out that a Vector of a superclass should be able to hold a reference to a Vector of a subclass?
I've found a simple count up script over on Actionscript.org
var count:Number = 0; var maxNum:Number = 1250; var num:Number = 1; this.createTextField("txt", this.getNextHighestDepth(), 0, 0, 100, 50);
[code]....
This works great for my use, but now I am trying to figure out how to make it count down. I've tried changing everything to opposites like count=1250 and maxNum=0 (I think this would be the minNum instead), count+=num to count-=num, and count>=maxNum to count<=maxNum.
I need to import a bunch of vector work from Photoshop into Flash. Is there a trick to it. So far, on import, it's converting the layer styles into black.
I am currently being confused by the Vector class.I wrote a beautiful XML to TypedClass parser. Works beautifully and without fault. UNTIL a co-worker noticed we got a Conversion Error for Vector.<Number> to Vector.<*>.
Every Vector I've ever tested all extend Vector.<*>.
Vector.<Sprite>, Vector.<String>, Vector.<Point>, Vector.<Boolean>, Vector.<TextField>, Vector.<CustomObject>, etc etc etc. ALL of them. <type name="__AS3__.vec::Vector.<String>" base="__AS3__.vec::Vector.<*>" isDynamic="true" isFinal="false" isStatic="false"> <extendsClass type="__AS3__.vec::Vector.<*>"/>
[code]...
But then when I use describeType on Vector.<Number>, Vector.<uint> and Vector.<int>.
Now I have accounted for these 3 vectors individually as even uint and int does not extend Vector.<Number> as I would have expected. And my parsing function works for all types correctly again. But my confusion comes as to WHY this is the case, and why I couldn't find any documentation on the subject.
I have a large vector drawing (imagine 5000x5000) that i want to break up into separate pieces. I know that I can convert this vector drawing into a bitmap and then use the copyPixels method to create many separate bitmaps of the different regions of the original vector drawing, but is there any way to subdivide it into movieclips that just contain vector graphics instead of a bitmap?The reason im dividing a big chunk of vector graphics into smaller pieces is for performance reasons, so flash would only render a small part of this big chunk at a time (only certain regions/voxels/subdivisions are rendered at a time). But bitmaps apparently take up a lot of memory and the system im using would take much less memory if these subdivisions could be preserved in their original vector graphics form.
I imagine I could use masks somehow to achieve this effect (for each subdivision, duplicate the huge image and mask only the region that the subdivision represents), but I dont know the performance costs of masking or if this will create other problems.So is there anyway to split up a movieclip of vector graphics into smaller movieclips of vector graphics the same way copyPixels can with bitmaps?
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})
I'm trying to bring XML nodes into an array so I can sort them in alphabetical order, then display the data in some textfields in a movieclip.I've managed to get the XML displaying fine in the movieclips and all the data in the arrays, but the problem is I'm not sure where to use name.sort();. Right now you can see I have it at the start of the loop that places all the data in, but it will only sort as it populates and hence becomes pointless.Is there a way to add all the data into an array, sort it, THEN display all the data in my movieClips?My XML looks like this:
Rows B, D and E do not sort correctly, basically because I am assuming they have numbers with unmatching or too many places. I can not find any help online with this. The columns with percentages work fine unless they go over 99%. ?[code]...
In the project I'm working on, there are towers the user can place. However, it you place a tower higher then another one, it appears infront of that one, which looks weird.I want to be able to arrange all the towers so that that does not happen.There is an sprite called towerHolder holding, which all the towers are children of, and an array called towerArray, which the towers get pushed to when they are created.I tried clearing towerHolder, then running the sortOn() function on the array, and then adding each tower back to the towerHolder, but the towers just seem to be randomly placing themselves irrelevent to their height.Here's my code for the relevant parts:
Actionscript Code: function clearTowers():void { while (towerHolder.numChildren > 0) { towerHolder.removeChildAt(0); }}function orderTowers():void { clearTowers();
have a twodimensional array that consists of 6 other arrays(like array[0 to 5][0 to 4]). The [4] of each sub-array is a indexnumber that i'd like to use for sorting the array[0][x] toarray[5][x] according to their array[x][4]-value. How would I do
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;