Be a Supporter!
Response to: Error #1069. help plz Posted February 21st, 2010 in Game Development

nevermind i found it the second i posted it.
_gamespeed was private and I changed it to public and it work.

Error #1069. help plz Posted February 21st, 2010 in Game Development

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.

Response to: character creation game Posted December 17th, 2009 in Game Development

that should easy. it just looks like a lot of buttons and gotoandstop type code.

Response to: Christmas Present Collab 2 Posted December 17th, 2009 in Game Development

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.

Response to: removeChild problem Posted December 17th, 2009 in Game Development

i didnt even notice that and i should have. thanks

Response to: removeChild problem Posted December 17th, 2009 in Game Development

thanks for the fast repeplys and the help

parent.removeChild worked but now the addChild( mainmenu ); is not working.

removeChild problem Posted December 17th, 2009 in Game Development

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);
		}
	}
}
Response to: New Game Team Posted December 9th, 2009 in Game Development

i can be a beta tester if you still need one.

Response to: Christmas Present Collab 2 Posted December 5th, 2009 in Game Development

I think i have a good idea for this but im using cs4

Response to: as3 hittest with target inside a MC Posted November 20th, 2009 in Game Development

im giving it a 3d look. i want it to hit just the feet not the whole body

Response to: as3 hittest with target inside a MC Posted November 20th, 2009 in Game Development

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
}
Response to: Your Biggest Achievment In 2009? Posted November 18th, 2009 in General

july 28 my son was born.

Response to: how to get your gf mad in 15 mins Posted October 25th, 2009 in General

she had it coming. its my computer and she changed it from Deadpool to puppys

how to get your gf mad in 15 mins Posted October 25th, 2009 in General

it is the season for being evil, so Im playing a little trick on my girlfriend. i took her background pic from this

puppys

to this

evil puppys

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.

Response to: Beginner friendly flash software? Posted August 16th, 2009 in Game Development

i use Koolmoves. it can export .SWF's. not sure if NG accepts them but I know others do.

Response to: display a var in dynamic text(as3) Posted July 21st, 2009 in Game Development

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; 
}
Response to: I require a programmer/progra mmers Posted April 3rd, 2009 in Programming

you should give 50 a month plus profit sharing.