Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


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

We found 911 matches.


<< < > >>

Viewing 1-30 of 911 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 92031

1.

None

Topic: Rundown of variable protect levels?

Posted: 10/11/08 05:07 PM

Forum: Flash

Variables declared in the timeline become part of the object whose timeline you're coding in. They'll be available whatever frame or scene you go to within that object.

I don't think you're allowed to use private/public etc for timeline variables. I guess they aren't part of the class definition so they just get dumped into the object's lookup table, which seems to be public.


2.

None

Topic: Optimisation/indu vidual filters

Posted: 10/11/08 04:56 PM

Forum: Flash

if (red == true) {
this.filters = [];
this.filters = [redfilter];
}
if (green == true) {
this.filters = [];
this.filters = [greenfilter];
}

You're applying the filters to this, when you should be applying them to shot. And setting the filters to an empty array right before you change them again is a bit redundant.

if (red == true) {
shot.filters = [redfilter];
}
if (green == true) {
shot.filters = [greenfilter];
}


3.

None

Topic: AS2 question

Posted: 10/11/08 12:46 PM

Forum: Flash

I guess if you want to leave it black, you could leave the multipliers as 0 and use the offset values instead

_root.dot.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 255, 0, 0, 0); // add 255 red to the color


4.

None

Topic: AS2 question

Posted: 10/11/08 12:35 PM

Forum: Flash

At 10/11/08 11:24 AM, masterlink950 wrote: Well it would seem neither of those work (setColor or theColour). I even tried a few different things.
I believe I got a little confused from your description's.

