I honestly have no idea, ive never worked with mouse click movement sorry:(SpiritWebb wrote:Whatever you did, it fixed it!! Thank you.
Now, with that code, what code can be replaced with below, for the mouse click movement?
Code: Select all
onClipEvent (load) { rad = 0.0174532925199433; speed = 5; moving = false; } onClipEvent (mouseDown) { moving = true; m = {x:_parent._xmouse, y:_parent._ymouse}; } onClipEvent (enterFrame) { if (moving) { mcx = _x-m.x; mcy = _y-m.y; _rotation = -Math.atan2(mcx, mcy)/rad; mr = _rotation*rad; if (Math.sqrt((mcx*mcx)+((mcy)*(mcy)))>speed) { _y -= speed*Math.cos(mr); _x -= -(speed*Math.sin(mr)); } else { _x = m.x; _y = m.y; moving = false; } } }
Flash
Re: Flash
This isnt just a gimp mask...This is an S&M gimp mask...
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Flash
Np...I will play around with that code you gave me, Thanks for that btw, and see where I can implement it!! 
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Flash
So, with the code you gave me, is there a way to incorporate planets? I tried placing a planet down on the stage and ran it, but it never showed up. What am I doing wrong?neronix17 wrote:I honestly have no idea, ive never worked with mouse click movement sorry:(SpiritWebb wrote:Whatever you did, it fixed it!! Thank you.
Now, with that code, what code can be replaced with below, for the mouse click movement?
Code: Select all
onClipEvent (load) { rad = 0.0174532925199433; speed = 5; moving = false; } onClipEvent (mouseDown) { moving = true; m = {x:_parent._xmouse, y:_parent._ymouse}; } onClipEvent (enterFrame) { if (moving) { mcx = _x-m.x; mcy = _y-m.y; _rotation = -Math.atan2(mcx, mcy)/rad; mr = _rotation*rad; if (Math.sqrt((mcx*mcx)+((mcy)*(mcy)))>speed) { _y -= speed*Math.cos(mr); _x -= -(speed*Math.sin(mr)); } else { _x = m.x; _y = m.y; moving = false; } } }
Re: Flash
yeah you would have to do the same as what you have to with the map_mc clip, but add something to make them act like they are physically there, i guess they would have to move with the map_mc too so that you can move around them, if you make a copy of the original and play around with it then you can figure out what each bit does and use that to add planets, i cant do it for u though. 
This isnt just a gimp mask...This is an S&M gimp mask...
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Flash
Alright, so I was working with the mouse click movement code today, and for some reason, when I apply the code the "player" the ship travels at an angle rather then traveling forward. Need help correcting the code movement.
Code: Select all
onClipEvent (load) {
rad = 0.0174532925199433;
speed = 5;
moving = false;
}
onClipEvent (mouseDown) {
moving = true;
m = {x:_parent._xmouse, y:_parent._ymouse};
}
onClipEvent (enterFrame) {
if (moving) {
mcx = _x-m.x;
mcy = _y-m.y;
_rotation = -Math.atan2(mcx, mcy)/rad;
mr = _rotation*rad;
if (Math.sqrt((mcx*mcx)+((mcy)*(mcy)))>speed) {
_y -= speed*Math.cos(mr);
_x -= -(speed*Math.sin(mr));
} else {
_x = m.x;
_y = m.y;
moving = false;
}
}
}
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Flash
Alright, so I decided to re-build the login with flash. I have all my fields in place, it connects, but sits at transferring. It doesn't seem to be doing anything. Am I doing something wrong?
Flash: username (user input text) - instance: userinput, var: user; password (user input text) - instance: passinput, var: pass.
flash code:
actions
login
Note that status is a dynamic text box that just shows a message.
PHP:
connect
authenticate
It doesnt seem to be verifying the information in the database is correct, so its not moving on. Just sits in the transfering from localhost, thats it. If successfull, its supposed to go to frame 10, which is the index frame in flash. Otherwise the status message is to say, please try again! Help...
Flash: username (user input text) - instance: userinput, var: user; password (user input text) - instance: passinput, var: pass.
flash code:
actions
Code: Select all
stop();
userinput.restrict="a-zA-Z0-9";
passinput.restrict="a-zA-Z0-9";
Selection.setFocus(userinput);
status="Enter your information and login";
this.onEnterFrame = function ()
{
if(_root.checklog == 1){
_root.gotoAndStop(10);
}
if(_root.checklog == 2){
_root.gotoAndStop(15);
}
if(_root.checklog == 3){
_root.gotoAndStop(7);
}
}
//the onEnterFrame constantly checks to see if the PHP
//script has sent the variable 'checklog' back to the
//movie and directs the people accordingly
Code: Select all
on (release, keyPress "<Enter>") {
if (user != "" && pass != "") {
status = "Logging in, please wait...";
loadVariablesNum("authenticate.php", 0, "POST");
}
}
PHP:
connect
Code: Select all
<?php
$db = mysql_connect("localhost","root","") or die("Could not connect to db");
mysql_select_db("undiscovered") or die("Could not connect, please try again");
?>
Code: Select all
<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
//connect to database
include_once 'connect.php';
session_start();
$query = "SELECT * from players where name='$user' and password='$pass'";
$result = mysql_query($query) or die ("didn't query");
//see if there's an EXACT match
$num = mysql_num_rows($result);
if ($num == 1){
echo "status=Welcome&checklog=1";
} else {
echo "status=Please try again!&checklog=2";
}
?>
Re: Flash
if that code is exactly what you are using then it might help having the password for it (im guessing you removed that for security though lol), Ive tried with similar coding a few days ago trying to incorporate my avatars into my game, didnt do anything when I pressed the Login button though 
EDIT: We both used the same tutorial on kirupa.com then, cus my one does the exact same as with yours, I think Ive figured out why but Il go make sure Im right about it before I post the fix.
EDIT: Yeah, I was wrong lol, turns out it was just the flash itself, the successful login frame is 15, so thats where that stuff goes, make sure you publish the animation as html and use that since .swf version doesnt seem to work right.
EDIT AGAIN
Thats wrong too, now it just sits at the login screen, sorry.
EDIT: We both used the same tutorial on kirupa.com then, cus my one does the exact same as with yours, I think Ive figured out why but Il go make sure Im right about it before I post the fix.
EDIT: Yeah, I was wrong lol, turns out it was just the flash itself, the successful login frame is 15, so thats where that stuff goes, make sure you publish the animation as html and use that since .swf version doesnt seem to work right.
EDIT AGAIN
This isnt just a gimp mask...This is an S&M gimp mask...
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Flash
Yeah, we may have used the same tutorial. If I can figure it out, I will let you know also...neronix17 wrote:if that code is exactly what you are using then it might help having the password for it (im guessing you removed that for security though lol), Ive tried with similar coding a few days ago trying to incorporate my avatars into my game, didnt do anything when I pressed the Login button though
EDIT: We both used the same tutorial on kirupa.com then, cus my one does the exact same as with yours, I think Ive figured out why but Il go make sure Im right about it before I post the fix.
EDIT: Yeah, I was wrong lol, turns out it was just the flash itself, the successful login frame is 15, so thats where that stuff goes, make sure you publish the animation as html and use that since .swf version doesnt seem to work right.
EDIT AGAINThats wrong too, now it just sits at the login screen, sorry.
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Flash
Still having no luck correcting that code (above). It still sits at transferring. Starting to get really frustrated. Been going over this same code since the 16th...grrr...

