Home > Adobe Flash, Adobe Flex > Flex Random Password Generator

Flex Random Password Generator

Here’s a nice static method for creating random passwords…should the need ever arise ;)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public static function generateRandomPassword( length:int = 7 ) : String
{
	//characters to use in password
	var _salt : String = "abchefghjkmnpqrstuvwxyz0123456789ABCHEFGHJKMNPQRSTUVWXYZ";
 
	//initialize vars
	var _password : String = '';			
	var _i:Number = 0;
 
	//loop 
	while ( _i <= length )
	{
		var _num : Number = Math.random() * _salt.length;
		_password += _salt.charAt( _num );
		_i++;
	}
 
	return _password;
}

Enjoy!

Categories: Adobe Flash, Adobe Flex Tags:
  1. james
    June 27th, 2010 at 19:04 | #1

    hi there

    thanks for the code.

    i have tried this but it does not seem to work. nothing is displayed. even when i put trace(_password) immediately after line 18.

    i am using flash builder and i created a new project and pasted this code. i also put the creationComplete= “generateRandomPassword()”

    i bet im doing something wrong. can you please provide some hints? im a newbie. :)

  2. July 1st, 2010 at 07:08 | #2

    Nice Tips!!
    Its a Very Important program , i used it in my Project!!
    thanks

    Affordable Website Designing

  3. Will
    July 10th, 2010 at 19:16 | #3

    Nice. Couple suggestions:

    I’m not sure ‘salt’ is the right name for that variable. It’s more of a list of potential characters; ‘salt’ implies that some sort of cryptographic operation is going on.

    I see you took out some characters to avoid confusion; I’d take out more. I’d removed all the vowels, so you don’t accidentally generate rude words, and I’d also take out the number ’1′, which can easily be confused with the lower case ‘L’ in some fonts. (I know you don’t have the lowercase ‘L’ in the potential characters, but the user won’t know that when they’re staring at their generated password).

  4. August 11th, 2010 at 00:01 | #4

    @james
    The problem why u were not seeing the trace statement is, because the statement was after the return code. Try putting the trace before the return command. Also the ‘generateRandomPassword’ function returns the password of datatype string, so try assigning it to a variable to use it. Just using creationcomplete=’generateRandomPassword is useless

  5. September 12th, 2010 at 14:01 | #5

    Great code and very useful too. Thanks Erich!

  6. January 22nd, 2014 at 09:19 | #6

    I like the worthwhile facts you actually deliver for the articles. We’ll bookmark your blog site as well as consider yet again in this article on a regular basis. I am sensibly certain I am going to study a number of fresh stuff appropriate in this article! All the best . for the!

  7. January 26th, 2014 at 07:03 | #7

    Hello, for all time i used to check weblog posts here in the early
    hours in the morning, because i like to learn more and more.

  8. March 8th, 2014 at 22:38 | #8

    It is in point of fact a nice and helpful piece
    of info. I am glad that you shared this helpful information
    with us. Please keep us up to date like this.
    Thank you for sharing.

  9. March 9th, 2014 at 16:40 | #9

    Wow, amazing blog layout! How long have you been blogging for?
    you made blogging look easy. The overall look of
    your web site is magnificent, let alone the content!

  10. March 23rd, 2014 at 18:44 | #10

    Pretty! This has been a really wonderful post.
    Thanks for supplying these details.

  11. March 29th, 2014 at 01:47 | #11

    Hello there! Would you mind if I share your blog with my myspace
    group? There’s a lot of folks that I think would really appreciate your content.
    Please let me know. Thanks

  12. March 29th, 2014 at 05:16 | #12

    whoah this weblog is fantastic i really like reading your posts.

    Keep up the great work! You realize, a lot of
    persons are hunting round for this information, you could help them greatly.

  13. March 30th, 2014 at 18:19 | #13

    I do not even know the way I stopped up here, however I assumed this put up used to be
    great. I don’t know who you are however definitely you are going to a well-known blogger in the event you are not already.
    Cheers!

  14. April 2nd, 2014 at 14:42 | #14

    What’s up, I wishh for to subscribe for this webpage tto
    get most recent updates, therefore wherte can i do it please help out.

  15. April 7th, 2014 at 12:19 | #15

    Great post. I used to be checking continuously this weblog and I am inspired!
    Very helpful information specially the ultimate section :
    ) I handle such information much. I was seeking this certain
    information for a very long time. Thank you and good luck.

  16. April 9th, 2014 at 23:31 | #16

    Hi everybody, here every one is sharing these familiarity,
    therefore it’s pleasant to read this weblog, and I used to pay a visit this blog every day.

  17. April 9th, 2014 at 23:39 | #17

    Post writing is also a excitement, if you be familiar with afterward you can write otherwise
    it is complex to write.

  18. April 19th, 2014 at 13:19 | #18

    Write more, thats all I have to say. Literally, it seems as though you relied
    on the video to make your point. You definitely know what youre talking about, why waste your intelligence on
    just posting videos to your weblog when you could be giving us something informative to read?

  19. April 21st, 2014 at 10:58 | #19

    Thanks for the marvelous posting! I really enjoyed reading it, you’re
    a great author.I will be sure to bookmark your blog aand will often come back later in life.

    I want to encourage you to ultimately continue your great job, have a nice weekend!

  20. April 24th, 2014 at 23:56 | #20

    I am really impressed with your writing abilities and also with the format for your weblog.

    Is that this a paid theme or did you customize it yourself?

    Either way stay up the nice quality writing, it’s rare to peer a nice weblog like this one nowadays..

  21. April 25th, 2014 at 18:48 | #21

    There is a high correlation between people who smoke and hypertension.
    There are many people all around the world who are willing to lower their higher blood pressures though they are unable to do
    it as they are not very well aware of the mind power.
    This shows that the body fat of Gynostemma tea have positive transformation in vitro.

  22. April 27th, 2014 at 23:02 | #22

    Good answers in return of this issue with firm arguments and telling the whole thing about that.

  23. May 3rd, 2014 at 01:38 | #23

    I am sure this article has touched all the internet visitors, its
    really really pleasant paragraph on building up new webpage.

  24. May 16th, 2014 at 07:20 | #24

    Pretty component to content. I just stumbled upon yojr site aand in
    accession capital to assert thwt I acquire actually enjoyed account your weblog
    posts. Anyway I’ll be subsxribing in your feeds or
    even I success yoou get admission to consistently rapidly.

  25. May 17th, 2014 at 12:50 | #25

    Very rapidly this web page will be famous among all blogging and
    site-building viewers, due to it’s pleasant articles
    or reviews

  26. May 18th, 2014 at 16:48 | #26

    It’s really very complicated in this active life to listen news on Television, so I
    just use web for that purpose, and get the
    most up-to-date news.

  27. May 19th, 2014 at 04:52 | #27

    whoah this blog is great i really like studying your
    articles. Keep up the great work! You recognize,
    lots of people are looking around for this info, you can aid them greatly.

  28. May 20th, 2014 at 14:07 | #28

    Whenever you want to buy or build a bird house
    you have take into account a few factors like whatever your plans, always use raw wood to make a birdhouse.
    By taking advantage of the latest computer technology this product has compiled enough projects to fill
    many bookshelves. Perfect if you want to be able to use
    the boat inside waters.

  29. May 20th, 2014 at 18:06 | #29

    Perhaps you have made use of by obtaining the Crazy shirts Coupon Code just to identify that
    you can not utilize this more affordable it offers?
    Anyone whom vendors on the internet uncomplicated
    Crazy shirts Coupon Code would certainly’ve expert this trouble.

    These kinds of Crazy shirts Coupon Code will often be
    extremely valued just by net purchasers thinking about
    that they make them end up being problems along with proficiency describing essential earnings.

    You could stay clear of almost any type of troubles along with making use of a Crazy shirts Coupon Code has to you understand they will to
    make essential strategies instead of they will. A bunch of the issues totally
    eaten with the assistance of customers consist of:.

    Obtaining the done Crazy shirts Coupon Code: The majority
    of Crazy shirts Coupon Code use an event time-frame all
    over that they could possibly stop used to obtain a more budget-friendly price or simply just useful
    strategy. Together, an added person instead back
    could possibly acquire arbitrary using your Crazy shirts Coupon Code that include passed her expiration day when your business have actually never deactivated this
    sort of decline.

    Not necessarily looking into the Crazy shirts Coupon Code completely.
    Before choosing to what exactly sort of Crazy shirts Coupon Code have to be made use of any person effectively can well aren’t enjoyed uncovered discover the most from making use of.
    You could not believe essentially all Crazy shirts Coupon Code supply an established lesser.

    Falling obtaining a certain Crazy shirts Coupon Code. On the other hand, you can utilize software application applications
    keeping to the real Crazy shirts Coupon Code to ensure that you
    could utilize them in spite of the reality that essential.

    You can have a massive quantity wonderful supplies of money on a routine month-to-month
    basis using the ideal Crazy shirts Coupon Code
    when you are obtaining online. Obtaining
    this sort of Crazy shirts Coupon Code could possibly not be simple.

    Have to be fact, you’re most likely to be spending great deals of objective looking for
    people Crazy shirts Coupon Code.

    You have to recognize utilizing Crazy shirts Coupon Code in the responsible
    technique or perhaps you do uncover youself to get spending a more considerable cost for any person possibilities.
    It does not produce just due to the fact that to
    recognize an instead a lot of aspects being made easily
    offered with a little asking price as a result of Crazy shirts Coupon Code.

    Possibly you have taken advantage of by obtaining the Crazy shirts Coupon Code just to acknowledge that you can not utilize this more cost-effective it offers?
    Since they make them become concerns along with proficiency associating with appropriate earnings, these sort of Crazy shirts Coupon Code
    will often be very appreciated simply by internet purchasers.

    Getting the done Crazy shirts Coupon Code: A lot of Crazy shirts Coupon Code utilize a party time-frame across that they may
    quit utilized to obtain a much more cost effective expenditure or merely just useful technique.
    Prior to deciding to what specifically sort of Crazy shirts Coupon Code need to be used anyone
    very well could well aren’t thrilled to discovered discover the most from taking advantage of.

    Potentially you have made use of by acquiring the Crazy shirts Coupon Code simply to identify that you
    can not use this more economical it gives? These types
    of Crazy shirts Coupon Code will generally be incredibly
    valued just by internet buyers considering that they
    make them wind up being problems together with knowledge referring to essential profits.

    Before preferring to what precisely type of Crazy shirts Coupon Code need to be used anyone effectively can well aren’t
    thrilled to found out find the most from utilizing.
    You can have a big amount wonderful offers of money on a routine month-to-month basis making use
    of the ideal Crazy shirts Coupon Code when you are getting online.

    Possibly you have utilized by obtaining the Crazy shirts Coupon Code simply to acknowledge that you can not use this
    more affordable it offers? These kinds of Crazy shirts Coupon Code will often be quite
    valued just by web buyers taking into consideration that they make them end up being troubles
    in addition to know-how referring to essential incomes.

    Prior to selecting to what specifically kind of Crazy shirts Coupon Code must be
    made usage of any sort of individual successfully could well aren’t thrilled to uncovered discover the most from making usage of.
    When you are obtaining online, you can have a big amount
    terrific supplies of money on a regular month-to-month basis making use of the ideal Crazy
    shirts Coupon Code.

  30. May 21st, 2014 at 00:40 | #30

    It may seem like reconciliation is right around the corner and that you’re only a few messages away from jumping back into his arms.
    Flyers and posters have been placed on the east side and downtown areas of Spartanburg.

    Perfect if you want to be able to use the boat inside waters.

  31. May 21st, 2014 at 22:11 | #31

    Many of us have made the life changing decision to live
    in Cyprus  in a villa, in a town house or in one of the stylish apartments
    in Cyprus. Major park rides and attractions make the evening unforgettable.
    They have decided to rent them out as long term lets on yearly renewable contracts to earn an income
    whilst they are not using themselves.

  32. May 25th, 2014 at 13:19 | #32

    I’ve read a few just right stuff here. Certainly value bookmarking for revisiting.
    I wonder how a lot effort you set to create any such wonderful informative
    web site.

  33. May 26th, 2014 at 21:04 | #33

    Thank you for any other informative blog. The place else could I get that type of info written in such an ideal manner?
    I have a challenge that I’m just now working on, and I’ve been at the
    look out for such info.

  34. June 13th, 2014 at 21:30 | #34

    Please let me know if you’re looking for a author for your
    blog. You have some really good articles and I believe I would be a good asset.
    If you ever want to take some of the load off, I’d
    love to write some articles for your blog in exchange for a link back to
    mine. Please blast me an email if interested.
    Cheers!

  35. June 15th, 2014 at 22:51 | #35

    Wow, that’s what I was looking for, what
    a information! existing here at this website, thanks
    admin of this website.

  36. June 15th, 2014 at 23:44 | #36

    You have made some decent points there. I checked on the internet for more information about the
    issue and found most individuals will go along with your views on this web site.

  37. June 19th, 2014 at 03:18 | #37

    Hi there everyone, it’s my first visit at this website,
    and post is actually fruitful designed for me, keep up posting these posts.

  38. June 22nd, 2014 at 07:11 | #38

    Great article! We are linking to this particularly great article on our
    website. Keep up the grewat writing.

  39. June 23rd, 2014 at 08:24 | #39

    If you are going for bbest contents like me, simply visit this web page alll thhe timme because
    itt presents feature contents, thanks

  40. July 16th, 2014 at 07:27 | #40

    I had an old business plan for this, my brother had an idea similar, licensing
    a major brand like Starbucks which I think is the best one and calling it Jumping Java
    or some other cool name. Typical stressor:
    required to attend class but am physically needing to rest (3 week flu and a presentation to
    make or flunk the class, exhaustion right before
    finals, etc). The actual and accurate information using a computer can be adopted and effective.

  41. July 18th, 2014 at 13:12 | #41

    The credit card with chocolate sample appears to be the most scrumptious 1.
    It perceives or a challenge to make out info and make
    a declaration with reference to what has been discovered.

  42. August 9th, 2014 at 10:25 | #42

    An interesting discussion is definitely worth comment.
    I believe that you need to publish more on this issue, it might not be a taboo matter but usually folks don’t talk about such issues.
    To the next! Many thanks!!

  43. August 24th, 2014 at 08:22 | #43

    wonderful points altogether, you just won a emblem new reader.
    What would you recommend in regards to your
    post that you simply made a few days in tthe past?
    Any positive?

  44. August 24th, 2014 at 13:09 | #44

    Riɡht away I am going to do my breakfast, later than ɦaving my breakfast сoming again to read addigional news.

  45. October 3rd, 2014 at 19:29 | #45

    Many thanks for this site, can blissfully
    announce we currently have a steam shower of our own and we love it

  46. October 23rd, 2014 at 19:35 | #46

    Como habrás notado, me he quedado leyendo hasta el último de los artículos que escribiste.

    Espero que esto te sirva como motivación de que estás haciendo un trabajo muy bueno.
    A nivel personal, soy amante de los buenos textos y me gusta proseguir
    a las personas que poseen las habilidades de hacer llegar experiencias por medio de las palabras.
    Por este motivo te dejo este comentario y para cerrar quisiera decirte que me ha encantado poder llegar a tu sitio.
    En hora buena!

  47. November 6th, 2014 at 10:19 | #47

    Pain & Inflammation Relief: 3 drops of Chamomile + 3
    drops of Hyssop + 2 drops of Cypress. See others clearly without making
    excuses for their behavior. The more crystals an individual can wear, the more positive energies she can have working for her.
    Let him call for the elders of the church,
    and let them pray over him, anointing him with oil in the name of The
    Lord; and the prayer of faith will save the sick man, and The Lord will raise him up; and if he has committed sins,
    he will be forgiven. There have been numerous studies to prove its existence, with some success and with some disappointments.

  48. November 9th, 2014 at 18:58 | #48

    For the reason that the admin of this website is working,
    no doubt very quickly it will be famous, due to its feature contents.

  49. November 17th, 2014 at 03:51 | #49

    The same exact packaging as the brands indicates that you’ll get an authentic product.

    This one can be a tricky and tough one because we can talk ourselves
    into JUST about anything (the power of persuasion) and if you’ve not had
    to experience living on a budget before it might take you a few months to understand that discipline takes work.
    With 18 locations in the DFW area, and an inventory
    that differs from store to store, Half Price is a Dallas booklover’s dream.

  50. December 11th, 2014 at 14:47 | #50

    Dabei gilt es das Gewicht optimal zu verteilen und ruhig zu atmen um Schmerzen beim Liegen zu
    vermeiden.

Comment pages
1 2 3 439
  1. No trackbacks yet.