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: 'PCpr0gramer'

We found 316 matches.


<< < > >>

Viewing 1-30 of 316 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11

1.

None

Topic: AS3 Object member function access

Posted: 08/12/09 08:40 PM

Forum: Flash

I give you sir, one internet.

Thank you, that was it. I swear I tried that multiple times, but I must have syntax error'd somewhere.

Thank you.

At 8/12/09 08:32 PM, hesselbom wrote: So like a class with a couple of static methods? That is still pretty basic, actually.

package
{

public class Physics
{

public static function methodName (a : Number, b : Number) : Number
{
return a + b;
}

}

}

Sorry if my ActionScript syntax is a little rusty. Anyway, if you put a class like that in your root folder/package you will be able to access it from anywhere, like

var something = Physics.methodName (1, 2)

2.

None

Topic: AS3 Object member function access

Posted: 08/12/09 07:48 PM

Forum: Flash

@zuperxtreme
Right idea! Wrong implementation... That is what I'm looking to do, it just doesn't work that way. Thank you very much though.

@ the guy above, no -- that's not what I'm going for and I do understand OOP, I'm quite adept at C++, this is just my first attempt at AS3.

I'll keep looking, I'm sure it's a pretty common thing to do.

Really what I'm looking for is a way to make a "library" of common physics functions like vector addition, dot product, etc... and to be able to include them anywhere and use them in a way like the Math class.


3.

None

Topic: AS3 Object member function access

Posted: 08/12/09 07:23 PM

Forum: Flash

That was allowed before as3, but now (as I understand) the Math class can not be extended. That code yields the error:

1016: Base class is final.

I was thinking more, how would I create a class (as for vector functionality) and use it in another class (as for use in a ball MC).

I have the ball MC working as type "Ball" (from class Ball.as). How would I create a class, "Vector" for use in class "Ball" (or any other class for that matter)?


4.

None

Topic: AS3 Object member function access

Posted: 08/12/09 07:01 PM

Forum: Flash

Here's one: If I wanted to add vector addition functionality to AS3, how would I do the equivalent of extending the math class to get something like...

velocity = Vect.add(vlocitya + velocityb);


5.

None

Topic: AS3 Object member function access

Posted: 08/12/09 06:07 PM

Forum: Flash

I get the logic there. I tried including the class file at the top of ballA's class with

import ballB;

and later using ballB's function

ballB.updatePosition();

but I get the error message: 1061: Call to a possibly undefined method baller through a reference with static type Class.

Any ideas?


6.

None

Topic: AS3 Object member function access

Posted: 08/12/09 05:51 PM

Forum: Flash

Hello all,

I'm introducing myself to AS3 and I've run into a problem.

Say I have two classes, each linked to an object on the stage. One class called ballA, the other ballB.

If ballB's base class contains the public function updatePosition(), is it possible to access that function from within ballA's base class?

Thanks,
Ian


7.

Questioning

Topic: Minor problem with flash

Posted: 05/09/09 12:32 AM

Forum: Flash

When colliding two objects and having them move away from each other so that they are just barely touching, sometimes flash lets the objects overlap in one frame and then shows their correct positions in the second. Other times it seems, flash computes the correct positions and then displays their positions. Is there any way to make it so that the objects do not re-display until their correct (non-overlapping) positions are processed?


8.

None

Topic: Reflection of a point over a line

Posted: 05/03/09 10:51 AM

Forum: Flash

While your solution was not dead on, it did lead me to transformation matrices, and essentially the system works like this:

