Be a Supporter!
Interference of listeners? Posted October 24th, 2014 in Game Development

My project contains a square that moves via keyboard controls. But I'm just using the Keydown event for each individual key. How should I make the movement more smooth.

Project for testing: http://www.newgrounds.com/dump/item/24ca50b96837bac5d3dc9cc8758785af

Code:

import flash.display.Sprite;
import flash.events.Event;

stop();

var rectangle001:Sprite = new Sprite;
var speed:Number = 1;

rectangle001.graphics.lineStyle(5, 0x0000FF );
rectangle001.graphics.beginFill(0x85FF12);
rectangle001.graphics.drawRect(50, 50, 50, 50);
addChild(rectangle001);

	stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler001);
	function keyDownHandler001 (event:KeyboardEvent){
		if (event.keyCode == Keyboard.LEFT && rectangle001.x >= -45){
			rectangle001.x -= speed;
			trace(rectangle001.x + " " + rectangle001.y);
			
		}
		else if (event.keyCode == Keyboard.RIGHT && rectangle001.x <= 855){
			rectangle001.x += speed;
			trace(rectangle001.x + " " + rectangle001.y);
		}
		else if (event.keyCode == Keyboard.DOWN && rectangle001.y <= 435){
			rectangle001.y += speed;
			trace(rectangle001.x + " " + rectangle001.y);
		}
		else if (event.keyCode == Keyboard.UP && rectangle001.y >= -45){
			rectangle001.y -= speed;
			trace(rectangle001.x + " " + rectangle001.y);
		}
	}
Is Flash Dead? Posted October 24th, 2014 in Game Development

Is it worth me becoming more serious about AS3 as a language? Or should I just drop it and learn C# or C++ or some crap instead?

What are it's pros and cons over other languages, etc?

Response to: Alrighty grammar Nazis... Game on. Posted October 24th, 2014 in General

Graphic Interchangeable Format, not 'Jraphic'. So gif with a hard 'G'.

Response to: Blame the User Above! Posted October 24th, 2014 in General

I blame NewgroundsMike for making shitty back-and-forths.

How to Remember? Posted October 24th, 2014 in Where is / How to?

I lose stuff all the time. ALL THE TIME. And today I've lost the stylus to my wacom tablet; and I've went through my entire room. So, the question arises, what should I do to help myself remember things?

Response to: probably a stupid question but.. Posted October 24th, 2014 in Game Development

Go to top right where it says 'classic', select reset workspace and it should resize all the panels.

Response to: Keyboard controls in as3? Posted October 23rd, 2014 in Game Development

I added the enter frame to try and fix a bug earlier; but since, I forgot to remove it. Thanks for the help Sam, my little .swf is running perfectly now. Thanks again!

Response to: Units in as3? Posted October 23rd, 2014 in Game Development

At 10/23/14 02:22 PM, Sam wrote:
At 10/23/14 01:48 PM, GrahamNG wrote: So I'm making a test in whicha square moves. Except when I do 'blah.x += 1' or something similar it won't move it by one pixel, something more like 20. Why is this? Why isn't it done by pixels?
It is done by pixels, you may be applying +1 multiple times per frame or the movement happens in consecutive frames so it looks like it's moving more.

Thanks. Though is there anyway I could make it look smoother. Test it out here (keyboard directions): http://www.newgrounds.com/dump/item/bdedb36e714b0eae6518377c5c3fcb9b

Units in as3? Posted October 23rd, 2014 in Game Development

So I'm making a test in whicha square moves. Except when I do 'blah.x += 1' or something similar it won't move it by one pixel, something more like 20. Why is this? Why isn't it done by pixels?

Response to: Recent Purchases Posted October 23rd, 2014 in General

At 2/8/13 10:02 AM, Pkmn2 wrote: Something called "Kinder Pingui"

I fokn love kinder chocolate. Yet I haven't seen one of these yet :(

Keyboard controls in as3? Posted October 23rd, 2014 in Game Development

I was setting up a little square that moves when the correlating key is pressed. But, without returning any errors, when I click the button the square won't move.

My code:

import flash.display.Sprite;
import flash.events.Event;

stop();

var rectangle001:Sprite = new Sprite;

rectangle001.graphics.lineStyle(5, 0x0000FF );
rectangle001.graphics.beginFill(0x85FF12);
rectangle001.graphics.drawRect(50, 50, 150, 150);
addChild(rectangle001);

addEventListener(Event.ENTER_FRAME, enterFrameHandler001);
function enterFrameHandler001 (event:Event){
	addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler001);
	function keyDownHandler001 (event:KeyboardEvent){
		if (event.keyCode == Keyboard.LEFT){
			rectangle001.x += 10;
	    }
    }
}

So where am I going wrong? Thanks for all the answers in advance.

