Be a Supporter!
Response to: AS3 set position inside Class Posted November 25th, 2011 in Game Development

What are textBox and textBox2? It seems that you are just confusing yourself by naming your class "scroller". Rename the class to "monkey" and stop assuming you can just access everything. They don't magically link themselves to instances you have on stage if they have the same name. Classes are self contained. They don't know anything about what you have on stage or anywhere else unless you tell them. So if you want to access the scroller mc then you can pass the reference to it in the constructor:

public function monkey(mc:MovieClip) {
//now do whatever you want with the mc you passed
}
Response to: Boundaries AS2 Posted November 24th, 2011 in Game Development

Level 59, respect.

Response to: stupid question Posted November 24th, 2011 in Game Development

At 11/24/11 10:27 AM, 4urentertainment wrote: You have yet to refute any of the reasons for why FP makes DK look like shit.

In my experience these kind of guys are trolls. It would probably be better if everybody just stopped posting here.

Response to: Tutor For As2 Or As3 Posted November 24th, 2011 in Game Development

Probably no. You are better off reading online tutorials and asking specific questions here in the forums when you run into problems.

Response to: Loops with more than one MC Posted November 23rd, 2011 in Game Development

var n:MovieClip = raindrop.duplicateMovieClip("drop" + i, i);

That's the part where the duplication is done. Replace the "raindrop" with your other mc if you want to duplicate some other mc.

And if you want to add more duplications, you can do it two ways:
1. Increase the loop size (it's 10 right). This would now make 20 copies of the raindrop.
2. Copy paste the current duplication code inside the loop and change the variable. Now you can duplicate the raindrop and some other mc at the same time. Copy paste as many times as needed.

You should get the point by now.

Response to: preloader W/out Action Script Posted November 22nd, 2011 in Game Development

No such thing as preloader without actionscript, but nobody says you have to be the one to write it.

http://www.newgrounds.com/downloads/prel oaders/

Download and enjoy. No coding skills needed.

Response to: Fixel FlxText not showing Posted November 21st, 2011 in Game Development

Chances of getting help with flixel in this forum are slim. Maybe someone who has used it comes along, you can hope. But in the meanwhile, you could think to yourself that why are you using flixel? I'd recommend it to advanced users only. It certainly is not a shortcut for beginners, which I assume you are.

Response to: Fixel FlxText not showing Posted November 21st, 2011 in Game Development

We are not going to read the tutorials and then try to figure out what's wrong. Either post your problem or re-read the tutorial and try to solve by yourself where you went wrong.

Response to: Calling a class Posted November 21st, 2011 in Game Development

At 11/21/11 01:09 PM, Fabzilla wrote:
At 11/21/11 08:16 AM, Jin wrote: package name should be src if your .fla is in the same directory as the folders.

package src {
I tried that an now I'm getting these errors:

col: 13 Error: Type was not found or was not a compile-time constant: name.

col: 24 Error: Call to a possibly undefined method name.

var john:name = new name();
^
Build halted with errors (fcsh).

That's because what Jin said is wrong here. If you put the 'src' after package, then it's trying to look from src/src which obviously is wrong when you have the name.as in the src folder. Did you read my previous post btw? You had two replies and you pick the wrong one :P.

Response to: Calling a class Posted November 21st, 2011 in Game Development

name.as should be in the src folder. I don't see any problems with your code, and you didn't even say what the problem is. I hope you understand that flashdevelop doesn't show traces by default, if you want them to show there is couple of ways to do it but easiest way is to run your flashes through the debug player.

Response to: AS3 lots of buttons Posted November 21st, 2011 in Game Development

You need to add the click event for each button, and make them all run the same function. In the function, you can get the 'name' property of the button that triggered the event, and since you put the numbers in the name, you only need to use little string manipulation to get it out.

Response to: Rotate a symbol/direction change? Posted November 16th, 2011 in Game Development

1)
as2:

stickman._rotation += 45;

as3:

stickman.rotation += 45;

2) Yes.

Response to: Rotate a symbol/direction change? Posted November 16th, 2011 in Game Development

AS2:

stickman._xscale *= -1;

AS3:

stickman.scaleX *= -1;
Response to: Pointer question. Posted November 16th, 2011 in Game Development

