See Related Forum Messages: Follow the Links Below to View Complete Thread
User Login And Password
Could somebody tell me how I might validate a username and password using flash? Nothing complex, just something that verifies if the entered values are the same as the defined values.
I know how to make an input field, but I dont know how to submit, and I dont know enough actionscript to make a validating function.
Thanks for any help.
User Name And Password Login Help
How can I make the user text and the password input text work together for a a log in page in AS 3.0
the input text instance for username = user_txt
input text instance for password = pass_txt
enter button instance name = enter_btn
code is here but not working, I don't know what I am doing wrong.
Code:
/*We need to add variables for the Users and Passwords*/
//var for users
var users:Array=[
"todd",
"erick",
"jimmy",
"jon"
]
//var for password as well
var pass:Array=[
"6998",
"4554",
"6558",
"4778"
]
/*Event Button For User Name And Pass Word Enter*/
//enter button event listener
enter_btn.addEventListener(MouseEvent.CLICK, onClick);
//function
function onClick(event:MouseEvent):void
{
//user a for loop
for (var i1:Number = 0; i1<users.length; i1++);
for (var i2:Number = 0; i2<pass.length; i2++);
{
if(users[i1]==user_txt.text){
trace("Access Granted");
}
else if (pass[i2]==pass_txt.text){
trace("Access Granted");
}
}
}
Needcoding Help Bad.. Button To Input Text/ Login-Password Box
Brief Statement:
I'm currently in the process of creating an advanced member login to my new website. I'm fairly new to the web lingo and creation world. I know ALOT (Technical) about computers but quite frankly know jack squat about web development, creation, and design. I am however starting to grasp onto Studio MX rather fast, especially Flash. So this is only for peeps who know a fair deal about flash and dreamweaver and are willing to help a newbie create a fairly advanced website.
Brief Project Specs:
Sorry no pictures at the time so this project is not for the visually illiterate...
Ok first the user will goto the members link on the menu (main site). When they get there a small number pad will appear (Blue semi-transparent artfully designed box like the number pad). They can either type in the 6 digit numeric code or punch it in via mouse click and press or click enter.
There will be 3 levels:
-Members
-Site Tech/Employees
-Site Manager
each with a static code (non-changing per user)
that must be typed.
ex.
Level 2 Clearance: 532840
Level 3 Clearance: 297543
Level 4 Clearance: 324095
if they enter the wrong code an Access Denied screen (red semi-transparent artfully designed box like the number pad) will appear and will automatically forward them back to the main page in 2 sec.
if they enter the right code an Access Granted screen (green semi-transparent artfully designed box like the number pad) will appear and will automatically forward them to their particular level clearance in 2 sec.
after they get pass the number pad
an additional login screen will appear
asking for their individual login id and password
each login screen will be color coded according to access level
ex:
Member (orange semi-transparent artfully designed box like the number pad)
Site Tech/Employee (yellow semi-transparent artfully designed box like the number pad)
Site Administrator (purple semi-transparent artfully designed box like the number pad)
if they enter the wrong code an Access Denied screen (red semi-transparent artfully designed box like the number pad) will appear and will automatically forward them back to the main page in 2 sec.
if they enter the right code an Access Granted screen (green semi-transparent artfully designed box like the number pad) will appear and will automatically forward them to their particular level clearance site page in 2 sec.
lastly this will all be on a black background webpage.
I will create all this stuff, I already now how to create the graphics such as the boxes.
I have already created the number pad with the buttons and the numeric password box but now i need to know how to make the number buttons on the pad input thier respective number in the numeric password box by mouse click. In additon the buttons light up when u click on them. I would also like to make the option of simply typing the numbers in and as there being typed in the buttons act as if they were being clicked by the mouse.
I hope all this stuff isn't too hard. Trust me i believe i'm making it sound harder than it is, simply cuz i've done most all the animated graphic designs but none of the Action script. I know a lil bit about computer programming. If u r interested in helping me and wish to see what i've gotten accomplished e-mail me a JazzkidPhD@yahoo.com
P.S. i normally don't talk this much, lol, but felt i should compensate text for not having pics. Also the site itself has not been built yet so ne parts of the code that need the site inputed will just have to be left blank. (ex. code code code "XX")
Problem With Comparing User Input For Password
Hello viewers of this thread! I'm new to this flash/actionscript stuff and I'm running into a problem that perhaps someone can help me out with. Here is the code and the problem:
_global.password1 = inputPass1;
if (_global.password1 == "60312") {
inputPass1 = "Data Correct";
} else {
inputPass1 = "Incorrect Data";
}
stop();
-I'm creating a scene where a user types a password into an input text field with the variable "inputPass1"
-After clicking a submit-type button, the timeline moves to the next frame, where it stores the variable in a global variable (_global.password1) and then goes through an if statement that converts the original variable into either a "correct" or "incorrect".
-In the frame with the if state, the text fields are dynamic, and are supposed to display whether the user's input was correct or not.
-The problem I'm having is that the variable always comes back as "incorrect" unless I set (_global.password1 == "") for the if statement and do not enter any text when I submit.
-I've also changed the dynamic text box variable to display _global.password1 instead, so I know the global password is assigned the correct input.
Any ideas on why its not matching up the global password w/ the same input and coming back as "correct"?
Any help is greatly appreciated!
Capturing User Input Restricted To Just Numbers?
I’ve written a function that restricts user input to just numbers (0-9,.) and stores the input in the associative array, userInput[]. It works but seems inefficient looping through the entire input text string to scrub out invalid characters. Anyone have suggestions for a more efficient approach? Note that a working solution must correctly process mouse or cursor key movements/edits within the input box.
Also, you can see I’m using the KeyboardEvent.KEY_UP event to trigger the processing. The docs seem to indicate TextEvent.TEXT_INPUT is really the proper event for this purpose. I started with TextEvent.TEXT_INPUT but found the event is triggered before the last key pressed is actually added to the instance. The result is that the function was always one character behind. Is there an easy way to get the current text in the input box, including the last key pressed, when processing TextEvent.TEXT_INPUT?
Attach Code
someTextInputInstance.addEventListener(KeyboardEvent.KEY_UP,numInputCapture);
//--------------------------------------------------
function numInputCapture(e:KeyboardEvent):void {
var myTargetName:String = e.target.name;
var myTargetText:String = e.target.text;
var numChars:Array = ["0","1","2","3","4","5","6","7","8","9"];
userInput[myTargetName] = "";
for(var i:uint = 0; i < myTargetText.length; i++){
var testChar:String = myTargetText.charAt(i)
if (numChars.indexOf(testChar)>-1) {userInput[myTargetName]=userInput[myTargetName]+testChar};
if ((testChar==".")&&(userInput[myTargetName].indexOf(".")<0)) {userInput[myTargetName]=userInput[myTargetName]+"."};
};
e.target.text = userInput[myTargetName];
};
XML To Load .swf If USERNAME & PASSWORD Are Correct?
how can i make this code load a swf into a container clip if username & password are correct in an XML file?...
code:
// create object load the xml
var my_xml = new XML();
my_xml.ignoreWhite = true;
// when it loads
my_xml.onLoad = function(ok) {
if (ok) {
// parse the xml
temp_xml = this.firstChild.childNodes;
temp_xml_n = temp_xml.length;
for (var i = 0; i < temp_xml_n; i++) {
// check if username and password match
if (username == temp_xml[i].attributes.name && password == temp_xml[i].attributes.pass){
// as they match, get the frame number from the xml
myFrame = temp_xml[i].attributes.frame;
break;
}
}
// no match
if (myFrame == undefined) {
trace("wrong username or password");
}
// it matched
else {
trace("validated!");
trace("now I can move to frame " + myFrame);
}
}
delete myFrame;
};
// input text field:
password_txt.password = true;
//
//
submit_btn.onRelease = function() {
// get the text in the text fields
username = username_txt.text
password = password_txt.text
// time to verify
my_xml.load("details.xml");
};
The XML file looks like this:
code:
<details>
<user name="joe" pass="joepass" frame="1" />
<user name="john" pass="johnpass" frame="2" />
<user name="simon" pass="simonpass" frame="3" />
</details>
The only change (i think) that needs to be made in the XML is that instead of loading a frame #....i want to load swf files.....such as agent1.swf, agent2.swf, agent3.swf, etc.
also.... for some reason i can't AUTOFORMAT the ActionScript above......i keep getting a message that there are syntax errors that need fixing, but when i check the code, i get a message that this script contains no errors???? any ideas??
ANY HELP is appreciated.... TIA
Password (or Correct Answer) In Flash 5
I'm making a part of the game where there is a question, an input text box, and a submit button. I know about buttons and text boxes and stuff.
How do I make it so that if you type the correct thing it takes you one frame but if it's wrong it takes you to another? (like a password, almost) I sort of know how to do this with numbers, but I'm not sure if it will work for letters too. Help is very much appreciated
Right now I'm using
Quote:
on (release) {
if (_root.text == 1) {
gotoAndStop (2);
}
}
but that only works with numbers. I've tried with numbers and letters. How do I make that type of code work for letters?
Login Password Box
hey all i need some help,
i wanna make a certain part of my project only for people that have the loginpassword to be able to see it. please help me out
Password And Login
i have created a password and login "thing".
in the first frame is two input textfields (login & password) and a button that has the script:
on(release)
if(login eq "User" and password eq "secret")
gotoAndStop(2)
else
gotoAndStop(3)
frame 2 says "connecting to site..." and has the script:
getURL (C:webpagehome.html, _parent)
frame 3 says "wrong, try again" and has a back button that contains the script:
on(release)
gotoAndStop(1)
how can i add multiple login and passwords successfully without it screwing up or being able to mix-n-match the login and passwords
Login & Password
I want to create a log in and password together. Does anyone know what I’m missing
Here is what I did:
on (release, keyPress "<Enter>") {
if (pw.toUpperCase() eq "ASDF") {
if (un.toUpperCase() eq "ASDF") {
gotoAndStop("cleared");
} else {
gotoAndStop("declined");
}
}
}
but, if one or both of the fields are incorrect it does not stop at “declined”
is the answer right in front of my face?
Any help would be appreciated.
Please post answer here | do not email me | I’m at work
Thanks again in advance!
Password Login
on (release) {
if (username=="kenneth" & password=="9" or username=="Velg ID" & password=="3") {
gotoAndPlay("start");
} else {
gotoAndPlay("again");
}
}
iv copied text from the book "foundation actionscript",.. tried tutorials on flashkit and i cant find out why
the code jumpes over the <if> and always goes to <else>...
iv tried username and password alone in the code, but.. it always goes to else when i test it...
so frustrating
Password Login
Hey guys,
I am trying to create a password protected section on my site. I already know how to create a username/password with actionscript but my question is... is it secured? I heard that one can also be created with PHP with serverside txt file and that its alot more secured . Any advice/help is greatly appreciated.
Thanks in Advance.
Login And Password
I have been asked to create a home page in flash and they need a section for a login/password. I can put the text fields in, but then what? (Flash 4 mac)
Password Login Help
flashers,
I am putting together a flash login site. i have a makeshift .fla that i have ben working on to test this out. the log in works fine, but for only one user/password. what i need is the ability to add/remove as many accepted passwords i choose. can anyone who is mighty in the scripting help me out. i used the flash tutorial from flashkit as my code logic.
thanks.
DK
LoadMovie In Correct Order
Okay,
I have a movie that has multiple swf files that need loading into it.
The code I have used is very basic & looks like the following:
Code:
loadVariables ("myText.txt", "");
loadMovie ("slide1.swf", "page2a");
loadMovie ("slide1s.swf", "page2s");
loadMovie ("slide2.swf", "page3a");
loadMovie ("slide2s.swf", "page3s");
loadMovie ("slide3.swf", "page4a");
loadMovie ("slide3s.swf", "page4s");
loadMovie ("slide4.swf", "page5a");
loadMovie ("slide4s.swf", "page5s");
The problem is that Flash seems to load these files in any order. I need to make the script start to load the movies from "slide1.swf" downwards.
My first thought about this is to use some kind of array that loads the movie from the top of the list & begins to download it, then when its completed the download moves on to the next movie.
Im new to using arrays & I need to be shown how I could go about solving this problem.
Any help much appreciated... Thanks!
Login / Password Question
sup fk...
what code will allow me to clear the text fields once a user fills in the login and password fields and then clicks the enter button?
Password Login For Flash 5?
I'm trying to get a password movie clip to work with two scenes. Basically the MC is on scene 1 and when they enter the correct password, it would take them to scene 2 and then the designated scene. Any ideas on how to accomplish this? The code below is what I thought would do it, but doesn't seem to work...why?
on (release) {
if (login == "password") {
gotoAndStop ("Scene 2", 1);
}
}
many thanks in advance!
shaggy
Password -login Help For Flash
Mac8myPC-Mac8myPC-4789
that is the program i got off of this site. i want to use it to make parts of my site password protected.. i figured out how to add the usernames and passwords but i dont know how to add the fowarding url after they successfully login.i will send the file and the url that i want it to go to... if some one can help...please thanks....
Login And Password Authentication
Ok...Here goes...
I was just going to create a simple website in Flash for my employer to replace the old, dated html site. Well in the middle of my project I find the the company will now be offering a new product. They have combined efforts with another company that currently has a web based online product. What I have been asked to do is set up a member verification login. Each plan participant will be assigned a user name and password. What I am trying to do is to create a login and password authentication page that would verify the individual as a plan participant and then allow them to continue to the other company branded site. Can this be done in Flash? Seems like this would be a perl script or something. I have no experience with this but I am willing to give it a shot. Any help or suggestions would be greatly appreciated.
Password Login Help Needed...
Hi,
I am trying to set up a simple login text field that would open another htm page. I have tried a few times, but I am not quite up to the variables involved I guess, in other words a newbie Anyways, if someone could take a look at the file attached and give me a few pointers in the right direction on the action scripting etc, I would appreciate it.
Thanks, Glen.
Login/Password Problem...please Help.
Hi Everybody
I am converting a friend of mine's business site to flash, and have come across a problem.
I am not sure how to externally validate a login/password set up in flash.
Below is the code I had in HTML/Javascript.
<form name="form1" method="post" action="http://www.onlinekmc.com/validate.asp">
<table width="14" border="0" align="center" cellspacing="0">
<tr valign="middle">
<td align="center"><div align="left"><strong><font color="#333333" size="2" face="Garamond">Client
Login: </font></strong></div>
</td>
</tr>
<tr valign="middle">
<td align="center"><div align="left"><font color="#990000" size="2" face="Garamond"><strong>Username:</strong></font></div>
</td>
</tr>
<tr valign="middle">
<td width="78" align="center">
<div align="left">
<input type="text" name="strusername" size="10" maxlength="30">
</div>
</td>
</tr>
<tr>
<td align="center"><div align="left"><font color="#FF0000"><strong><font color="#990000" size="2" face="Garamond">Password:</font></strong></font></div>
</td>
<tr valign="middle">
<td align="center">
<div align="left">
<input type="password" name="strPassword" size="10
" maxlength="30">
</div>
</td>
</tr>
<tr valign="middle">
<td align="center">
<div align="left">
<INPUT TYPE="SUBMIT" NAME="submitForm" VALUE="Submit">
Your help is appreciated.
Thanks
Sean
Client Login And Password
I have an input text field called loginID and passID everything seems to work fine except for the on(press) when I hit enter everything works and the new .asp page loads but when I press the button to advance, it refers to the else and plays the INVALID PASSWORD mc.
Any suggestions would be great.
on (press, keyPress "<Enter>") {
if (loginID add passID eq "captain" add "america") {
getURL("http://www.p2studios.com/flash_content/login/loginscript_Temp.asp", "_blank", "POST");
} else {
tellTarget ("_root.CLIENT SECTION.INVALID PASSWORD") {
gotoAndPlay(2);
}
}
}
Client Login And Password
I have an input text field called loginID and passID everything seems to work fine except for the on(press) when I hit enter everything works and the new .asp page loads but when I press the button to advance, it refers to the else and plays the INVALID PASSWORD mc.
Any suggestions would be great.
on (press, keyPress "<Enter>") {
if (loginID add passID eq "captain" add "america") {
getURL("http://www.p2studios.com/flash_content/login/loginscript_Temp.asp", "_blank", "POST");
} else {
tellTarget ("_root.CLIENT SECTION.INVALID PASSWORD") {
gotoAndPlay(2);
}
}
}
External Login/Password? MX
I was wondering if this would be possible. If Flash could detect an external .txt to see if the dynamic username and password would be correct, and thus allowing them to enter the flash. Instead of editing the username and password everytime a newcomer comes in...
If this is possible Can someone tell me in a short tutorial?
Thanks
Login And Password Movie
hi...
i wonder if there is a way to simulate a login and password inserting into a textfield with actionscript...
any help apprecited..
thanx in advance
## Password Login Script
I had beed searching for a password login script that is quick and easy. After pulling my hair out I decided to wipe the slate clean and write one. A few tests and I got it going. Thought I would share with you all. Maybe it would help someone who also is looking for an easy method of dealing with users.
I would like some feedback on the possible security issues with this script.
This scripts is designed to allow each user to have a password, or the sysadmin could issue it. The user list can be added to easy and quick. So without further guilding the lilly...
Password Login Script
Code:
//====================
// First Frame
//====================
Name1 = "Name1Password"
Name2 = "Name2Password"
//
stop();
//====================
// In Frame
//====================
input textbox = name
input textbox = pass
Dynamic textbox
invisable button
//====================
// Action on invisable button
//====================
on (keyPress "<Enter>") {
if (eval(name.text) == (pass.text) )
result.text = "Passed login";
else {
result.text = "Failed login.";
}
}
Random Password Gen And Login
Hi all, want to make a flash website that viewers can login and get greater access, but I am totally unaware how to do that. Can it be that they can select their own user/pass and login? HELP! I feel soooo uneducated in this realm. Thanks!
Login/Password Problem
Hi Everybody
I am converting a friend of mine's business site to flash, and have come across a problem.
I am not sure how to externally validate a login/password set up in flash.
Below is the code I had in HTML/Javascript.
<form name="form1" method="post" action="http://www.onlinekmc.com/validate.asp">
<table width="14" border="0" align="center" cellspacing="0">
<tr valign="middle">
<td align="center"><div align="left"><strong><font color="#333333" size="2" face="Garamond">Client
Login: </font></strong></div>
</td>
</tr>
<tr valign="middle">
<td align="center"><div align="left"><font color="#990000" size="2" face="Garamond"><strong>Username:</strong></font></div>
</td>
</tr>
<tr valign="middle">
<td width="78" align="center">
<div align="left">
<input type="text" name="strusername" size="10" maxlength="30">
</div>
</td>
</tr>
<tr>
<td align="center"><div align="left"><font color="#FF0000"><strong><font color="#990000" size="2" face="Garamond">Password:</font></strong></font></div>
</td>
<tr valign="middle">
<td align="center">
<div align="left">
<input type="password" name="strPassword" size="10
" maxlength="30">
</div>
</td>
</tr>
<tr valign="middle">
<td align="center">
<div align="left">
<INPUT TYPE="SUBMIT" NAME="submitForm" VALUE="Submit">
Your help is appreciated.
Thanks
Sean
Password Login Tutorial (Pls Help Me)
HI, This is my first time posting something in this website so im new anyways,
Can anyone tell me the tutorials to make a "Password Login" for Flash MX?
Thank You for your time and your help.
Login/Password Problem
Hi Everybody
I am converting a friend of mine's business site to flash, and have come across a problem.
I am not sure how to externally validate a login/password set up in flash.
Below is the code I had in HTML/Javascript.
<form name="form1" method="post" action="http://www.onlinekmc.com/validate.asp">
<table width="14" border="0" align="center" cellspacing="0">
<tr valign="middle">
<td align="center"><div align="left"><strong><font color="#333333" size="2" face="Garamond">Client
Login: </font></strong></div>
</td>
</tr>
<tr valign="middle">
<td align="center"><div align="left"><font color="#990000" size="2" face="Garamond"><strong>Username:</strong></font></div>
</td>
</tr>
<tr valign="middle">
<td width="78" align="center">
<div align="left">
<input type="text" name="strusername" size="10" maxlength="30">
</div>
</td>
</tr>
<tr>
<td align="center"><div align="left"><font color="#FF0000"><strong><font color="#990000" size="2" face="Garamond">Password:</font></strong></font></div>
</td>
<tr valign="middle">
<td align="center">
<div align="left">
<input type="password" name="strPassword" size="10
" maxlength="30">
</div>
</td>
</tr>
<tr valign="middle">
<td align="center">
<div align="left">
<INPUT TYPE="SUBMIT" NAME="submitForm" VALUE="Submit">
Your help is appreciated.
Thanks
Sean
Password Login Tutorial (Pls Help Me)
HI, This is my first time posting something in this website so im new anyways,
Can anyone tell me the tutorials to make a "Password Login" for Flash MX?
Thank You for your time and your help.
Flash - Login And Password
Hi all -
I want to send a post command to a PHP page via flash... Basically, its a webmail login page in HTML that I want to be in flash.
Quote:
1: <form method="Post" action="http://yourmailserver/sm/src/redirect.php">
2: <center>
3: <table border="0">
4: <tr>
5: <td>Email Address/td>
6: <td><input type="text" name="login_username" size="16" maxlength="128" /></td>
7: <td></td>
8: </tr>
9: <tr>
10: <td>Password/td>
11: <td><input type="password" name="secretkey" size="16" maxlegth="128" /></td>
12: <td><input type="submit" value="Login" /></td>
13: </tr>
14: </table>
15: </center>
16: </form>
I'm not a flash expert, but this doesn't seem like it would be that hard... When I try a "post" it doesn't seem to go to the redirect page. When I do I "get" it doesn't seem to send the variables?? Any ideas.
Login And Password - From A .txt File?
I downloaded a login and password thing to see how it works and how I would make my own.
Unfortunatly the .fla I downloaded, had a bug in it and required you to press enter twice to get in.
I thought this would be the safest way. I DO NOT want to have the login and password in the actionscript because that is to easy to hack.
What im basically looking to do is have a .txt file where the name of the .txt would be the login, and inside would read password= w/e.
So it would be like this: if the login was "admin" and the password was "default"
admin.txt inside it reads password="default"
so that would be 1 log in and password. But the client wants to have multiple logins which can be easily edited and deleted.
Somhow I have to make it read from any .txt file and if the login matches the password would let you in. This is really confusing :P
If anyone has any ideas, or better suggestions for a secure login and password please let me know.
Thanks fellas.
Username And Password Login?
How can i make a login with username and password in flash???
I want the password and the username be saved in the swf file.
thank you!
Shoot Targets In Correct Order
Hi all,
I am new to action scripting and so have been using tutorials to help me with my shooting game. I used the familiar example of the spaceship shooting bullets at the object, but I modified it to be a game where the ship is a fire extinguisher and the object is a fire to be put out.
What I want to happen is place 4 fires on the screen at once, when you shoot a fire it should disappear. However, if you don't hit them in the right order (they are numbered 1-4), all of the fires reappear (re-randomized) and you have to start over.
I have the 4 instances of the fire, but only fire4 disappears when you hit it, the other 3 fires don't respond to the extinguisher. Anybody who can see what I'm doing wrong, and help me achieve the result above, please let me know. Thanks (code below).
var bulletSpeed = 5;
var bulletReady = true;
var bulletDelay = 50;
var bulletArray = [];
var bulletCount = 0;
function createBullets() {
var bulletMc = this.attachMovie("bullet", "bullet"+bulletCount, 1000+bulletCount);
bulletCount++;
bulletMc._y = shipMc._y+(shipMc._width/5)-(bulletMc._width/1);
bulletMc._x = shipMc._x+(bulletMc._height/15);
bulletArray.push(bulletMc);
}
function moveBullets() {
if (bulletReady && Key.isDown(Key.SPACE)) {
bulletReady = false;
currentTime = getTimer();
createBullets();
} else {
if (currentTime+bulletDelay<=getTimer()) {
bulletReady = true;
}
}
for (var i = 0; i<bulletArray.length; i++) {
var b = bulletArray[i];
if (b._x>-50) {
b._y += bulletSpeed;
} else {
removeMovieClip(b);
bulletArray.splice(i, 1);
}
if (!hit) {
if (b.hitTest(ob)) {
hit = true;
ob.play();
removeMovieClip(b);
bulletArray.splice(i, 1);
}
}
bulletArray[i]._x -= bulletSpeed;
}
}
var hit = false;
var obSpeed = 0;
function createObject1(o) {
ob = this.attachMovie(o, o1, 104);
ob._xscale = 50;
ob._yscale = 50;
ob._x = random(300)-1;
ob._y = random(400)-1;
}
function createObject2(o) {
ob = this.attachMovie(o, o2, 103);
ob._xscale = 50;
ob._yscale = 50;
ob._x = random(300)-1;
ob._y = random(400)-1;
}
function createObject3(o) {
ob = this.attachMovie(o, o3, 102);
ob._xscale = 50;
ob._yscale = 50;
ob._x = random(300)-1;
ob._y = random(400)-1;
}
function createObject4(o) {
ob = this.attachMovie(o, o4, 101);
ob._xscale = 50;
ob._yscale = 50;
ob._x = random(300)-1;
ob._y = random(400)-1;
}
function resetObject() {
ob._x = random(300)-20;
ob._y = random(400)-20;
ob.gotoAndStop(1);
ob.restart = false;
hit = false
}
function moveObject() {
if (ob._y<400) {
ob._y += obSpeed;
} else {
resetObject();
}
if (ob.restart) {
resetObject();
}
}
createObject1("fire1");
createObject2("fire2");
createObject3("fire3");
createObject4("fire4");
this.onEnterFrame = function(){
moveObject(); //if you shoot out the fire a new one appears
moveShip(); //how to move guy with extinguisher
moveBullets(); //how extinguishers sprays on space bar
};
var speed = 6;
//create and position stars
var shipMc = this.attachMovie("ship", "ship", 10000);
//attach the ship mc to the stage
shipMc._y = Stage.height-(shipMc._height+200);
//position the ship
shipMc._x = Stage.width-(shipMc._width+300);
function moveShip() {
if (Key.isDown(Key.UP)) {
shipMc._y -= speed;
}
if (Key.isDown(Key.DOWN)) {
shipMc._y += speed;
}
if (Key.isDown(Key.LEFT)) {
shipMc._x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
shipMc._x += speed;
}
}
How Do You Add Commas On Long Numbers
My question is simply. How do you add commas on long numbers? I've made a simple loop that keeps adding numbers until I tell it to stop. When it reachs in the thousands, how do I add the comma and to keep adding commas in the right places as the number gets larger. For example how do I change 123456789 to 123,456,789.
Crazy With Long Numbers
Hello All,
I'm having a heckuva time with a long number function that I'm using to add commas to the formatting of dollars. So I take a long number in the billions, run it through my function to get it formatted and I get a negative number? I've dissected my function step by step with an alert and it's driving me crazy!! I was wondering if somebody could take a look at my function and let me know if I'm missing a step. Maybe flash has a problem processing long numbers? The function works perfectly as a jscript... but no luck in flash. Thanks for reading.
Steve
function formatAsDollars(val) {
val = Math.abs(val);
val = val +"";
var valArr = new Array();
var formattedStr = "";
var dec = "";
//if val is dec, remove it to add later
if (val.indexOf('.') > 0) {
dec = val.substring(val.indexOf('.'), val.length);
val = val.substring(0, val.indexOf('.'));
}
//split string into groups of 3's backwards
while (val.length > 3) {
valArr[valArr.length] = val.substring(val.length - 3, val.length);
val = val.substring(0, val.length - 3);
}
//if there are leftover numbers, append them to the beginning of the str
if (val.length > 0) {
formattedStr = val;
}
//traverse through array backwards adding segments back
for (var i = valArr.length -1; i >= 0; i--) {
formattedStr = formattedStr + "," + valArr[i];
}
//add dec if it exists
formattedStr = formattedStr + dec;
return formattedStr;
}
100% Secure Password Login Sequence
Music Man said in a post to check and verify a password server side..
Agreed... But once the, server side PHP script has cross referenced the MySQL database for a username/password match, the script then needs to send a variable access boolean back to the client. But surely this could be easily manipulated/spoofed client side (Like packet sniffing, but outputting rather than listening).
Could you perhaps encrypt the access variable with the password (server side), send it to the client & then the client can unencrypt the access variable with the user inputted password variable? Only one flaw with that is you are ultimately going to have to have if(access == 1) in the swf which can apparently be opened and manipulated!!
Is there a crack proof login sequence available?
Qwik-Silver
Flash Password Login Problem
hi, i have a problem with the login screen i'm trying to make with flash mx and hope u guys can help me out. i checked out the tutorial but it doesn't apply to mine.
it goes like this..
user sees a blank swf with just 1 blank field for password.
correct pass = proceed to my preloader
wrong pass = nothing happens
i can only guess that i would be using the "if" and "gotoandplay" commands.
i do not want use any username, just the password field will do. so i guess it would be quite a simple one. just that i'm dumb enough not to know that.
u gurus tell me pls what code to put.
*desperate*
Help With Username And Password Registration+Login
Okay, i'm trying to get flash actionscript to go to a PHP file and all that, which works.. But I need help on the URL part of it.. the current is
Code:
on (release) {
if (RegName ne "") {
Status = "Beginning registration Process... Please Hold";
loadVariablesNum("Register.php?RegName="+RegName+"&"+random(999) , 0);
} else {
Status = "Please enter a User Name to register";
}
}
and
Code:
on (release) {
if (Name ne "") {
gotoAndPlay(2);
Status = "Beginning Login Process.. Please Hold";
loadVariablesNum("Login.php?Name="+Name+"&R="+random(999) , "0");
} else {
Status = "Please enter a User Name";
}
}
Now, my problem is I need to make it where it will register the password and read the password also in that one line, if I make it in sep. lines like this
Code:
on (release) {
if (RegName ne "") {
Status = "Beginning registration Process... Please Hold";
loadVariablesNum("Register.php?RegName="+RegName+"&"+random(999) , 0);
loadVariablesNum("Register.php?RegPass="+RegPass+"", 0);
} else {
Status = "Please enter a User Name to register";
}
}
It adds 2 diffrent tables, one for username then another for password..
Can anyone help?
[F8] Probs Making A Login Password
hi all,
I've got a probblem and cannot solve it....
the login and pass are 'azerty'. as long as i use a word it says i cannot login
if i change the password and login in '' it works
any suggestions?
Login To Mc - Password Through Text File?
Hello!
Id like to create a user name & password area (backstage_mc) inside a main.swf. Ive used simple login forms before (www.stallescotia.com) but Id like this to take its list of users & passwords through a txt.file so that my friend can update it without having to go into Flash, does anyone know of a good tutorial either AS2 or AS3?
Thanks a million!
scotia
Problems With Code In Login/Password
hi sorry i'm a newbie,
this may be an easy question for some of you. I've looked at over a dozen websites trying to find the code. I need to make a reset function that sets the login back to the default code. I have a reset button made, but i'm a little stuck on the code. If you could help me that would be great, or if you know a website that could help me even better thanks!
this is what I have so far:
ActionScript Code:
this.userName = "zara";
this.passWord = "loser";
name_txt.text = "enter name";
password_txt.text = "enter password";
password_txt.maxChars = 5;
name_txt.restrict = "a-z 0-9";
name_txt.onChanged = function() {
trace(name_txt.text+" is the content in textfield");
};
name_txt.onSetFocus = function() {
trace("name_txt has the focus");
//item easing style, starting value, ending value, number of frames, useTime
new Tween(this, "_alpha", Strong.easeOut, this._alpha, 100, 15, false);
};
name_txt.onKillFocus = function() {
trace("name_txt NO LONGER HAS the focus");
new Tween(this, "_alpha", Strong.easeOut, this._alpha, 50, 15, false);
};
password_txt.onSetFocus = function() {
//item easing style, starting value, ending value, number of frames, useTime
new Tween(this, "_alpha", Strong.easeOut, this._alpha, 100, 15, false);
};
password_txt.onKillFocus = function() {
new Tween(this, "_alpha", Strong.easeOut, this._alpha, 50, 15, false);
};
submit_btn.addEventListener("click", this);
function click() {
trace("button has been clicked");
if (name_txt.text != "enter name") {
if (password_txt.text != "enter password") {
trace("validated!");
checkLogin();
}
}
}
function checkLogin() {
if (name_txt.text == this.userName && password_txt.text == this.passWord) {
trace("login has occurred");
} else {
trace("you suck. you failed to login properly dumbass");
}
}
Key.addListener(this);
function onKeyDown() {
if (Key.isDown(Key.ENTER)) {
trace("ENTER IS DOWN");
click();
}
}
Login/password Authorization Scheme
Hello.
How basic login/password authorization scheme in Flash applet for upstreaming and FMS can be realized? Namely how login and password entered in applet can be transmitted to access or authorisation plugins in FMS?
Thanks in advance.
Mike.
Simple Username/password Login
Hi.
Been using adobe flash cs3 for a school project and i need to make a simple username/password login for the project. The problem is that, when using various tutorials in various websites, like this one:
http://www.webdesign.org/web/flash-&-swish/flash-tutorials/simple-user-name-and-password-login.5027.html
for this to work i have to publish in actionscript 2.0, and when i do that, the rest of my project stops to work.
Is there any way i can do the login application in cs3 without having to change my entire project ?
thx
Numbers-only Password
Is it possible to have numbers only in a pasword field?
I have an input text field ("pass_txt") and a login button that processes the input, taking people to either a "success" or a "retry" labelled frame. I'm trying to get this to work so that no matter what numbers are entered (this is purely cosmetic!) it will be considered a success.
I have tried restricting input to numbers only without luck. I have not been asked to create a login that does not draw from a database or require a specified password and can't figure this out. Here is my code so far:
Code:
pass_txt.restrict = "0-9";
//check for pw on login
login_btn.onRelease = function() {
if (isNaN(this._parent.pass_txt)) {
this._parent.gotoAndStop("retry");
} else {
this._parent.gotoAndStop("success");
//}
};
//initialise pw field
pass_txt = "";
stop();
|