Be a Supporter!
Response to: breaking if statement Posted November 30th, 2008 in Game Development

hey every one! i was just wondering how it would be possible to have a 2 random number generators that can remember the different combinations between the two and if it gets those two numbers again, it re does it?
like it dials 2 and 3.
and then is dails 2 and 3 again then it would keep on trying to get another number like 2 and 4 until it does.
please help

Response to: breaking if statement Posted November 30th, 2008 in Game Development

for some reason the currentframe is always breaking while the ontop==false only breaks if i say false. it doesn't break if i put it to true. Why is that?

Response to: Another noob question Posted November 30th, 2008 in Game Development

well it has to do with the order of loading the file. people usually put the pictures and stuff first so their preloader appears earlier than if they didn't. sometime the preloader wouldn't show up at all because it was loaded last. i don't know how to do that though.

breaking if statement Posted November 30th, 2008 in Game Development

so for some reason this if statement keeps on breaking so all of it turns true; the if statement doesn't act like a door where only a certain few can enter, it acts like an open door, every one can enter. what in this script is breaking?

for (var c:Number = 1; c<6; c++) {
	for (var d:Number = 1; d<6; d++) {
		if ((_root[c+"_"+d]._currentframe == 1) && (_root[c+"_"+d].ontop == false)) {
			trace(1);
		}
	}
}

also when i try to trace the current frame. every time it came back with a 1 and i know this is not true. I've had problems with _currentframe before.

Response to: AS for movie clip depth Posted November 29th, 2008 in Game Development

mc.swapDepths(# you want it at OR other mc)

Response to: mine sweeper Posted November 29th, 2008 in Game Development

i can't find the problem, I'll just have to cancel the project.

Response to: a major problem Posted November 29th, 2008 in Game Development

on(press){
this.gotoAndStop(2)
}

that goes to frame two of the button/ movie clip when it is pressed.

Response to: How do i bind camera to cursor? Posted November 29th, 2008 in Game Development

use a v-cam
ps look it up in the forum search box at the bottom of the forums.

Response to: mine sweeper Posted November 29th, 2008 in Game Development

i found out the the miss behaved mine is the first one in the for loop. it puts a one on the second mine every time they are next to each other. it can also be thought of the ontop variable failing for the second mine. either way it is a pattern.
anybody know what is wrong? please!!!!!!!!!!!!!!!!!!
pm me if you want to talk in depth about what is wrong!!!!!!!!!!!!!
I'm desperate!!!!!!!!!!!!

Response to: How do you make a sound fade out... Posted November 29th, 2008 in Game Development

look up "sound volume" in the flash help file(help>flash help or press F1) it should have an example of a sound controller and you can then modify it from there.

Response to: mine sweeper Posted November 29th, 2008 in Game Development

i figured out when it happens. when there are two mines next to each other, one ignores the ontop variable and places a 1 ontop of the other mine. the other doesn't ignore this and it follows the "rules."
going to find out if it has to do with the order of mines in the for loop.
pictures to show you
still need help!

mine sweeper

Response to: Questioning... Posted November 29th, 2008 in Game Development

i think it is modify>document
you could also do ctrl+J

Response to: mine sweeper Posted November 29th, 2008 in Game Development

could anybody help me along? I have no idea why the code is not working! I might have to rewrite the script if some one can't find any problems!

mine sweeper Posted November 29th, 2008 in Game Development

sometimes the numbers overlap the mines now.
http://spamtheweb.com/ul/upload/4008/396 80_mine_sweeper.fla
test it for your self!
please!!!

Response to: very sneaky problem Posted November 29th, 2008 in Game Development

i will have to re write the script, there is a loop hole that is screwing up some thing, unless i messed up the ontop=true part.

Response to: very sneaky problem Posted November 29th, 2008 in Game Development

for (var u:Number = 1; u<3; u++) {
		//gets variables
		X_1 = this["X"+u]._x;
		Y_1 = this["X"+u]._y;
		X = X_1/30+1;
		Y = Y_1/30+1;
		//decides what it is on and turns ontop to true
		if (X == 1) {
			_root["na"+Y].ontop = true;
		} else if (X == 2) {
			_root["nb"+Y].ontop = true;
		} else if (X == 3) {
			_root["nc"+Y].ontop = true;
		} else if (X == 4) {
			_root["nd"+Y].ontop = true;
		} else if (X == 5) {
			//trace(_root["ne"+Y].ontop+";"+X+","+Y);
			_root["ne"+Y].ontop = true;
		}
	}
}