After Effects: Faded Grey Bar? Posted October 22nd, 2014 in Where is / How to?

Whenever I split or shorten a clip the 'ghost' of a clip remains, which means nothing visually on the comp but it's still annoying. What is it and how do I remove it?

After Effects: Faded Grey Bar?

Response to: TypeError: Error #1009: Posted October 18th, 2014 in Game Development

You're not removing the event when you move to a new frame. Just do removeEventListener in the event which changes frames.

Response to: Wacom & Microphone Giveaway + FF Posted October 18th, 2014 in NG News

Well, I've applied.

Response to: MouseEvent not working? Posted October 18th, 2014 in Game Development

I fixed it. My code was fine. But I had to change Shape to Sprite, but I have no idea why...

Response to: MouseEvent not working? Posted October 18th, 2014 in Game Development

At 10/18/14 08:49 PM, MSGhero wrote:
At 10/18/14 08:43 PM, GrahamNG wrote: Where am I going wrong?
Did you ever addChild the shape?

Yes, but me being a retard, I forgot to paste it.

MouseEvent not working? Posted October 18th, 2014 in Game Development

So I'm trying to get into creating without drawing directly onto the stage.

My Code:

import flash.display.Shape;
import flash.events.MouseEvent;

stop();

var rectangle001:Shape = new Shape;

rectangle001.graphics.beginFill(0x00D783);
rectangle001.graphics.drawRect(10, 10, 50, 50);
rectangle001.addEventListener(MouseEvent.CLICK, rectangle001Click);
function rectangle001Click (event:MouseEvent){
	trace("Hello World!");
}

Where am I going wrong?

Newground bot? Posted October 13th, 2014 in General

I just got this message:

Hello dear,
My name is Cynthia and i saw your profile
and i became interested to make friend with you.Some friends are remembered
because of their smile. Some friends are remembered because of their style.
But you are remembered because you are so nice to remember. pls i will like to
know more about you. if you can contact me through my email address here(cynthia.achizizy@hotmail.com) I really
look forward to reading from you soon.
Thanks.
Yours Truly Friends.
Miss Cynthia

Wat. Is this genuine, because it looks like a bot.

Response to: how to make light bulb flash? Posted October 12th, 2014 in Game Development

Hello. I've got a better idea. Have the object added to the stage as a child and have a mouse click event remove it and replace it with the other lightbulb. Much more efficient.

Response to: Looking for AS3 Coder Posted October 12th, 2014 in Programming

At 9/28/14 09:43 PM, AssassinOrd3r wrote: Our team is currently in development of a unique MMORPG and seeking an experienced AS3 programmer to come onboard as a volunteer until the game starts earning significant profits. If you have experience programming MMO games in Flash and/or Unity, please contact us and provide links to any relevant projects.

So you want someone to sink significant hours into work they're not going to get anything from. WAT. Plus MMO's are some of the most time-consuming games to make.

Response to: Want to start promming.. (help) Posted October 12th, 2014 in Programming

http://code.tutsplus.com/series/as3-101--active-7395

Read through this and get an IDE.

Start Programming.

???

Profit.

Response to: Flash? Posted October 12th, 2014 in Game Development

1. I'm pretty sure it supports other formats.
2. In certain aspects certainly.
3. No, it's not prominent in all fields as it used to be, but it's still useful.

Response to: What does 'new' do? Posted October 11th, 2014 in Game Development

Got it. Thanks.

Response to: What does 'new' do? Posted October 11th, 2014 in Game Development

At 10/11/14 01:29 PM, Sam wrote:
At 10/11/14 12:58 PM, GrahamNG wrote: when coding, what does 'new' mean and what's it's functionality.
Constructs an object of that type:

var myCar:Car;

// type may be 'Car' but it has no value to it (null)

myCar = new Car();

// instantiated a new 'Car' object, constructor is called at this stage

Ah. I think I understand. So specifies further than just var myCar = car. You can have multiple cars that you own?

What does 'new' do? Posted October 11th, 2014 in Game Development

when coding, what does 'new' mean and what's it's functionality.

Bandwidth Profiler for CC? Posted October 11th, 2014 in Game Development

I just installed Adobe Flash Professional CC. None of the removed features were anything I cared about and I liked the new design and html5 support.

Then I realised bandwidth profiler was also removed. Feck.

Is there any plug-ins for cc that are essentially bandwidth profiler?

Response to: If command with two conditions? Posted October 5th, 2014 in Game Development

Thanks

If command with two conditions? Posted September 28th, 2014 in Game Development

Right, so I want something to happens when two conditions are met.

Something like:

if (11 + 4 == 15 also 13 + 6 == 19){
somethingHappens
}
Response to: What users do you hate? Posted September 28th, 2014 in General

This thread is frickin' huge.