Be a Supporter!
Response to: Racing game help Posted March 20th, 2009 in Game Development

At 3/20/09 08:07 AM, PanzyFace wrote: Hi.
if (!_root.finish.hitTest)
{gotoAndStop(365);}

if(_root.finish.hitTest(this))

Response to: Attacking code issue Posted March 20th, 2009 in Game Development

At 3/20/09 07:28 AM, Yambanshee wrote: *shakes head...*

Yeah, please use the other thread.

Response to: Attacking code problem Posted March 20th, 2009 in Game Development

onClipEvent(enterFrame){
	if (Key.isDown(Key.SPACE)){
		gotoAndStop("attack");
	}
}
Response to: quick flash question Posted March 19th, 2009 in Game Development

At 3/19/09 02:02 PM, Da-boi wrote: is that in flash 8 format cause it says unexpected file format when i try to open it

CS3 format. Try this one in MX2004 format

Response to: The Flash 'Reg' Lounge Posted March 19th, 2009 in Game Development

No whitespace unless absolutely necessary, and as much as possible one one line. Every line commented. eg (bbs formatting will probably break this)

function BREAKBARR(mc,sa,n,a){																	//SPLIT BALL ARRAY
	sa=Number(sa);a.splice(sa+1,0,[]);															//CREATE NEW SUBARRAY
	for(var i=0;i<a[sa].length;i++){if((i+1)>n){a[sa+1].push(a[sa][i]);};}		//LOOP THROUGH
	a[sa].splice(n,a[sa].length-n);																	//REMOVE ITEMS FROM OLD ARRAY 
	mc.ap=a[sa].length;a[sa].push(mc);															//PUSH MC TO FRONT ARRAY
	PUSHIN(mc,sa,n);																						//PUSH IT IN TO TRACK
}																													//

Mid blue for keywords & identifiers, green for strings, grey for comments. Font: Tahoma 8 so all the comments do line up

Response to: quick flash question Posted March 19th, 2009 in Game Development

At 3/19/09 11:23 AM, Da-boi wrote: does anyone know how to do a fast scrolling background like you see at the title screen of these movies http://www.newgrounds.com/portal/view/43 8754

Like this

Response to: most hated commercial Posted March 19th, 2009 in General

Anything featuring 'Here come the girls'

Response to: stupid for question Posted March 19th, 2009 in Game Development

onClipEvent(load){
	this._visible = false;
	for(var i=1;i<=100;i++){
		_root["flashname"+i]="it works";
	}
}
onClipEvent(enterFrame){
	trace(_root.flashname4);
}
Response to: Music stop script Posted March 19th, 2009 in Game Development

At 3/19/09 04:31 AM, spritezero wrote: i have a video that i have a sound effect in that starts a bout half way through, and at the end when you click the "replay" button, the music stays on throughout the whole clip. I was wondering if anyone could post a code for the music to stop at the end of the animation, thanks

stopAllSounds();should do the job

Response to: Timer/Points Help!? Posted March 18th, 2009 in Game Development

At 3/18/09 06:20 PM, MilkMan268 wrote: Dosen't seem to work, I did everything right. The instance I put as score? Isn't that correct

No, not the Instance Name. The var for the textbox

Timer/Points Help!?

Response to: Timer/Points Help!? Posted March 18th, 2009 in Game Development

At 3/18/09 05:51 PM, MilkMan268 wrote: So is that place on every 30 frames, or just on the first one?
And what do I put on the first frame to reset the variables?

Just the first one
Any time you want to reset the variables, just use the first line of the code I gave

Response to: Proper Spelling and Grammar Posted March 18th, 2009 in General

At 2/18/09 03:25 PM, big-jonny-13 wrote: So, posing a question to the rest of Newgrounds, do you ever feel the need to write properly when posting anything, and if so why?

Always. Because it's civilised and easily understood.

Response to: List of All Newgrounds Users Posted March 18th, 2009 in General

Pretty damn sure this is not going to work

Response to: Timer/Points Help!? Posted March 18th, 2009 in Game Development

At 3/18/09 05:41 PM, MilkMan268 wrote: Ok so I want to make a score box ( static text i guess), that after ever 30 frames it adds 1 point to the score box.

No, dynamic textbox. Var: score

And the movies at 30fps.

Main timeline:

cnt=0;targ=30;score=0
onEnterFrame=function(){
	cnt++;
	if(cnt>=targ){
		score+=1;cnt=0;
	}
}

Untested

Response to: Dilogus Mod looking for Flashers! Posted March 18th, 2009 in Game Development

At 3/18/09 05:02 PM, MaestroRage wrote: here is a screenshot from the game

Looks superb Maestro, if I could spare even a little time I would, but just way too busy to consider it. Good luck with the recruiting, although I have to say the lack of financial incentive will most likely put a few off.