First, the angular distance between the point to be reflected and the line over which it is to be reflected must be determined (this is assuming the line's y-intercept lies at 0).

point A = (0, 1)
line Q = y = x

The difference between the angular measurements of these two objects is 45 degrees.
Doubling this, we get the rotational difference (and thus the rotational difference): 90 degrees.

Next a transformational matrix is used (see included picture) to determine the new x and y coordinates of the point (x' and y').

I hope this helps everyone out there (doubtfully) who needs this kind of information.

Reflection of a point over a line


9.

None

Topic: Reflection of a point over a line

Posted: 05/03/09 10:26 AM

Forum: Flash

Thank you so much, but could you slow that down a bit (if you have time).


10.

None

Topic: Reflection of a point over a line

Posted: 05/03/09 10:12 AM

Forum: Flash

That would work if I was doing it graphically, but I need a way to do it with math entirely. Thank you very much for the reply though.


11.

None

Topic: Shape flag?

Posted: 05/03/09 10:00 AM

Forum: Flash

It allows you to test a single point against a shape. It's useful for shapes that aren't squares, like circles or other oddies. The format is this (assume the object to be tested is a circle, and we're testing it against the x and y position of a bullet.)

if(circle.hitTest(bullet._x, bullet._y, true)){
}

That's for AS2.


12.

None

Topic: Reflection of a point over a line

Posted: 05/03/09 09:54 AM

Forum: Flash

I'll include a picture to aid in discussion. Anything is helpful, even a resounding, "You've got me!" is reassuring.

Reflection of a point over a line


13.

None

Topic: Reflection of a point over a line

Posted: 05/03/09 09:28 AM

Forum: Flash

For the past two days I've searched for the method to reflect a point ie: (-1, 3) across a line ie: y = 1/5x. Any help or direction would be greatly appreciated.

Thanks,
Ian


14.

None

Topic: Var define in class

Posted: 10/01/08 06:31 PM

Forum: Flash

I have vars set as my document class. The code in the class vars is:
package {

import flash.display.*;
import flash.events.*;

public class vars extends MovieClip {

var jackson:Number = 3

trace(jackson)

}

}

When I run the program I get the following error, "1120: Access of undefined property jackson."

I know it's a simple fix. What is wrong?


15.

None

Topic: AS3 addChild()

Posted: 08/15/08 11:26 PM

Forum: Flash

Thank you for the reply. Unfortunately, getClassByName() no longer exists. getDefinitionByName() replaces it I believe.

Instead of doing that, I used a switch statement. It's kind of dirty, but it's solid.

Thanks again for the reply.


16.

None

Topic: AS3 addChild()

Posted: 08/15/08 03:09 PM

Forum: Flash

Hey there,

I'm working on the new game in the *oss series and I'm converting everything to AS3. Horray! I'm dynamically loading a "piece" of ground from the library. Each ground piece is a different class and I want to know a faster way to load each piece at the appropriate time than to call for instance,

g1 = new ground1e1();
addChild(g1);
//then level change
g2 = new ground1e2
addChild(g2)

I was thinking something along the lines of.

this["g"+i] = new this["ground1e"+i]();
addChild(this["g"+i]

But that's just too logical.

Any ideas?


17.

None

Topic: AS3 Class

Posted: 04/23/08 04:28 PM

Forum: Flash

At 4/23/08 04:26 PM, mike wrote: sorry, I omitted some stuff while typing it up. :) Try:

package {
import flash.display.*;
import flash.events.*;

public class MyClip extends MovieClip {
public function enterFrameHandler(e:Event):void {
x++;
}
public function MyClip():void {
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}

To use classes in a different package (which is all of the built-in classes), you have to import them. Also, classes have to be inside a package to be externally visible, and you need to set your class as "public". Good luck! :)

Woot. That did it. Thank you very much. Mike, I see you have a special icon and you've been around since 2000. Are you a founding developer, or just a faithful user?


18.

None

Topic: AS3 Class

Posted: 04/23/08 04:16 PM

Forum: Flash

My current code:

import flash.display.*;
import flash.events.*;

class MyClip extends MovieClip {
public function enterFrameHandler(e:Event):void {
x++;
}
public function MyClip():void {
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}

Now I've solved the event problem, but I get a new error:

5007: An ActionScript file must have at least one externally visible definition.

Whats that all about?


19.

None

Topic: AS3 Class

Posted: 04/23/08 04:06 PM

Forum: Flash

At 4/23/08 03:45 PM, mike wrote: Sure thing! You'll need to make a separate AS file, called, say, MyClip.as. You can throw the above code in there. "class MyClip extends MovieClip" means that MyClip inherits all of the MovieClip properties -- literally, it is a specialized MovieClip. The constructor (function MyClip()) creates the enterFrame event listener. This event automatically gets triggered every frame. enterFrameHandler handles the event and changes the position of the MovieClip.

In Flash, you'll want to right click on a symbol goto Linkage properties, export it for AS, and set its class name to MyClip. This binds that art to that class name -- whenever you create a MyClip (whether by placing it on the stage or doing "new MyClip()" in AS), it will use that art.

Allright, I have all of that in place, but when I run the program I get these two errors:
1017: The definition of base class MovieClip was not found.
5000: The class 'MyClip' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.

now if I add:
import flash.display.*;
to the top of the class, those two errors get replaced by

1046: Type was not found or was not a compile-time constant: Event.

Thank you for your help! I've almost got it.


20.

None

Topic: AS3 Class

Posted: 04/23/08 03:21 PM

Forum: Flash

That second one looks like its what I'm looking for, would you mind breaking it down a little?


21.

None

Topic: AS3 Class

Posted: 04/23/08 02:54 PM

Forum: Flash

I'm learning AS3 and I'm wondering how to trigger an event every frame using classes. To keep it simple: How would I make a class to move every MovieClip's x to the right every frame?
I've learned how to trigger an event once, as soon as the MovieClip has been made with a class, but every frame. Any help?


22.

None

Topic: AS3 Calling function

Posted: 04/22/08 01:30 PM

Forum: Flash

I've found a solution to my problem through an array. I pass the name of my object through the array and set it to call the function from the main timeline. It's effective.

One more question:
I haven't experienced any lag with AS3 so far, what exactly makes it so much faster than AS2?


23.

None

Topic: AS3 Calling function

Posted: 04/22/08 01:20 PM

Forum: Flash

At 4/22/08 01:05 PM, GustTheASGuy wrote: It's because they're strictly typed and the properties of the subclass you define aren't implied by DisplayObject. Therefore you need to 'MyClass (root).property' cast it. Or even better, don't use those properties at all. They don't make sense in OOP perspective.

I'm having a hard time grasping the way AS3 expects me to make objects modular. I used to be able to drag an item such as a pendulum from the library, on stage and it would work because I put code in the pendulums timeline that called functions on _root. What should I do now?


24.

None

Topic: AS3 Calling function

Posted: 04/22/08 12:42 PM

Forum: Flash

I'm coding a new game of mine in AS3 and I've got to say its a sleek language. I have a question regarding the calling of variables from INSIDE a MC. In AS2, to access a variable that was on the main timeline from inside a MC all I had to say was _root.xspeed. Now, it seems in AS3 theres no way to do this...arg. Really, what I'm trying to do is call a function on the main timeline from inside a MC. Does anyone know how to do this? Stage.function() doesn't work, parent.function() doesn't work...halp.


25.

None

Topic: Game Engine

Posted: 04/02/08 10:07 PM

Forum: Flash

Well, right now it's just an engine. There's literally no goal at the moment. Contribute: what would you like to see in it?


26.

None

Topic: Game Engine

Posted: 04/02/08 10:02 PM

Forum: Flash

At 4/2/08 09:58 PM, NG-Unit wrote: Found a small glitch

if you jump on the wall to the left (where you can fall down the pit thing, the wall on the left) if you jump up it off the wall and you land on the corner you kinda just stay there and do some shakey thing for a second

(in the screeny it doesn't look like anything, but you kinda just stay there and turn left and right a couple of times)

...How many times exactly, infinite loop sort of times or like...6 times.
Thanks for finding that.

And below poster: What do you mean by add something original? It's all come from my brain so far. Do you have something in mind?


27.

None

Topic: Game Engine

Posted: 04/02/08 09:55 PM

Forum: Flash

The background is bitmap, but putfile stretched the .swf by about 3 pixels, throwing everything off. It looks nice when the dimensions are correct.

Thanks for the input, but please go on: I'm more code and art than storyline and concept =-]


28.

None

Topic: Game Engine

Posted: 04/02/08 09:42 PM

Forum: Flash

I'll set the background up better, it is a little confusing.
I'm thinking of using the engine for a puzzle platform. The player has to navigate the terrain to unlock a portal to the next level. 10ish levels total, score goes to a highscore table at the end, lowest time gives you a higher rank.

Any suggestions from there?


29.

None

Topic: Game Engine

Posted: 04/02/08 09:26 PM

Forum: Flash

Sorry about the control issues; should have explained them.

Left/Right arrow keys to move Left/Right. Up to jump, the white thing on the ground on the left side of the screen is a bounce board. To wall hang press the corresponding left/right arrow key while in mid air, next to a wall.


30.

None

Topic: Game Engine

Posted: 04/02/08 08:52 PM

Forum: Flash

I was thinking something along the lines of a puzzle, but what kind of goals/features would you like to see?


All times are Eastern Standard Time (GMT -5) | Current Time: 03:40 PM

<< < > >>

Viewing 1-30 of 316 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11