Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsAt 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.
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.
At 1 hour ago, CherinoGears wrote:At 21 hours ago, scearezt wrote:Ah, i suspected as much but i wasnt 100% certain, thanks for letting me know.At 1 minute ago, CherinoGears wrote: To my knowledge you can use array.splice(); to remove elements from an array.Hi!
If im storing movieclips inside of an array, and i use splice to remove them, does that remove them from the display list?
Only removes from the array. You can try it too in a new file. (=
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?
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!
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?
Well this is just the dumbest topic on the bbs.
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"));
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.
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.
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.
At 24 minutes ago, DefLepper wrote:At 6 minutes ago, PSvils wrote: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.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.
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.
What are viewing states?
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'.
Do a google search on loading images in as3, and since you know how to make a list already, rest should be easy.
At 18 hours ago, Makakaov wrote:At 1 hour ago, Jin wrote: Oh yea and this.Still no effect. Thanks for the help anyway.
on (release) {
var tempAge:Number = Number(_root.age.text);
if (tempAge > 22 && tempAge < 46) {
trace("hi");
_root.gotoAndStop(5);
}
}
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.
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'.
Meh, he missed the 'Timer' word as did I. I'm a fool. Hahaha
*hides under the bed*
At 2 hours ago, Mattster wrote:At 2 hours ago, Sandremss128 wrote: TimerEvent.COMPLETE I thinkAlmost. . .
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.
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.
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.
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.
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.
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?
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.
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.
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.
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.
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.
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.
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.