ActionScript :: Array.sortOn() For Non-English Data?

Nov 13, 2010

this is an array of objects that i want to alphabetize:

var streets:Array = new Array();
streets.push({name:"Édouard-Montpetit"});
streets.push({name:"Alexandre de Sève"});
streets.push({name:"Van Horne"});
streets.push({name:"Atwater"});

now i'll sort my array:

streets.sortOn("name", Array.CASEINSENSITIVE);
//Sorted
Alexandre de Sève
Atwater
Van Horne
Édouard-Montpetit

the accent above the E in Édouard-Montpetit, and any other first letter with a non-english accent is sorted after Z.how i can sort this correctly? i do not have access to the named data.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: SortOn(DECENDING) For The Number Array And Then Have The String Array Sort To Match

Jun 14, 2007

I have two arrays. One contains numbers and the other contains strings. I want to do a sortOn(DECENDING) for the number array and then have the string array sort to match. if my string array is

[Code]....

View 6 Replies

ActionScript 2.0 :: CS3 SortOn A NUMERIC Array

Aug 20, 2010

I have a button on the screen with the the following code attached to it's release function.

[Code]...

No matter how i sort the dataTag array it never puts the information into the respective order. The 10XXX figures always come ahead of the preceeding numerals. Anyone come across this before who can point me in the right direction?

View 10 Replies

ActionScript 2.0 :: Sorting An Array Using SortOn

Feb 17, 2009

I am trying to sort an array that is generated thru an xml file.

The XML has "sections" that are used to generate a different view type, it is NOT used here but is needed for other features. What IS used is the artist name & ID. This function takes the data from XML and takes the name and ID from each section and puts it into 2 separate Arrays, "nameArr" and "noArr". After these two new arrays are created they are sent into an object "sectionData". The objects are then sent into a new Array "multiArr". This looks a little overkill but it is needed to create a new array without the section info.

I am trying to sort this new array multiArr using the "sortOn" method by "ID" to sort it by id but it is not working. It doesn't sort the array.

