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 Viewsnevermind i found it the second i posted it.
_gamespeed was private and I changed it to public and it work.
Im tring to get a var for one Mc to another Mc. i keep getting this 1069 error in the output.
ReferenceError: Error #1069: Property _gamespeed not found on Game_Manager and there is no default value.
at BG/onEnterFrame()[C:\Documents and Settings\Compaq_Owner\My Documents\Flash\survive\BG.as:32].
here is the code.
package
{
import flash.display.MovieClip;
import flash.events.Event;
public class Game_Manager extends MovieClip
{
private var _gamespeed:int;
private var bg:BG;
public function Game_Manager()
{
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(event:Event):void
{
_gamespeed = 5;
bg = new BG();
bg.x = 0;
bg.y = 0;
addChild( bg );
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}
this is the second
package
{
import flash.display.MovieClip;
import flash.events.Event;
public class BG extends MovieClip
{
public var _vx:int;
public function BG()
{
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(event:Event):void
{
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function onEnterFrame(event:Event):void
{
_vx = MovieClip(parent)._gamespeed;
x -= _vx;
}
}
}
I tried to change MovieClip(parent) to parent and also tried Game_Manager but they didnt work.
that should easy. it just looks like a lot of buttons and gotoandstop type code.
i was going to do this one but this morning but my computer got trashed by a really nasty virus and i lost everything. i just finished reinstalling windows. sadly i do have time to redo what i was planing but if anyone needs a idea i was going to do a spy vs spy X-mas. the white spy puts a bomb in a present and puts it under the tree. the black spy has his kids come open gifts and the white spy see it. not wanting to hurt the kids he jumps on the bomb and blows himself up. the black spy takes the hats off the kids to show that they are just robots and laughs.
i didnt even notice that and i should have. thanks
thanks for the fast repeplys and the help
parent.removeChild worked but now the addChild( mainmenu ); is not working.
I am working on a menu and im trying to removeChild(startgame) but i keep getting a error. startgame is the first Movieclip brought on by the document class. i want it to remove the startgame movieclip and add the mainmenu movieclip but i keep getting a 1009 error.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
package
{
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.events.MouseEvent;
public class StartGame extends MovieClip
{
public var mainmenu:MainMenu;
public var optionspage:OptionsPage;
public var gamescreen:GameScreen;
public function StartGame()
{
playgamebtn.addEventListener( MouseEvent.CLICK, onplaygamebtn );
optionsbtn.addEventListener( MouseEvent.CLICK, onoptionsbtn );
}
public function onplaygamebtn( mouseEvent:MouseEvent ):void
{
mainmenu = new MainMenu();
mainmenu.x = 0;
mainmenu.y = 300;
addChild( mainmenu );
removestartgame()
}
public function onoptionsbtn( mouseEvent:MouseEvent ):void
{
removestartgame()
optionspage = new OptionsPage();
optionspage.x = 0;
optionspage.y = 300;
addChild( optionspage );
}
public function removestartgame():void
{
playgamebtn.removeEventListener( MouseEvent.CLICK, onplaygamebtn );
optionsbtn.removeEventListener( MouseEvent.CLICK, onoptionsbtn );
gamescreen.removeChild(this);
}
}
}
i can be a beta tester if you still need one.
I think i have a good idea for this but im using cs4
im giving it a 3d look. i want it to hit just the feet not the whole body
that was just a mistake on here. its spelled right in the game
Im working on a breakout game and need a little help with the hittest.
this is the part of code i need help with. it is inside the brick class.
if(this.hitTestObject(Ball))
{
this happens
}
it works fine the if i leave it as is but i want it to only work if it hits a target inside the brick.
i tried this but it didnt work
if(this.traget.hitTestObject(cBall))
{
code
}
july 28 my son was born.
she had it coming. its my computer and she changed it from Deadpool to puppys
it is the season for being evil, so Im playing a little trick on my girlfriend. i took her background pic from this
to this
i was just wonder if anyone else is tricking their woman or man. and what is it
im tring to get a collision between two movieclips. the problem is one of the movieclips is a odd shape and they hit in open space because of that. i did some looking around the net and found out about bitmapdata. i read up on it but i still dont get it. im still new with as3. if anyone can help or just point out a useful link on how to get a collision between movieclips using bitmapdata it would be greatly appreciated.
i use Koolmoves. it can export .SWF's. not sure if NG accepts them but I know others do.
no error. just a empty box
i should know this but i cant seem to get it to work. i just tring to get var to show in a dynamic text. the text is named txtdays. the day goes up when i push a sleep button i made. i did use search and found things that helped but i still cant get it to work.
var gameday:int = 0;
addEventListener(Event.ENTER_FRAME, eFrame);
function eFrame(e:Event):void{
txtdays.text = 'test '+gameday;
}
it doesnt work with the code above. but it worked when i tested it with the below code.
var gameday:int =0;
mcofficersroom.btnsleep.addEventListener (MouseEvent.CLICK, sleep);
function sleep (event:MouseEvent):void{
txtdays.text = 'test '+gameday;
}
you should give 50 a month plus profit sharing.