Here is the actionscript I THINK I'm supposed to use, correct me if I'm wrong (Which I'm pretty sure I am...)

onClipEvent (load) {
var red = true;
if (red == true) {
_root.dot.setRGB(0xFF0000);
}
}

setRGB is deprecated anyway. I would use ColorTransform to do it

onClipEvent(load) {
import flash.geom.ColorTransform;
var red = true;
if (red == true) {
_root.dot.transform.colorTransform = new ColorTransform(1, 0, 0, 1, 0, 0, 0, 0);
}
}

The first 3 values of the ColorTransform are red, green and blue multipliers (0-1 range), and the 4th is an alpha multiplier. The other 4 are offsets to add r, g, b, a to the color. All you really need to worry about are the first 3 and leave the 4th as 1.


5.

None

Topic: AS2 question

Posted: 10/11/08 12:04 PM

Forum: Flash

Too slow :(

And I messed up the order in my explanation too :/


6.

None

Topic: AS2 question

Posted: 10/11/08 12:02 PM

Forum: Flash

You can bitshift the values of the components into their proper positions (8 bits of red, 8 bits of blue, 8 bits of green)

var r:Number = 255;
var g:Number = 255;
var b:Number = 0;
var rgb:Number = (r << 16) + (g << 8) + b;

In as3 you could use uints.


7.

None

Topic: Html Tags In Flash

Posted: 10/11/08 09:22 AM

Forum: Flash

He wants only part of the string to be bolded, so some weird 2 frame workaround doesn't get the job done. And this problem has everything to do with html tags.

textBox.html = true;
textBox.htmlText = "Hello, im <b>BILLYPROGRAMMER</b>";


8.

None

Topic: public function to control timeline

Posted: 10/10/08 08:53 AM

Forum: Flash

Flash doesn't like parent swfs messing with child swfs too much. I'm not sure of the specifics, but that could well be the problem.


9.

None

Topic: public function to control timeline

Posted: 10/10/08 05:16 AM

Forum: Flash

If your class extends MovieClip, it inherits all the same properties and methods of MovieClip, so yeah you could use gotoAndStop etc.


10.

None

Topic: Movieclip Depth Problems

Posted: 10/09/08 07:30 PM

Forum: Flash

At 10/8/08 05:17 PM, DanBomer wrote: onClipEvent (enterFrame) {
thisDepth=this.getDepth(), otherDepth=_root["MC"+i].getDepth();
if (this._y>_root["MC"+i]._y && otherDepth>thisDepth) {
this.swapDepths(_root["MC"+i]);
}
if (_root["MC"+i]._y>this._y && thisDepth>otherDepth) {
this.swapDepths(_root["MC"+i]);
}
}

You never say what i is. You probably want some kind of for loop there.


11.

None

Topic: Movieclip Depth Problems

Posted: 10/08/08 01:16 PM

Forum: Flash

The bullets seem to be instant, so you could check if the _y of the player and the _y of the enemy are within a certain distance when you fire

if (Math.abs(player._y - enemy._y) < someDistance) {


12.

None

Topic: curveTo placement problem

Posted: 10/08/08 05:55 AM

Forum: Flash

curveTo isn't supposed to go through the control point that you supply. It uses it as a guide, like a corner that the curve aims at.
Anyway, you could probably come up with an exact solution if you did some research into bezier curves, but you may as well just fudge it by multiplying the y by some constant.

Try something like

moveTo(p1._x, p1._y);
curveTo(p3._x, p1._y + (p3._y - p1._y) * 1.5, p2._x, p2._y);

and then adjust the 1.5 until it looks about right.


13.

None

Topic: Mc Hierarchies, Depths, Etc. As3

Posted: 10/07/08 01:15 PM

Forum: Flash

Downloading the Flex SDK doesn't magically impart knowledge.

by the way,

and if so, what problems am I going to run into now that I've got into the habit of making engine wrappers like these for all my game visuals?

You won't run into any problems. One really nice thing about moving from as2 to as3 is that you can add and remove things from the display list, or change their parent without having to destroy them or make new ones. When you start a battle you can removeChild your world_engine_mc and addChild your battle_engine_mc. It's a bit more elegant than just changing the visibility of things.


14.

None

Topic: Mc Hierarchies, Depths, Etc. As3

Posted: 10/07/08 12:23 PM

Forum: Flash

However, part of me dreads that this is no longer the case in AS3, that all the firework_explo style movieclips would actually now be on stage level or on the DisplayObject alongside the firework_mc and be depth managed seperately to it.

You choose where in the heirarchy they go. just call addChild on whatever you want to be their parent, eg

firework_1_mc.addChild(new FireworkExplosion());


15.

None

Topic: Array concept problem.

Posted: 10/06/08 11:11 PM

Forum: Flash

By the way, in the code you posted, at some points it looks like .place is meant to hold an index, and at other parts it looks like its meant to hold an actual value.

Should

if (windowArray[i].place>9) {

be

if (windowArray[i].place == placeArray[9]) {

?


16.

None

Topic: Array concept problem.

Posted: 10/06/08 11:08 PM

Forum: Flash

I'd keep a marker of where the user has scrolled to, then use modulo to get the placeArray index to wrap around back to 0.

for (var i:int = 0; i < windowArray.length; i++) {
windowArray[i].place = placeArray[(i + marker) % placeArray.length];
}


17.

None

Topic: clearInterval problems

Posted: 10/06/08 12:01 PM

Forum: Flash

I'm really not sure, sorry. It looks like the only place where you set the interval, you clear it right beforehand, so I don't know ow a second one would be starting.

You don't have any other code that calls enemyInterval or anything like that, right?


18.

None

Topic: object zooming problem

Posted: 10/06/08 11:58 AM

Forum: Flash

without the object moving

You have to move it somehow. If you need it to keep its x and y in relation to other things, you could put them all in a container MovieClip and move that instead.


19.

None

Topic: clearInterval problems

Posted: 10/06/08 08:55 AM

Forum: Flash

What code do you have on your reset button?


20.

None

Topic: input text problem

Posted: 10/04/08 09:27 AM

Forum: Flash

At 10/4/08 08:25 AM, ProfessorFlash wrote:
At 10/4/08 08:21 AM, Moonkey wrote: change it to

ansr1 = inputCode.text;
It seems to me his code is in the button, not on frame. So use this instead:

ansr1 = _root.inputCode.text;

Code on buttons (but not MovieClips) uses the scope of the button's parent, so either one should do fine.


21.

None

Topic: input text problem

Posted: 10/04/08 08:21 AM

Forum: Flash

change it to

ansr1 = inputCode.text;


22.

None

Topic: Question about public methods

Posted: 10/03/08 03:51 AM

Forum: Flash

I'm surprised no one's chimed in with a big academic post about this.

In general, you want classes to be responsible for their own inner workings, and only allow public access in limited ways. As long as they do their job, other classes shouldn't really care about how it's done. There's a couple of reasons for that.

As an example, think of an OrderedList class that you might write. There's a few public methods that you would naturally want it to have - add(item), remove(item), getFirst(), getLast() etc. Outside classes don't need to know about how the list is stored and maintained.
You might decide to store all the items that are added in an array, and you would want that array to be private. If it was public, other classes could get in and manipulate it in ways that could interfere with how you are maintaining the order, or break certain references that you might be keeping internally.
And then later on down the track you might decide that an array is a poor way of handling it and decide to use a linked list instead. All the public methods (add, remove etc) can stay the same. Changing how the data is stored internally won't break any other code because the public access points are still the same.
If you'd made the array public to begin with, the temptation would be there to access it directly from other classes, which means changing to a linked list would break that code.

It's not super important if you're the only person working on a project, but it's good practice and it can save you some headaches from time to time.


23.

None

Topic: creating an mc deleted another one

Posted: 10/03/08 03:31 AM

Forum: Flash

Probably the depth that you're creating the new ships at. If you specify a depth that already has something, the old thing will be removed.

When attaching new ships, you can use getNextHighestDepth() to find the next unoccupied depth to make sure there's no conflicts.

attachMovie("Ship", "ship", getNextHighestDepth());


24.

None

Topic: Distance-Rotation formula

Posted: 10/03/08 12:21 AM

Forum: Flash

Depending on how your rotations are set up you might need to adjust it by 90 degrees, but in general

x = Math.cos(radians) * distance
y = Math.sin(radians) * distance

Although for something like this you might be better off just using localToGlobal to convert a point to stage coordinates.


25.

None

Topic: Coding question...

Posted: 10/02/08 01:35 PM

Forum: Flash

It sounds like there's no reason to set up that ENTER_FRAME listener at all. Just do the hitTest straight in the stopDragme function

function stopDragme(event:Event):void{
MovieClipDark.stopDrag();
StatusTxt.text = "Dropping Dark";
if(MovieClipDark.hitTestObject(MovieClip Basket))
{
StatusTxt.text = "Woo";
MovieClipClothesD.nextFrame();
MovieClipDark.gotoAndStop(2);
}
}


26.

None

Topic: Check Variable problem

Posted: 10/02/08 12:00 PM

Forum: Flash

Enemy1 = setInterval(Enemy1, 4000/_root.lvl);

You're overwriting the function itself with that assignment.

Looks like it should be
enemy1 = setInterval(Enemy1, 4000/_root.lvl);


27.

None

Topic: Converting Decimal to Hex and back?

Posted: 10/02/08 11:56 AM

Forum: Flash

Well you can't really store things as a hexidecimal number. It's the same value no matter the base.. just a matter of how you display it. The toString function of a Number lets you specify what base to use, so you can display it as hex if you want

var a:Number = 21;
trace(a.toString(16)); // traces 15


28.

None

Topic: Check Variable problem

Posted: 10/02/08 08:47 AM

Forum: Flash

Put the code in a function, and call that function when you do _root.lvl ++;

Also don't forget to use clearInterval inside the function, before you set up the new interval.


29.

None

Topic: AS3:help, hitTestPoint

Posted: 09/25/08 01:25 AM

Forum: Flash

You can use a method called localToGlobal to change it into stage coordinates

var p:Point = this.dot.localToGlobal(new Point(0, 0)); //changes 0, 0 inside dot into stage coordinates
if (_caballito..hitTestPoint(p.x, p.y, true)) {trace("CHOQUE CHOQUE :)")


30.

None

Topic: Easy Function Error :S

Posted: 09/24/08 06:42 PM

Forum: Flash

You actually had it right the first time. If you put the brackets after, the function is called then and there, and whatever the function returns is asigned to enemy1.onLoad. Since the function doesn't return anything, enemy1.onLoad will be set to undefined.

I'm not sure why it isn't working for you. Maybe by the time you get around to setting the onLoad function, the enemy has already loaded and doesn't need to call onLoad again.


All times are Eastern Daylight Time (GMT -4) | Current Time: 04:58 AM

<< < > >>

Viewing 1-30 of 911 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 92031