ActionScript Code:
public function setListData( data:Array ) {
var sectionData:Object = {};

[Code]......

View 5 Replies

ActionScript 2.0 :: Array: SortOn() Letters With Numbers?

Jan 5, 2009

I have an Array of objects that each have a Name and a Score. I can sort the Array with '.sortOn()' by the object's Name or the Score, but when I sort by the Score, if some Names have the same Score, they don't list Alphabetically within that Score.
The following code shows what I mean. The Names with a Score of 50 are together when listed by Score, but they are not Alphabetical. How do I combine both ways of sorting?

[Code]....

View 1 Replies

ActionScript 3.0 :: Flash - SortOn() Array Function?

Apr 13, 2011

I have an array of objects. The objects have a base class with various properties. Each time an object gets created, I push it into the array. However, I need to sort the objects based on one of their properties.Lets say in my object class, I have a function "ReturnNumber()" that returns a number, I want to sort my array based on which number was the highest. Can I use SortOn() to do this?

View 1 Replies

ActionScript 3.0 :: SortOn Alphanumeric Array Which Holds Objects?

Apr 7, 2010

I have an array which holds objects. The objects have properties called cat and title. The cat property can hold values like:
Cat 1
Cat 2
Cat 3

And the title property can hold values:
Title 1
Title 2
Title 3

So that you wind up with something that looks like
Cat 1
Title 1

Cat 1
Title 2

Cat 2
Title 3
etc.

Now, I want to sort these, but we all know that Array.sortOn(["cat", "title"]) will produce results like:
Cat 1
Cat 10
Cat 11
Cat 2
Cat 3

What's the most efficient method of sorting these properly (so the number component sorts like a number and not like a string)? I can request users pad their entries (yes, other people will be entering this data), but that's both a little bit ugly and not very user friendly.

View 2 Replies

ActionScript 2.0 :: Array.sortOn With String And Integer Flawed?

May 12, 2006

I'm using the sortOn method to sort my array. concider this array:

var list:Array = new Array();
list.push( {id: "1"} );
list.push( {id: "4"} );
list.push( {id: "12"} );

[code]....

How can this be fixed? I want my sort to have the following result:

fubar1, fubar4, fubar9, fubar12, fubar23

View 6 Replies

ActionScript 2.0 :: Multidimensinal Array SortOn() No Field Names?

Sep 23, 2006

My multidimensional array is created this way :

Code:
cards_array = new Array()
z=0

[code].....

View 3 Replies

ActionScript 2.0 :: Array.sortOn With Objects Of A Custom Class?

Jul 27, 2007

I'm trying to do Array.sortOn on an array of custom-class objects. It's not working, though nothing in the documentation suggests that this is a problem. Below is the code. I'm confident the MetricRecord constructor is working fine because everything else works, and the traces below are correct, except they don't sort.

// This array sorts
metricRecords = new Array();
metricRecords.push({mediaVehicle:"cca", temp:"asxcvbxcber"});
metricRecords.push({mediaVehicle:"aaa", temp:"asdfertr"});

[Code]....

View 1 Replies

IDE :: CS3 SortOn On Arrays Crashes?

Jul 3, 2010

I'm trying to sort some arrays with the sortOn() function in Flash CS3.. but it always seems to crash itself upon exporting!Do you guys get this too? And is there a way to get around this?

Code:
var ms:Array = [];
ms[0] = [0,1];

[code].....

View 2 Replies

Xml :: (Flex 3) Get Data From A File Using HTTPservice And Save The Return Data As An Array?

Oct 15, 2009

I have an xml file (externally saved) that is similar to the following:

[root]
[main]
[title]...[/title]

[Code]....

What I like to do is to get what's in [title] tag using HTTPservice, import it into Flex, and save it as array objects, and do the same thing for [content]. This way I can later refer the array object saying title[0] or content[2].

View 1 Replies

ActionScript 3.0 :: Sample Data Event Not Firing - Record Data From A Microphone To A Byte Array?

Dec 13, 2010

I have bought Learning AS 3.0 (O'Reilly) but I have been having difficulty getting one of the tutorials to run. The tutorial shows how to record data from a microphone to a byte array, playback the saved data and save as a WAV file. For some reason, I can't get this working. When the swf runs, the Flash Settings screen doesn't pop up to request permission to access the microphone but I can still trace properties such as gain.

I've uploaded a zip containing all the classes and an FLA - just use RecordMicrophone_Example.as file as the document class. Here is the problematic area of the code:

[Code]....

View 0 Replies

Data Integration :: Instead Of The Vertical List , Get An Unparsed Data Array?

Jul 20, 2006

I have No problems inserting data from flash to PHP into MySQL,it's sendind them back properlly.All I'd like to see happen is for one row of data to be inserted into a dynamic text field. here's what i've got if i access this php file, it prints out a vertical list from
a single MySQL row,I was happy.

$query = "select row from table";
$result = mysql_query($query, $db);

while($row = mysql_fetch_row($result))[code]...

and Instead of the vertical list (which i would love to see)i get an unparsed data array.

View 2 Replies

Flex :: Data Grid Not Displaying Data In Array Collection?

Oct 7, 2010

My data grid is displaying stale data, rather than the real time data available in it's data provider (array collection). I've tried refeshing the data in the collection, but that has no effect. Below is my code, does anyone see what could be the problem?

<mx:Accordion/>
<fx:Script>
<![CDATA[[code].....

View 4 Replies

ActionScript 2.0 :: Converting Internal Array Data Into External XML Data?

Nov 9, 2006

I have this code inside my flash to name my navigation menu. Now I want to put this outside flash and load it via XML. How do save my different arrays into a variable for later use in my code?

In my nav fla (what i want to load from XML):

Code:
// MAIN MENU ARRAY
var mm_array:Array = ["MAIN1", "MAIN2", "MAIN3", "MAIN4"];
// SUB MENU ARRAY

[Code]...

View 9 Replies

Html :: Flex - Export Array (array Collection) Data Into A Table Or Text File?

Oct 9, 2010

I have an array collection of strings and integers (which I have displayed in a data grid) and I am wondering if it is possible to export the array collection into an html table? or even a text file for the user to download

I found some pages that had an export to .xls files but I want to stray away from that for now.

View 1 Replies

Professional :: Dataprovider SortOn Not Accurate Over 100?

Sep 30, 2010

I've used the sortOn function (dp.sortOn("cost");) to sort my dataprovider values based on cost. It works great until I get values over 100. Then it thinks that 250 < 50.

View 2 Replies

ActionScript 3.0 :: Using SortOn() With Private Properties?

Sep 23, 2010

Is there a way to use the sortOn() method of the Array class to sort an array of objects by a private property?I've tried using a getter function, but Flash didn't like it.It doesn't seem right to leave a property as public, but the sortOn() method is very handy -

View 4 Replies

ActionScript 2.0 :: Using SortOn With Date Objects?

Aug 1, 2007

I have a multidimensional array where the items have Date objects. I 've tried to use Array.sortOn(myDate) with no success. Do I have to convert the Date to a string (like 20070731) to use sortOn correctly?

View 1 Replies

Data Integration :: Get Rid Of The Xml Tags With Assigning The Data To An Array?

Feb 5, 2007

Let's say you have the following xml document. Now how do I access the name thumb here is my loop. Also I want to store the value in an array but I don't want the xml tags to be stored in there as well. How do I get rid of the xml tags with assigning the data to an array.

View 1 Replies

Actionscript 2.0 :: Converting Array Data Into Numeric Data?

Mar 25, 2009

I feel like this should be really easy, but I don't get what I need to do.I have a value bgW[j] stored in "j" equaling a number.But I can't seem to get it to register as a number.What commonly needs to happen to convert this value into a numeric datatype?I've tried a bunch of stuff: eval, parseInt, multiplying it by 1.

View 2 Replies

Use Either Maintaining Movieclip Array Or Bitmap Data Array?

Jun 5, 2009

I am working on a project in which I am suppose to matain an array of movieclips, and I can also convert the movieclips into bitmap data. so I would like to know which one is the best to use either maintaing movieclip array or bitmap data array.

View 2 Replies

ActionScript 3.0 :: Error #1006: SortOn Is Not A Function

Aug 30, 2009

While I was finishing the details of the carousel from my last thread another error occured which i cant remove :

ActionScript Code:
TypeError: Error #1006: sortOn is not a function.
at circle_of_buttons_fla::MainTimeline/enterFrameHandler()

The whole day almostly i was trying to figure it out but I couldn't so i will be grateful if someone can help

[Code]...

View 1 Replies

ActionScript 2.0 :: SortOn() Multiple Fields With Different Options

Feb 12, 2005

I get the feeling this problem is anything but complex, but I can't seem to pull it off.

I have an array that contains search results and looks like this:

array[x].id :Number
array[x].sectionID :Number
array[x].occur :Number
array[x].title :String
etc...

I want to sort it by sectionID ASC and occur DESC (occurances). What I read in the documentation is that I can sort on multiple fields like so:

array.sortOn(["sectionID", "occur"], options);

But I need to specify different options for each fieldName while it seems the function only allows for one set of options.

View 8 Replies

ActionScript 2.0 :: Sort With Xml Node Attributes ( With SortOn() )

Apr 27, 2009

I have xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<articles>
<entry datumNum="20090420" date="20/4/2009" id="1">
<title>Some title</title>

[Code]....

I would like to sort xml nodes using attribute datumNum, but I can't get it to work. Don't know how to pass attribute to sortOn function before the for loop.
Note that there is maybe a error in xml parsing code here, because I tried to be as short as I can.

View 3 Replies

IDE :: Flash SortOn Function Not Working Properly?

Dec 6, 2009

Code:
var vendor_arr:Array = new Array();
//vendor_arr.push(new Array());
var level1:Array = new Array("yelp","yelp","yelp","yelp","yelp","yelp");
var level2:Array = new Array("a","b","c","d","e","f");
var level3:Array = new Array(12,14,7,2,11,24);
[Code] .....
Why is it not sorting on "bdistance" ?? its returning 2, 14, 7, 12, 11, 24... what kind of sorting is this??

View 1 Replies

ActionScript 3.0 :: Flash SortOn Messing Up Arrays

Feb 24, 2011

I'm using the .sortOn() function in AS3.0 to sort an array with multiple elements.First, I push the values to the array, like this:[code] The program has a number of "loops" it goes through. So, I push data to this array (which is global) a first time, sort it, and then later I clear the array with the .shift() function in conjunction with a for loop. I then push new data to the array with the same line of code mentioned above.But what's happening is this: on the first round, everything works great, and this is what my output looks like:[code]Before I cleared the array with for loop and .shift(), it would say "Northern Alberta & Prairies" in ALL array slots. Since I started using the .shift() function I managed to get BC to remain, but it's still clearing my southern alberta entry.

View 2 Replies

ActionScript 2.0 :: SortOn() Multiple Fields With Different Options?

Feb 12, 2005

I have an array that contains search results and looks like this:

array[x].id :Number
array[x].sectionID :Number
array[x].occur :Number
array[x].title :String
etc...

I want to sort it by sectionID ASC and occur DESC (occurances). What I read in the documentation is that I can sort on multiple fields like so:

array.sortOn(["sectionID", "occur"], options);

But I need to specify different options for each fieldName while it seems the function only allows for one set of options.

View 9 Replies

Switch Language To English?

Jun 6, 2009

I installed the new Flash Builder.Does anybody know how to switch the language to english?Looks like the installer installs eclipse in the langauge of the os.in my case that was german.I know you can change the language for FlashBuilder in Windows by editing one of the dll's. How to get the same result on MacOs?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved