You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!

Author Search Results: 'ssjskipp'

We found 860 matches.


<< < > >>

Viewing 1-30 of 860 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91929

1.

None

Topic: Free PHP hosting

Posted: 11/16/09 11:21 AM

Forum: Flash


2.

None

Topic: ??Key Press instead of Key Down??

Posted: 11/12/09 03:38 PM

Forum: Flash

You need to learn how to understand programming logic. But here's an answer for you:
Let's see. We know when a key is being held down or not. But what we need to do is run an action ONLY ONCE when they press it, not EVERY time as they hold it. So, how can we transform the information of "Key is down" to "Key is down and I haven't done anything yet"?

Well, let's see. A Boolean is a true/false value. So if you make a "flag" like so:

onClipEvent(load){
var pressFlag:Boolean = false;
}

Then the the following logic:
Is the key down?
Yes -> Is 'pressFlag' true?
Yes -> Yes -> Then I've already run the press action. Don't do anything.
Yes -> No -> Then I should act like they 'pressed' the key. And I should set 'pressKey' to true, since I've ran the press actions.
No -> Then I should set 'pressFlag' to false, sine they're not pressing the key at all.

In code, that'd be:

if (key is down stuff){
if (pressFlag != true){
//Do some action
pressFlag = true;
}
} else {
pressFlag = false;
}

3.

None

Topic: New Platform Engine Fx

Posted: 11/02/09 01:03 PM

Forum: Flash


4.

None

Topic: AS3 questions

Posted: 10/27/09 03:16 PM

Forum: Flash

How could you not understand classes? You've been working with them since you started playing with AS2, really.

In AS2, Key is a static class that had some static constants for keycodes, as well as some static functions like isDown. MovieClip itself is a class that has a bunch of (thanks to extension) properties like x, y, rotation, alpha, etc.

In AS3, this is much more obvious and accessible. There's a definite chain of inheritance and it makes sense.

A DisplayObject has thee framework for position, transformation, and the basic functions like hitTest and whatnot. A Sprite is a DisplayObject with 1 frame, and is a DisplayObjectContainer. A MovieClip is a Sprite with multiple frames and dynamic properties.

So, when you right click your bullet in the library and hit 'Export for ActionScript', did you notice that instad of Linkage Name, it has a Class name? Why not try to define that class name, and create a seperate .as file (of the same name), save it in the same folder as the fla, and define the insides as a class.

There you go. Classes.

As for your problem, you really need to understand how flash works...

Also, Gust'll probably be mad at me for saying thing, did you ever think to look up the docs? "_root" is still there, now it's just "root'.


5.

None

Topic: Eval doesn't work :S

Posted: 10/27/09 03:08 PM

Forum: Flash

And if you want to refer to an instance name with a variable part (IE: bullet0, bullet1, bullet2, ...), you can use this method of accessing object params:

object['paramname'];

so

myMovieClip['bullet'+i];

Where i is a variable. Same as writing (if i were 0)

myMovieClip.bullet0


6.

None

Topic: AS3: Point of proper getter/setters

Posted: 09/30/09 10:30 PM

Forum: Flash

First off, the PHP-esque variable names don't cause errors (at least in AS3). You can have a sigil if you want (_, $, @, etc.) as long as they're not keywords or operators.

To answer your question a bit more, part of it is for documentation, and part of it is for when you deploy these packages.

If you're writing a class that other people do NOT know the inner working of, having values set to 'public' means they can access them directly. To people downloading + using these classes, that means that these are values you're SUPPOSED to modify. Confusing.

As for documentation, when you document your class, you'd have to specify that in order to modify this property, you must use this fucntion. Which, in a large class with a lot of things going on, can confuse and expand the documentation and usability.

In any sense, if you're the ONLY person using the code, or it's not a big thing, then you can do whatever the hell you want. I mean, you can even make a class specifically to handle changing values in other classes. Not the best method, but one that'll work. It really jsut comes down to what you like to do and what works best.


7.

None

Topic: AS3: Point of proper getter/setters

Posted: 09/30/09 08:15 PM

Forum: Flash

There's a lot of uses, but simply managing data in and data out AREN'T one of them. If you're returning and setting the same variable, and nothing else, there's no use for using a getter or setter.
HOWEVER
Say something was dependent on that value, or there's variables that are related to the one in question. A translation system. Take temperature for example. Say you wanted a class to work with temperature. You can have:

public class Temperature {
	private var $Celcius:Number;
	private var $Farenheit:Number;
	private var $Kelvin:Number;

	public function Temperature(degreeFarenheit:Number):void {
		$Farenheit = degreeFarenheit;
		$Celcius = //convert F to C
		$Kelvin = //Convert F to K
	}

	//Setters, however, change the others
	public fucntion set celcius(newValue:Number):Number {
		$Farenheit = //Convery newValue to F
		$Celcius = newValue;
		$Kelvin = //Convert newValue to K
	}
	
	public fucntion set farenheit(newValue:Number):Number {
		$Farenheit = newValue
		$Celcius = //Convery newValue to C
		$Kelvin = //Convert newValue to K
	}
	
	public fucntion set kelvin(newValue:Number):Number {
		$Farenheit = //Convert newValue to F
		$Celcius = //Convery newValue to C
		$Kelvin = newValue
	}

	//Getters are the same, since we stored the data
	public function get celcius():Number {
		return $Celcius;
	}

	public function get farenheit():Number {
		return $Farenheit;
	}

	public function get kelvin():Number {
		return $Kelvin;
	}
}

That's a bad example, the the useful concept is there. You may come across (and probably will) an instance where you want to change something (say, a state like "fight" or "run'), and when you do that you want the class to do something more (like, play an animation, or run a specific routine).

Same thing with getters. Say you have a value that can be obtained from data in the class, but isn't explicitly there. You can run a function and return a value behind the scenes, but to the user you're simply doing:

this.angleToPlayer;

8.

None

Topic: Diagonal scripting?!

Posted: 09/25/09 09:44 PM

Forum: Flash

Everyone wondering why:

Unless you embed the fonts, you CAN NOT rotate or skew Dynamic or Input text field.


9.

None

Topic: As 2.0 Help (deadline for school)

Posted: 09/14/09 10:23 PM

Forum: Flash

when you target an object to apply a rollover function, or any of the 'on' functions, it's formatted like so:

target.onRollOver = function(){
//code
}

10.

None

Topic: can't use flash

Posted: 09/14/09 10:21 PM

Forum: Flash

It'd help if we knew what errors were comnig up.


11.

None

Topic: music visualizations actionscript

Posted: 09/14/09 11:33 AM

Forum: Flash

AS3 included a function, computeSpectrum, which is the only way for flash to create a music visualization "on-the-fly".

If you want to do it in AS2, you'll need SOME kind of data to work with. The sound simply isn't enough.

So, tl;dr, YOU CAN'T DO IT IN AS2.


12.

None

Topic: [AS3] Weapon Type problem...

Posted: 09/14/09 11:32 AM

Forum: Flash

I think he's talking about it coming from the registration point instead of the barrel of the gun.

You can do a few things. The easiest way is to make a movieclip inside the gun at the barrel, where you want the bullets to come out, then use localToGlobal to convert it's coordinates (as the gun rotates) to stage coordinates.

Alternativly, you can use an offset when you create the bullet. I assume you have a vx and vy variable for when they fly, well, when you first position the bullet try adding to it's additional x and y a constant times the velocity component:

x = player.x + 10*vx;
y = player.y + 10*vy;

Make sense?


13.

None

Topic: AS3: Access addChild from outside

Posted: 09/13/09 02:07 PM

Forum: Flash

They told you what to do but didn't explain why that works.

When you import a class, that just means "Hey. Include this data so I can access it."

When your class extends another class, that means "Hey. Make me be an exact copy of the function I extend, but add these nifty things"

So, when you extend Sprite, that means your class has everything a Sprite has (addChild, etc.), AND everything you add to it (methods, properties, etc.)


14.

None

Topic: How the hell do people get

Posted: 09/13/09 01:30 AM

Forum: Flash

You have a server that you host the real .swf on, then spread around a loader swf that loads in your real .swf from your server.

Beware that your server needs to be able to handle downloads from thousands of other places at once, over a long peroid of time. Bandwidth apleanty.


15.

None

Topic: how do you code AS3

Posted: 09/11/09 09:21 AM

Forum: Flash

*sigh*

Flex is just a programming IDE used to create .swf files, it's essentially Flash without the drawing, frames, and all that stuff. I much prefer Flash Develop when it comes to working with .as files.

If you take the time to go learn OOP, you'll understand the benefits and drawbacks (if any...mostly just patterns in code that you'll be re-writing unless you take the time to make your code expandable) of adopting that system over solely coding on the frame.


16.

None

Topic: how do you code AS3

Posted: 09/10/09 02:14 PM

Forum: Flash

external as files hold classes.
Classes are a part of a package filled with related classes.
Go look up tutorials on Object Oriented Programming to learn about them.

AS3 can be done completely on the frame. Just learn the flow of the language and adapt it.


17.

None

Topic: dynamic text

Posted: 09/05/09 08:35 PM

Forum: Flash

*sigh*

var testString:String = "This is a test string;\nThis is line 2;\nThis is line 3;\nThis is line 4;\n";
myDynamicText.text = testString;

var stringArray:Array = myDynamicText.split(";");
for (var i = 0; i < stringArray.length; i++){
     trace(stringArray[i]);
}

18.

None

Topic: AS3 + Flash for Games

Posted: 09/05/09 01:27 PM

Forum: Flash

It really depends on what style you have when you program.

The best way though is to take advantage of OOP. Flash's actions panel sucks balls, and it's a bitch to edit .as files with it, so you may want to use Flash to set up the .fla. That includes animations, the library, and setup of the game (frames, objects, etc.). Then to program the core of the game logic is to external .as files (you know, have your classes and whatnot), but use a different editor for that (Like Flash Develop, Flex, what have you).

You can do it all in Flash. But not all on an .fla.

Essentially, when making games, you need some way of creating, managing, and removing things. However you do that is up to you. If you like OOP, you can use a bunch of external .as files containing your classes, things like Enemies, Events, Player, World, Physics, what have you.


19.

None

Topic: dynamic text

Posted: 09/04/09 11:31 AM

Forum: Flash

Well, there's supposed to be SOME kind of character, other than new-line, that separates them. Either a semi-colon, pipe, whatever.

Then just String.split() to get an array for each, and then loop through that and get individual values.


20.

None

Topic: [AS3] Interesting Problem

Posted: 09/01/09 11:50 PM

Forum: Flash

Why not just have a Ship class with it's own internal laser class? And then each ship instance, which can be created at a random interval, has its own method of firing the laser at a random interval, seperate from any other instance?


21.

None

Topic: Instance varable

Posted: 09/01/09 03:23 PM

Forum: Flash

*sigh* GustTheASGuy gave you the perfect example, and no one even noticed.

You can access properties of objects using strings like he showed:

object["property name"];

So, in ANY complex case, you can do this. If you need to go further than 1 scope, write a custom class that splits the string by ".", loops through the result on the object and returns a reference. EX:

Say you want a string to access:

_root.taco.banana._x

So, you have:

var refStr:String = "_root.taco.banana._x";

Now to get the actual reference, you can have something like this:
AS3, you can translate easily if your original code is 'complex'

var taco:Object = new Object();
taco.salsa = {flavor:"smokey", value:100};
taco.shell = "soft";
taco.meat = "beef";
taco.spicyness = 9;

function fetchRef(input:String, baseObject = null) {
	var outRef;
	var prop = input.split(".");
	if (!baseObject){
		outRef = root;
	} else {
		outRef = baseObject;
	}
	
	while (prop.length){
		try {
			outRef = outRef[prop.shift()];
		} catch (error:Error){
			trace("Returned Error: ", error);
			return null;
		}
	}
	
	return outRef;
}

var refStr:String = "taco.meat";
trace(fetchRef(refStr));

var tmpRef = fetchRef("taco.salsa");
trace(tmpRef.flavor, tmpRef.value);

22.

None

Topic: A wall.

Posted: 09/01/09 03:10 PM

Forum: Flash

I know what you wanted. I gave you an answer of exact methods on doing this. Essentially, I'm saying:

Write your own god damn code

Look up things like hitTest (I mentioned above), and other things. You can even do it math based if you were so inclined. But yes, lok up things like hitTest, instance names, and shape flags in the documentation, and you'll find what you're after.


23.

None

Topic: A wall.

Posted: 09/01/09 02:13 PM

Forum: Flash

Simplest wall for your falling ball:

You probably have an event that runs every frame, or some code that repeats at the frame rate. This code changes the x and y position of an object, right?

So you have velocity and position.

Now, since this routine runs every time the ball moves, you can check to see where it was, and where it'll move to, correct?

So, you have the final position of the moving routine.

Now, let's pretend the "ground" is a line across the bottom of the screen. In Flash, the top has a y value of 0, the bottom has a y value equal to the stage height. So, let's say the "ground" is 25 pixels above the bottom of the screen. If you're using the default stage size, that'd be 550-25, which is 525. Now we have a maximum possibly y value.

So, you have where the ball came from, where it ended, and the furthest it can go before doing something different than falling. Here's an example of how that can be applied (pseudo code):

First, initalize some variables once.

y velocity = 0
gravity = 0.5
bounce factor = 0.9
ground = 525

Next, we have the routine that'll run at the frame rate.

y += y velocity
y velocity += gravity <--that's where you stop if it just falls. Now let's test the ground.
if (y >= ground){ <--simple if statement. Will run the logic inside the {} if the condition is true
y = ground <-- the ball may sometimes pass beyond the ground if the increment is too large. This will remove that error
y velocity = -y velocity * bounce factor <--simple bounce logic. The velocity will change direction after the collision, but at a smaller value. That's where the bounce comes in.
}

And that'll make a 'wall' at y = 525.
You can replace the hard-coded number with any method of detecting a collision.


24.

None

Topic: A wall.

Posted: 09/01/09 01:25 PM

Forum: Flash

Many ways to do a wall:

Using math, figure out a line, and then test the point on object A closest to the line to see which side it's on. If it's piercing the line, impulse penalty so it's no longer piercing the wall, then do the math to figure out a result vector from collision.

A shape that you hitTest against, and if the hitTest is true (can be shapeFlag, or entire object, depending), perform a collision reaction.

Hard-code maximum coordinates, and set a way to check to see if you're within these bounds, and if you are, resolve collision.

Basically, the idea is thus:
1. Figure out when I'm going to collide with a wall
2. Figure out how I collided
3. Figure out how to resolve that collision

So, go ahead, you know things like position, velocity, acceleration, and depending on how you set it up, you know where the 'wall' is. Apply some knowledge.


25.

None

Topic: can anybody fix this code?

Posted: 09/01/09 01:20 PM

Forum: Flash

It just kind of stops.

So, no, you can't "fix" it...


26.

None

Topic: Flash Online Highscore

Posted: 09/01/09 01:14 PM

Forum: Flash

I've made a lot of attempts to stop them without having to look, but in the end, the best way is to have a PHP script that'll monitor hacker trends. For instance, keep track of IP addresses, reasonable scores, etc. Have a script that'll deny IPs that send immense scores and adds them to a blacklist. There's no way to see WHERE the connection is coming from with just flash, but you can see WHO it's coming from.


27.

None

Topic: Flash Online Highscore

Posted: 08/31/09 09:12 PM

Forum: Flash

No, your website needs a policy file saying newgrounds can access it.

EX:

[swf file] wants to connect to [your website].
Flash's security sandbox kicks in:
Does [your website] allow where [swf file] is being hosted access? If so, connect, if not, SecurityError.

Look up the policy file, how it's formatted, and how to set one up. They tell you all that.


28.

None

Topic: Vcam testing for 2P platformer

Posted: 08/31/09 09:10 PM

Forum: Flash

May want to use Stage.width and Stage.height for stage size.


29.

None

Topic: Right-Click Actions ?

Posted: 08/31/09 09:07 PM

Forum: Flash

The closest thing to what you're looking for (that *should* work on any machine as long as JS is enabled):
-Invisible layer over the .swf on the .html page
-Javascript intercepts the right click
-Sends the right clicked action to Flash

And that requires a special web page for your flash stuff.

Base line is, don't use the right mouse in a flash game. There really isn't a place for it anyway.


30.

None

Topic: Is this possible in any AS?

Posted: 08/31/09 09:05 PM

Forum: Flash

Never worked with scenes (they always cause trouble for me), but I'm pretty sure you can have a class that plays the sound or something.


All times are Eastern Standard Time (GMT -5) | Current Time: 09:09 AM

<< < > >>

Viewing 1-30 of 860 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91929