This is the flash forum.

Response to: Pointer question. Posted November 16th, 2011 in Game Development

You can write:

var mc:MovieClip = disk;

Now you can refer to disk with "mc" as well. That doesn't copy the disk though, so not sure why you want to do this.

Response to: Planning A Game Posted November 15th, 2011 in Game Development

I usually start by thinking a game I would want to play. Which most of the time is a platformer game :P. Then I think what thing/feature can set my game apart from others alike it. And that's where usually my thinking process dies as I can't think of anything :).

Response to: How do I make a 'Moving Background' Posted November 13th, 2011 in Game Development

background_mc.x += 2;

There you go, a moving background in AS3.

Response to: Flash *ignoring* onEnterFrame ... Posted November 8th, 2011 in Game Development

How many lines of code do you have then?

Response to: Fast color swap? Posted November 8th, 2011 in Game Development

It's not clear what you are trying to do. Explain the situation better please.

Response to: need beta testers Posted November 8th, 2011 in Game Development

Any info at all what we are beta testing? I don't wanna throw my hat in and find out you are beta testing a dress up game...

Response to: Rght click function? Posted November 6th, 2011 in Game Development

At 11/5/11 03:13 PM, Cryoma wrote: I'm not using flex so RIGHT_CLICK won't do it.
Reading through some search results I found something about when the context menu opening, do you know anything about that?

Right right, my bad. So you want then to detect that the context menu is opened? Then do it like this:

import flash.events.ContextMenuEvent;
import flash.ui.*;

var cm:ContextMenu = new ContextMenu();
cm.hideBuiltInItems();

cm.addEventListener(ContextMenuEvent.MENU_SELECT, myFunc);
contextMenu = cm;
function myFunc(e:ContextMenuEvent):void
{
trace("You are a dirty cheater");
}

You can copy paste that code in to a frame and see it work (I tested it myself this time :P).

Response to: Rght click function? Posted November 5th, 2011 in Game Development

At 11/5/11 03:25 AM, Cryoma wrote:
buttonDown true if the right mouse button is pressed; false otherwise.
So if MouseEvent.CONTEXT_MENU.buttonDown == true is what I'm looking for?
Do I need any packages for this or something to work in flash pro?
I'm only just now learning AS3 so please help me out.

Oh boy, seems like AS2 is strong in you :). In AS3 you use events, in this case something like this below.
And you do need to import that event.

import flash.events.MouseEvent;

stage.addEventListener(MouseEvent.RIGHT_CLICK, myFunc);

function myFunc(e:MouseEvent):void
{
trace("You are a dirty cheater");
}
Response to: AS3: Class to class variables? Posted November 4th, 2011 in Game Development

At 11/4/11 03:37 AM, simonhason wrote: Ah that works! thank you for the reply.

I have another question,

HOW WOULD YOU CALL A FUNCTION FROM DIFFERENT CLASSES??

You are going against the purpose of classes. Think of classes as bubbles. Classes are not like people who talk to each other, they are like bubbles which float in the air and don't care about other bubbles. Sometimes you may need to make an exception, but it's better if you learn to use classes properly first, then you won't have any problems making exceptions.

Response to: AS2 String to Hex Posted November 4th, 2011 in Game Development

Write:

myline.lineStyle(2, "0x"+color1, 100, true, "none", "round", "miter", 1);
Response to: As3 Function variable initialize Posted November 4th, 2011 in Game Development

If you don't want the variable to be accessible from outside, then use the keyword "private".

private var whatever:int = 2;

Response to: AS3: Class to class variables? Posted November 4th, 2011 in Game Development

Don't nest functions. Take your updating function out of your constructor right now.

Response to: AS2: Simple class function not work Posted October 28th, 2011 in Game Development

Obviously you can't run your constructor function in an enterframe. Change it to like this:

function well()
              {
                       
              }
         
              function onEnterFrame():Void
              {
                         move();
              }

function move():Void
{
this._x += 10;
}
Response to: Continuous Level Generation Posted October 14th, 2011 in Game Development

In a nutshell: many conditions. You start with making it completely random, then start adding conditions like block A can't be next to block B, etc. etc.

Response to: AS3 hitTest question Posted September 18th, 2011 in Game Development

No there isn't.