here's the script

Response to: very sneaky problem Posted November 29th, 2008 in Game Development

ok now this script is not working, it just doesn't change the Varaible (ontop)from false to true when needed.
(see the other post for the script)

Response to: Exporting sound Posted November 29th, 2008 in Game Development

well, when you record into the microphone, you save it as a sound file. Then import it into the flash document, and use as2 to have a triger event so it plays when something happens.

Response to: very sneaky problem Posted November 29th, 2008 in Game Development

fixed it!

very sneaky problem Posted November 29th, 2008 in Game Development

hey every one, I still have the same problem from this post.(at the very bottom)
I cannot figure out why this is happening!
Thanks

Response to: Get username in a Flash movie? Posted November 28th, 2008 in Game Development

it can!
http://www.kirupa.com/developer/actionsc ript/shared_objects.htm
they call it shared objects

Response to: variables Posted November 28th, 2008 in Game Development

here is the whole for loop(mine sweeper experiment)

for (var i:Number = 1; i<3; i++) {
		letter = Math.ceil(Math.random()*5);
		number = Math.ceil(Math.random()*5);
		if (letter == 1) {
			this["X"+i]._x = _root["a"+number]._x;
			this["X"+i]._y = _root["a"+number]._y;
		} else if (letter == 2) {
			this["X"+i]._x = _root["b"+number]._x;
			this["X"+i]._y = _root["b"+number]._y;
		} else if (letter == 3) {
			this["X"+i]._x = _root["c"+number]._x;
			this["X"+i]._y = _root["c"+number]._y;
		} else if (letter == 4) {
			this["X"+i]._x = _root["d"+number]._x;
			this["X"+i]._y = _root["d"+number]._y;
		} else if (letter == 5) {
			this["X"+i]._x = _root["e"+number]._x;
			this["X"+i]._y = _root["e"+number]._y;
		}
		//anti-stacking code                
		if (i>1) {
			for (var r:Number = 1; r<i; r++) {
				if (this["X"+i]._x == this["X"+(r)]._x) {
					i -= 1;
				}
			}
		}
	}
//here is where the real problems start
	for (var u:Number = 1; u<3; u++) {
		//gets variables
		X1 = this["X"+u]._x;
		Y1 = this["X"+u]._y;
		X = X1/30+1;
		Y = Y1/30+1;//flash thinks this variable is a string
		trace(Y+","+u)//returns the first trace with Nan , # ; # , # for the second
		//decides what it is on and turns ontop to true
		if (X == 1) {
			_root["na"+Y].ontop = true;
		} else if (X == 2) {
			_root["nb"+Y].ontop = true;
		} else if (X == 3) {
			_root["nc"+Y].ontop = true;
		} else if (X == 4) {
			_root["nd"+Y].ontop = true;
		} else if (X == 5) {
			_root["ne"+Y].ontop = true;
		}
}
}
Response to: variables Posted November 28th, 2008 in Game Development

but why would it say this the first time and not the second? Is the variable string being changed into a number after the first time in the for loop?

Response to: animation script Posted November 28th, 2008 in Game Development

you can put that script on the frame you want it to go on and do this:

_root.mc.gotoAndStop(2)

OR

_root.mc.onLoad=function(){
gotoAndStop(2)
}
Response to: Need a script... Posted November 28th, 2008 in Game Development

well, you could do a hittest so if they even touch a little bit, it goes to the next frame.

Response to: variables Posted November 28th, 2008 in Game Development

so now I have another problem, when I am tracing a variable in a for loop, the first time it says NaN. What is this and why is it doing this?

Response to: Get username in a Flash movie? Posted November 28th, 2008 in Game Development

well, newgrounds uses cookies to keep a user logged in every time he/she changes pages, so maybe you could access those, but i don't have any details.

variables Posted November 28th, 2008 in Game Development

how can i make a variable hold words instead of numbers?

Response to: mines Posted November 27th, 2008 in Game Development

never mind, i figured it out.

Response to: mines Posted November 27th, 2008 in Game Development

never mind, i figured it out.