Copy link to clipboard
Copied
hi i used a password generator from a website flashkit.com, the code is as follows, but kicks out different variable ranging from 1 then 2 then 3 then 1 and is not constantly kicking out seven , can someone help me to change it please.
function newPassword(){
var totalChar = 7; // number of chars in the password
var salt = "abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789"; // salt to select chars from
var saltLength=salt.length;
var userPass=""; // set the inital variable
for (var xx=0;xx<totalChar;xx++){ // loop and create password
userPass+=salt.charAt(Math.floor(Math.random()*saltLength));
}
return userPass;
}
button1.onRelease=function(){
fred.text=newPassword();
}
Copy link to clipboard
Copied
Hi.
It always generates a password with 7 chars for me.
Please double-check if your text field is big enough to display 7 chars.
Regards,
JC
Copy link to clipboard
Copied
hi i increase the size and put the border off, and still doesnt,
Copy link to clipboard
Copied
this above is a picture with the border on.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
you ill give it look at now.
Copy link to clipboard
Copied
i just looked and downloaded it, im using adobe 5.5, and the file wont open up cause its created in adobe 6.
Copy link to clipboard
Copied
There it goes:
Copy link to clipboard
Copied
thank you ill give it a look at now.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
sorry i think i might have adobe cs5
Copy link to clipboard
Copied
yip i checked it im on cs 5
Copy link to clipboard
Copied
OK. Let's try again:
Copy link to clipboard
Copied
thank you ill give it a look at.
Copy link to clipboard
Copied
It works 100% thank you. ive never used a radio button before and am wanting to know does it differ in script from a regular button ?
such as a_btn.onRelease = function(){
does a radio function use onRelease ?? if its instance name is a_btn what is the code that can be used on a radio button before the = function(){ ?
Copy link to clipboard
Copied
That's great!
Here is a reference that may help you:
Flash CS4 Professional ActionScript 2.0
If you Google "as2 radio button" you'll find many resources on this subject.
Copy link to clipboard
Copied
thank you very much.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now