Response to: uhh... please reply Posted March 18th, 2009 in Game Development

At 3/18/09 05:35 PM, 7hl24ll wrote: first guy, how much? again i have very little cash to spend

and second guy, I know it's much cleaner to speak like a normal person yet I like speaking as i have.
Oh, and I dont care how others type... i like typing like this :D

and you dont need to speak text to read this and i dont even have a cellphone :/

Actually, that post was pretty well written, and I apologise for my rant. Just needing to blow off steam a bit, sorry you took the brunt of it.

Response to: The Flash 'Reg' Lounge Posted March 18th, 2009 in Game Development

What the fuck is it with newbies saying 'I can't learn from tutorials'? I mean, shit, do they expect experienced flashers to spend their personal time on MSN/AIM etc talking them through every onion skin/semi-colon? Is it just an amazingly extreme form of laziness, to be able to look at step-by-step instructions and say 'I can't do that'? FFS

/end rant

Response to: uhh... please reply Posted March 18th, 2009 in Game Development

At 3/18/09 05:24 PM, 7hl24ll wrote: oh and yes i dont try for good grammer cuz its faster this way and i think its for old people and "the mature people" that think they are more mature because they use periods and caps and commas every sentance

Wow. Great justification for being a lazy bastard, that. How about you take two more seconds, and actually present yourself as a human being rather than some uneducated pleb? It seriously takes sooooooo little extra time to spell words correctly and use punctuation, and then EVERYONE (rather than the txtspk generation) can comprehend what you're saying.

Response to: Heirarchies and if statements. AS2 Posted March 18th, 2009 in Game Development

At 3/18/09 11:34 AM, d8b wrote: It doesn't work.
Heirarchies are difficult. :/
I need to get both scripts to refer to the 'INST' movieclip.
And INST.//actions
Doesn't work.
on(rollOver){
     _root.INST.gotoAndPlay(2);
}

on(rollOut){
	if(_currentframe==17){
		 _root.INST.gotoAndPlay(33);
	}else if(_currentframe==18){
		 _root.INST.gotoAndPlay(34);
	}
      //etc etc
}
Response to: Actionscript... again... Posted March 18th, 2009 in Game Development

At 3/17/09 10:43 PM, bl00db47h wrote: how did you guys learn it?

I learnt AS by setting myself a target to make a certain kind of game, starting with simple ones. Then I just read the relevant parts of the Flash help files, googled like crazy (see the useful links section of AS: Main for some really good sites/tips), and occasionally decompiled other peoples' work to see how they achieved their ends.

When someone posts a bunch of code, you can't expect to learn by copy/pasting. The point of people distributing code samples is so it gives you something to analyse and attempt to write yourself. You can learn a hell of a lot from seeing how different coders approach the same problem/coding.

In terms of the syntax etc, again, the Flash help files teach good practices and proper syntax. Also, AS: Main is not just about specific game info, each of the 'General' topics covers a wide variety of different, common, problems, and shows you (quite often with detailed explantions) how to go about solving them.

You can look for a book if you really want to, but it's not necessary. There are huge amounts of information online which show actionscripters from newbie to advanced how to achieve their goals. I think in your case, you need to get your head around the fact that you CAN learn from studying existing code - in fact IMO that's the best and easiest way to get to grips with AS.

Response to: Heirarchies and if statements. AS2 Posted March 18th, 2009 in Game Development

Not sure exactly what you're asking, but try this

on(rollOver){
     INST.gotoAndPlay(2);
}

on(rollOut){
	if(_currentframe==17){
		gotoAndPlay(33);
	}else if(_currentframe==18){
		gotoAndPlay(34);
	}else if(_currentframe==19){
		gotoAndPlay(35);
	}else if(_currentframe==20){
		gotoAndPlay(36);
	}else if(_currentframe==21){
		gotoAndPlay(37);
  	}else if(_currentframe==32){
		gotoAndPlay(48);
	}	
}
Response to: What are your Guilty Pleasures? Posted March 18th, 2009 in General

I don't feel guilty about stabbing kittens, mutilating baby seals, or throwing grenades at whales.

Response to: The biggest losers (of Newgrounds) Posted March 18th, 2009 in General

Goldencat and Tahnok are two that spring to mind, although that's going back a couple of years now

Response to: Sticky walls...? Posted March 18th, 2009 in Game Development

Also as an afterthought you may want to consider using an array for the speed values rather than all those case/switch statements

onClipEvent (load) {
	var xS:Number = 10;
	var yS:Number = 10;
	spdArr=[1,5,10,15,20,25,30,35];
}

