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 ViewsWhat 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
}
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.
Probably no. You are better off reading online tutorials and asking specific questions here in the forums when you run into problems.
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.
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.
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.
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.
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.I tried that an now I'm getting these errors:
package src {
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.
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.
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.
1)
as2:
stickman._rotation += 45;
as3:
stickman.rotation += 45;
2) Yes.
AS2:
stickman._xscale *= -1;
AS3:
stickman.scaleX *= -1;
This is the flash forum.
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.
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 :).
background_mc.x += 2;
There you go, a moving background in AS3.
How many lines of code do you have then?
It's not clear what you are trying to do. Explain the situation better please.
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...
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).
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");
}
http://help.adobe.com/en_US/FlashPlatfor m/reference/actionscript/3/flash/events/
MouseEvent.html
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.
Write:
myline.lineStyle(2, "0x"+color1, 100, true, "none", "round", "miter", 1);
If you don't want the variable to be accessible from outside, then use the keyword "private".
private var whatever:int = 2;
Don't nest functions. Take your updating function out of your constructor right now.
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;
}
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.