Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
actionscript sortOn i èæ¾¹ð

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Flash
View previous topic :: View next topic  
Author Message
nemogirl



Joined: 27 Oct 2004
Posts: 386
Location: istra

PostPosted: 14.08.2008 12:08    Post subject: actionscript sortOn i èæ¾¹ð Add user to your forum ignore list Reply with quote

imam niz koji sortiram po "nazivu". neki nazivi poèinju sa èæ¾¹ ili ð i naravno na kraju su sortirane liste.

Code:
niz.sortOn("naziv");


ima li netko neku jednostavnu ideju kako da sortiram niz tako da mi sla¾e po hrvatskoj abecedi? Shocked

hvala Very Happy
Back to top
View user's profile Send private message
hrvoje_86



Joined: 06 Dec 2006
Posts: 107
Location: Zagreb

PostPosted: 16.08.2008 14:47    Post subject: Add user to your forum ignore list Reply with quote

Code:
// neki niz
var slova:String = "cCgfhmvjlretop¹©æèæð¾abcÈƮЩDFGDSG"
var niz:Array = new Array()
for(var i:int = 0;i<slova.length ;i++){
   niz[i] = slova.charAt(i)
}

niz = zamjeniSlova(niz)
// Sortiraj
niz.sort(1)

niz = vratiSlova(niz)
 
slova = niz.join()
feedback.text= slova

// funkcije
//zamjeni slova
function zamjeniSlova(niz){
for( i = 0;i<niz.length ;i++){
   var str:String = String (niz[i])
   str = str.replace(/Æ/,"Cxx")
   str = str.replace(/æ/,"cxx")
   str = str.replace(/È/,"Cx")
   str = str.replace(/è/,"cx")
   str = str.replace(/©/,"Sx")
   str = str.replace(/¹/,"sx")
   str = str.replace(/Ð/,"Dx")
   str = str.replace(/ð/,"dx")
   str = str.replace(/®/,"Zx")
   str = str.replace(/¾/,"zx")
   niz[i] = str      
   }
   return niz
}
// vrati slova
function vratiSlova(niz){
for( i = 0;i<niz.length ;i++){
   var str:String = String (niz[i])
   str = str.replace(/Cxx/,"Æ")
   str = str.replace(/cxx/,"æ")
   str = str.replace(/Cx/,"È")
   str = str.replace(/cx/,"è")
   str = str.replace(/Sx/,"©")
   str = str.replace(/sx/,"¹")
   str = str.replace(/Dx/,"Ð")
   str = str.replace(/dx/,"ð")
   str = str.replace(/Zx/,"®")
   str = str.replace(/zx/,"¾")
   niz[i] = str
   }
   return niz
}


Credits ==> http://www.mi3dot.org/forum/viewtopic.php?t=10061
kralj Very Happy
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
nemogirl



Joined: 27 Oct 2004
Posts: 386
Location: istra

PostPosted: 19.08.2008 11:02    Post subject: Add user to your forum ignore list Reply with quote

thnx a bunch! Very Happy
super radi uz malo dorade Smile
pro¹irila sam String klasu

Code:
String.prototype.replace = function(zamijeni, zamjenik) {
var temp_array = this.split(zamijeni);
return temp_array.join(zamjenik);
};


i popravila sintaksu tvog koda... Razz
Code:
str = str.replace("Cx","È");


i radi ko bonbon Very Happy

hvala i hvala mihaelu i njegovom prijatelju!!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Flash All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group