onClipEvent (enterFrame) {
	//movement
	_x = _x+xS;
	_y = _y+yS;
	//bouncing X
	if (_x>695) {
		xS=spdArr[random(spdArr.length)];
		_x = 695;
		xS = xS*(-1);
	}
	if (_x<25) {
		xS=spdArr[random(spdArr.length)];
		_x = 25;
	}
	//bouncing Y 
	if (_y<25) {
		yS=spdArr[random(spdArr.length)];
		_y = 25;
	}
	if (_y>455) {
		yS = random(8);
		yS=spdArr[random(spdArr.length)];
		_y = 455;
		yS = yS*(-1);
	}
}
Response to: Sticky walls...? Posted March 18th, 2009 in Game Development

At 3/18/09 01:46 AM, Marsume wrote: Now when the ball hits the top or left wall...it sticks to it. if it hits the top wall, it doesnt bounce back, but sticks, and continues moving left along the top of the wall until the center of the ball is at (25,25) i
and the same thing happens when it hits the left wall

When the ball hits the left wall, you don't need the xS = xS*(-1); since you're assigning positive values for the xS... then you're turning them to negative values, so the xS is negative - which keeps it moving leftwards, not rightwards. Same applies to the yS = yS*(-1); if _y<0 (which should be 25 btw)

Response to: Yo i need help... Posted March 17th, 2009 in Game Development

Usual things that bump up swf size are huge bitmaps (crop them externally), and audio (crop externally/adjust export settings from File>Publish Settings>Flash Tab>Audio Stream/Event

Response to: Button / Frame Control Help Pls ! Posted March 17th, 2009 in Game Development

At 3/17/09 03:43 PM, Veranan wrote:
so i click on the Button layer i go to the ACTIONS panel and type in:
**Error** Scene=Scene 1, layer=Button_ONE, frame=1:Line 1: Mouse events are permitted only for button instances
on (release) {
Total ActionScript Errors: 2 Reported Errors: 2

Don't click on the button layer, click on the button itself. Remove the code you have on the timeline and put it on the button instance

Response to: enterFrame problem,.. Posted March 17th, 2009 in Game Development

At 3/17/09 11:56 AM, geohoundz55 wrote: onClipEvent (load) {
function randomW() {
clearInterval(ChangeW);
W = int(Math.random()*10);
}
ChangeW = setInterval(randomW, 2000);
trace(ChangeW);
beginInterval();
}
onClipEvent (load) {
	clearInterval(ChangeW);
	ChangeW=setInterval(function(){
		W=int(Math.random()*10);
	 },2000);
}
onClipEvent (enterFrame) {
	if (this.hitTest (_root.mainRanch.ranch.wall1)) {
		W=8;
	}
	if (this.hitTest (_root.mainRanch.ranch.wall2)) {
		W=9;
	}
	if (this._x<0) {
		this._x = 0;
	}
	if (W == 9) {
		this.Darkus1._x -= _global.mySpd;
		this.Darkus1._xscale = -100;
		this.Darkus1.gotoAndStop(2);
	}
	if (W == 8) {
		this.Darkus1._x += _global.mySpd;
		this.Darkus1._xscale = 100;
		this.Darkus1.gotoAndStop(2);
	} else if (W<=7) {
		this.Darkus1.gotoAndStop(1);
	}
}
Response to: Help with Variable Posted March 17th, 2009 in Game Development

At 3/17/09 04:44 AM, geohoundz55 wrote: I'm having trouble with variables,.
var myInt:Number = _root.StatsMenu.intel;

I tried to put that code in my main timeline keyframe,.
and the input text is on the StatsMeny Clip,.

But once I use the myInt variable it seems that it's not working.,.
how could I fix it?

thanks!

Give the input textbox the instance name 'mys' and use this on the main timeline

StatsMenu.mys.onChanged=function(){
	myInt=Number(_root.StatsMenu.mys.text);
	trace(myInt)
}
Response to: Trans flash in various browsers? Posted March 17th, 2009 in Game Development

At 3/17/09 09:44 AM, crazymusicman2k7 wrote: Just a quick one however does anyone know of any other HTML code other than "<param name="wmode" value="transparent">" that makes the flash background transparent?
Firefox
Opera
Safari etc....

IIRC, IE uses the OBJECT tags and Firefox uses the EMBED tags for parameters. So make sure your wmode="transparent" is in both the embed and object tags, eg:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="900" height="550">
    <param name="movie" value="Equilibrium_10.swf">
    <param name="quality" value="high">
    <param name="wmode" value="transparent">
    <embed src="Equilibrium_10.swf" width="900" height="550" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>
  </object>

Not sure whether you added the parameter manually to the code, but if you select the swf in Design view in DW, you can add parameters using the Properties bar, which will automatically add them to both the object and embed tags

Trans flash in various browsers?