Be a Supporter!
Response to: Boundary Help? As2 Cs4 Posted March 21st, 2012 in Game Development

At 4 hours ago, uraro wrote: Hey guys, so currently I have a character with instance name hero moving left and right and the background with the name bg (5000 x 600) scrolls along, but when I get to the end the screen keeps scrolling into a blank area of the stage and I wanted to create a boundary for it but I have no idea how.

I have this coding for on my hero movieclip right now

onClipEvent (load) {
speed = 1;
stop();
dir = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x += speed;
gotoAndStop(2);
dir = 0;
_root.bg._x -= 15;
_root.one._x -= 15;
_root.two._x -= 15;
_root.three._x -= 15;
_root.four._x -= 15;
} else if (Key.isDown(Key.LEFT)) {
_x -= speed;
gotoAndStop(3);
dir = 1;
_root.bg._x += 15;
_root.one._x += 15;
_root.two._x += 15;
_root.three._x += 15;
_root.four._x += 15;
} else {
if (dir == 0) {
gotoAndStop(1);
} else {
gotoAndStop(4);
}
}
}

I also had no idea how to scroll along the buttons so I labeled them one two three and four and scrolled them along with the background, but I still have no idea how to create boundaries so that it will stop once the background is at the end. :(

Check the backgrounds x-coordinate related to the stage width. Example: if the bg is 1000 pixels wide, and stage is 500 pixels wide, the bg can't be moved further than x = -500 (this assuming the 0,0 point is at the left top corner of the bg). You should be able to implement it based on that.

Response to: How to disable some newgrounds ads. Posted March 20th, 2012 in Game Development

I don't know much how the newgrounds api works, but thinking it with common sense, there must be an object on the stage that the api is accessing. I'm assuming you are using pregame-ads (preloader ads)? Remove the instance where you load the ads after the user starts the game. The ng ads can't appear out of thin air to your game screen.

Response to: question about array splice. Posted March 20th, 2012 in Game Development

At 1 hour ago, CherinoGears wrote:
At 21 hours ago, scearezt wrote:
At 1 minute ago, CherinoGears wrote: To my knowledge you can use array.splice(); to remove elements from an array.

If im storing movieclips inside of an array, and i use splice to remove them, does that remove them from the display list?
Hi!
Only removes from the array. You can try it too in a new file. (=
Ah, i suspected as much but i wasnt 100% certain, thanks for letting me know.

Yes we are here to answer you questions that take 5 or less seconds for you to test them out yourself. Examples include but is not limited to:
if I write:

var a:Number = 1;
var b:Number = 3;
var c:Number = a + b;

and then trace(c), what is the output? I think it's 4, but im not 100% sure, so can you guys tell me?

Response to: What does this mean? Posted March 19th, 2012 in Game Development

At 1 hour ago, Mattster wrote: And well, Math.PI is just the value of PI. It's hard to explain PI other than... It's PI. It's one of those things that once you know about it, you won't forget it :P

Pi is EXACTLY 3!

Response to: as3 Hittestobject (need help!) Posted March 17th, 2012 in Game Development

There can be different ways to do this, but first idea to come to my mind is that you should have a separate array for objects that need to be hit tested on. Do the hit test on every red minion against every object in the other array. So when a red minion hits the obstacle, you remove this redminion from the redminion array and put him on the 'hitTestTheseArray'. Makes sense?

Response to: Enter Key Alters Code... Posted March 16th, 2012 in Game Development

Well this is just the dumbest topic on the bbs.

Response to: Ioerror Problem, As3 Posted March 11th, 2012 in Game Development

Also, you are loading into different object in the error handling function. That object has no error handling as I said already in my first post. It's hard to debug code that looks confusing like yours.

cont1.c1load8.load8.load(new URLRequest("images1/08.jpg"));
cont1.c1load8.load8.addEventListener(IOErrorEvent.IO_ERROR, error8);

cont1.baseload1.load(new URLRequest("images1/08.jpg"));
Response to: Ioerror Problem, As3 Posted March 11th, 2012 in Game Development

Well seeing as how you have organized your code, I suppose there is a possibility that the the loading is instantaneous and thus the error handler is run before you add the evenlistener for the error. Try moving all the code for adding the eventlisteners to the top so they are all added before any loading happens.

Response to: Ioerror Problem, As3 Posted March 11th, 2012 in Game Development

First of all, that's some really ugly code :). Secondly, you are loading the previous image in the error handling without knowing if the previous image was loaded successfully. You don't have an error handler for that case as far as I can see from your code.

Response to: Need help fixing very simple bugs Posted March 11th, 2012 in Game Development

At 27 minutes ago, annanas wrote: -Accidentally posted the first post from a friend's account-

I do not know enough action-script knowledge to fix the bugs but from my little knowledge of it it seems like the bugs should not be that difficult to fix.

There's only two reasons why anybody would make your homework for you:

1. You are a hot girl (only works if you live in the same area).
2. You pay with real money (the exchange ratio for 'eternal gratitude' to dollars is 0.00).

Looks like you are out of luck bro.

Response to: newbie in pearil, one more try. Posted March 8th, 2012 in Game Development

At 24 minutes ago, DefLepper wrote:
At 6 minutes ago, PSvils wrote:
At 59 minutes ago, DefLepper wrote: myStage.addChild(myMenu);
Except you should never add children to the stage. The stage should only ever have one child, which is you Main/Document class.
Hence why I didn't say "stage" or "this." myStage could be any MovieClip, DisplayObjectContainer, etc. that you use for handling the objects you add.

myStage is pretty much always reference to the stage object, unless you are naming like a retard in which case my tip is that you should always give proper names to your objects.

Response to: newbie in pearil, one more try. Posted March 8th, 2012 in Game Development

What are viewing states?

Response to: List with images AS3 Posted March 4th, 2012 in Game Development

At 58 minutes ago, goombazx wrote:
At 1 hour ago, ProfessorFlash wrote: Do a google search on loading images in as3, and since you know how to make a list already, rest should be easy.
Thanks for reply, but i know how to load images in as3. The problem is, i don't know how to combine list and URLLoader.

So, in my case image loader is made so:

var image:URLRequest = new URLRequest(friends[4][i]);
imageLoader.load(image);
addChild(imageLoader);

How do i suppose to include this loader into my list?

Well, first of all you don't use the URLLoader to load images, it is used to load txt or xml. Use the Loader class to load the image. The image is then in the loader object you created, like your 'imageLoader', then just add it to your list where the imageLoader is your 'data'.

Response to: List with images AS3 Posted March 4th, 2012 in Game Development

Do a google search on loading images in as3, and since you know how to make a list already, rest should be easy.

Response to: AS2 Dynamic variable value change Posted February 17th, 2012 in Game Development

At 18 hours ago, Makakaov wrote:
At 1 hour ago, Jin wrote: Oh yea and this.

on (release) {
var tempAge:Number = Number(_root.age.text);
if (tempAge > 22 && tempAge < 46) {
trace("hi");
_root.gotoAndStop(5);
}
}
Still no effect. Thanks for the help anyway.

As suggested already, trace the variables. You constantly replying "didn't work, next code pls" is very annoying for people trying to help you. Trace the tempAge variable, trace if you are even triggering the function. Do shit yourself, damn.

Response to: SWC with multiple classes Posted February 17th, 2012 in Game Development

At 12 hours ago, InnerChild548 wrote: In the Flash IDE, you can export the SWC for a symbol and the SWC will contain a class definition for that symbol. For convenience + organization, how do you export multiple symbols in one SWC? I've tried selecting multiple symbols in the library using CTRL + Right Click, but the option to export is grayed out.

Didnt't even know you can export swc for each symbol individually, seems like a silly feature imo. To get all the classes you have given linkage names in the swc file you just go to publish settings and the flash tab and tick 'export swc'.

Response to: Checking when timer is done? (as3) Posted February 15th, 2012 in Game Development

Meh, he missed the 'Timer' word as did I. I'm a fool. Hahaha

*hides under the bed*
Response to: Checking when timer is done? (as3) Posted February 15th, 2012 in Game Development

At 2 hours ago, Mattster wrote:
At 2 hours ago, Sandremss128 wrote: TimerEvent.COMPLETE I think
Almost. . .

myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);
function timerComplete(e:TimerEvent){
trace("Timer complete!");
}

Not almost but exactly correct by Sanders. If you think that a working example is the correct answer, then your answer isn't correct either. "Almost..." as you would say it. You didn't set the duration and ticks and didn't start the timer. You just typed out the eventlistener adding part, which doesn't make your answer anymore correct.

Response to: As3 Fps Changes To Infinity Posted February 6th, 2012 in Game Development

At 2/6/12 06:43 AM, Dugh wrote: I downloaded a FPScounter class

Maybe that is your problem because it's the only question mark in what you have explained. Disable the fps counter and see if it still crashes.

Response to: Loadmovie + Newgrounds server Posted February 3rd, 2012 in Game Development

At 2/2/12 07:43 PM, phsychopath wrote: Well you're an idiot then aren't you? Tell me, if your hypothesis is correct, explain why this hasn't been deleted yet.

I try to give you a friendly warning, and you call me an idiot? Aren't you a friendly kid. If you know better than everyone else, what the fuck are you doing in this thread? Sanders gave you an answer, go upload your shit.

Response to: Loadmovie + Newgrounds server Posted February 2nd, 2012 in Game Development

At 2/2/12 11:28 AM, Sandremss128 wrote:
At 2/2/12 10:43 AM, ProfessorFlash wrote: I suggest you abandon this plan of yours or you might get banned and do this the correct way; contact Tom.
Could you point us to a reference that states this?

Nope.

Response to: Loadmovie + Newgrounds server Posted February 2nd, 2012 in Game Development

That's not how you do things in newgrounds. The file size limit is there for a good reason. If your flash is over that, then you ask Tom directly if he can bend the size limit for you. He has done that multiple times for different flashes. I believe the only criteria is that the flash must be good quality and Tom will be the judge of what is good quality. I suggest you abandon this plan of yours or you might get banned and do this the correct way; contact Tom.

Response to: XML data to Function Posted January 30th, 2012 in Game Development

I don't understand your thinking logic at all. Why would you want to write as3 code in xml? No need to answer that, let me just tell you that it is a terrible idea. That's not what you use xml for. You use xml for storing string type data. For example since you are doing an RPG, you could store all the text the NPC's in your game say in the xml. You could also of course expand on that and give other properties too, like give an attribute gender="male", so you'd know which skin to give in your game for the NPC when you create him. You use xml for stuff like that, defining properties and holding values. You write as3 code where it belongs, which isn't the xml file. Is this making sense to you?

Response to: Storing map data?!?! Posted January 30th, 2012 in Game Development

The question to ask yourself; do you need the flexibility that xml gives you? If you answer no, then use 2D array and a ready made editor like this: http://www.newgrounds.com/portal/view/56 2672
Or make your own editor if that isn't sufficient for your needs.

Response to: XML data to Function Posted January 29th, 2012 in Game Development

Can you give an example in pseudo code of what you are trying to do with the xml? I'm reading your posts and either you are trying to do something super stupid or I don't understand what you are trying to do. Really hard to help you when you are coming off very confusing. Examples please.

Response to: Custom Event Listener Classes Posted January 28th, 2012 in Game Development

At 1/27/12 11:18 PM, DavidHan wrote: Should I follow Sandrems method? I'm just afraid that things won't get garbage collected because there will be references, and plus if an object is removed from displaylist, there will be errors saying blahblah(); doesn't exist.

You should be in control of your application, not the other way around. These things don't happen if you know what you are doing.

Response to: Flash Tutorials are out of date Posted January 26th, 2012 in Game Development

They can't really be out of date when it comes to the code. There can be two explanations if you can't get the codes to work; you are using AS3 and I believe all those tuts are in AS2 or the code is written wrong already by the author.

Response to: Full Screen Button In As2? Posted January 22nd, 2012 in Game Development

Check the portal once in a while, you see how many troll submissions there are? What if someone makes a flash that opens a gayporn picture in fullscreen when you load the flash? If your requirement is that it must work on NG, then you are out of luck.

Response to: The Flash 'Reg' Lounge Posted January 8th, 2012 in Game Development

Many programmers working on the same game is same as many cooks in the kitchen, it doesn't really work unless you are professionals and know what you are doing.

Response to: Resize flash by resizing everything Posted January 8th, 2012 in Game Development

I haven't slept like at all, so my brain may not be the best right now, but vcam? You just zoom out in your new flash so it shows everything.