Recent posts by Momose on Kongregate

Flag Post

Topic: Game Programming / OOP and addChild problem

@NiveFiveThree yesss i understood it, i was just saying that the post from the site made me understand what i was doing… because i had no idea.

@Ace_Blue yes i understand everything now, it’s a different world now for me. But thanks anyway, i don’t pretend using any reference so soon…

 
Flag Post

Topic: Game Programming / OOP and addChild problem

Oh guys i don’t even know how to say this… But first of all i’d like to say thanks to all that cared to come to this thread to help me, i went through a deeeeep search for tutorials on the internet and i found answers!

Because of all your posts i found out that the way i was working out was somehow very “wrong”… So i found out other ways, i don’t need to make a reference to Main and all that stuff but that’s it.

Basically this one post on this site, made me see my mistake (the injection method):

http://www.untoldentertainment.com/blog/2010/03/01/5-ways-to-cheat-at-actionscript/comment-page-1

Anyway i just fixed my error, i think this thread can be locked up now.

 
Flag Post

Topic: Game Programming / OOP and addChild problem

But Level1() alread is added to Main.

 	public class Main extends MovieClip {
		var l:Level1;
		var h:hero;
                ...

		public function Main() {
			loadLevel1();
		}

		function loadLevel1(){
			l = new Level1(this);
		}
                ... 
Ok so now i extended Level1() and hero() to a MovieClip and i made the following changes:
 		public function Level1(r:Main) {
			ref=r;
			startScreen();
		}

		public function startScreen(){
			contain = new MovieClip();
			ref.stage.addChild(contain);
			
			backG = new BG();
			backG.x = backG.y = 0;
			contain.addChild(backG);
						
			loadyHero();
                        ...

		public function loadyHero(){
			h = new hero(this);
		}
                ... 
 		public function hero(r:Level1) {
			r=refLevel;
			mechanics();
		}

		function mechanics(){
			
			b = new Ball();
			b.x = 200; b.y = 200;
			b.gotoAndStop(1);
			refLevel.contain.addChild(b);
                        ... 

Now the hero() gets a reference to Level1(). It’s still working on this way but the “hero” don’t appear on the screen. yet.

And if i don’t give Level1() a reference to Main, it don’t work.

@truefire where should i add that? In the Main or in the hero()?

 
Flag Post

Topic: Game Programming / OOP and addChild problem

A1: Yes Level1() is absolutely being called before hero(), the background and some text appears on the screen but my “hero” don’t.

A3: Umm… i haven’t defined refLevel anywhere but it’s getting me serious trouble to define it.

			refLevel = new Level1(Main); 

It isn’t working… I don’t know how to properly define it on my code or even if it’s the apropriate way of doing it…

@BobTheCoolGuy: about what Draco said, i think the problem is what you have said too, the refLevel being null because i have never set it on the class.

@JamesObscura: yeah… it’s kind of confusing on this part but i don’t think the problem is that, it’s just the hero() class can’t read the reference to Level1().

 
Flag Post

Topic: Game Programming / OOP and addChild problem

Well i’m having a little problem with adding a MovieClip inside another. It could be a simple task but since this is a problem with separated classes… well you guys know the drill.

So if anyone could help me out on this:

Main Code:

 	public class Main extends MovieClip {
		var l:Level1;
		var h:hero;
                ...

		function loadLevel1(){
			l = new Level1(this);
		}

		function loadHero(){
			h = new hero(this);
		}
                ... 

Level 1 Code:

 	public class Level1 {
		public var backG:BG;
		public var contain:MovieClip;
		public var ref:Main;
                ...

		public function Level1(r:Main) {
			ref=r;
			startScreen();
		}

		public function startScreen(){
			contain = new MovieClip();
			ref.stage.addChild(contain);
			
			backG = new BG();
			backG.x = backG.y = 0;
			contain.addChild(backG);

			ref.loadHero();
                        ... 

Hero Code:

 	public class hero {
		public var b:Ball;
		public var refLevel:Level1;
                ...

		public function hero(r:Main) {
			ref=r;
			mechanics();
		}

		function mechanics(){
			b = new Ball();
			b.x = 200; b.y = 200;
			b.gotoAndStop(1);
   Problem -->	refLevel.contain.addChild(b);
                        ... 

“TypeError: Error #1009: Cannot access a property or method of a null object reference.”

I just want to add the “b” to the “contain” but i’m having problem doing it in another class.

I don’t know what to do anymore, i know i could do it in a more easier way but i want to learn this way, i want to know what is wrong and what i should do to fix it.

Thank you for reading my cry for help.

 
Flag Post

Topic: Kongregate / Special Day.

It’s kongregate and molly’s father birthday!!! Omg jim happy birthday for you and i wish you a lovely life.

 
Flag Post

Topic: Kongregate / Nomination for the Greatest Spammer

lol i vote with reikuboyama too, voodoo_child is the great.

 
Flag Post

Topic: Kongregate / 1.000.000 user (OMG)

Huzzah!
I actually meant to be paying attention so I could grab that account… but I forgot

You know, you are an administrator, you can just hack that account and i don’t know, transfer that account for the number 1.346.483 or something like that.

 
Flag Post

Topic: Kongregate / 1.000.000 user (OMG)

Well, as you guys know kongregate have a millions of accounts… oh wait… we do have a million of accounts!!

So just wasting my time, i was waiting for the 1.000.000 user to show up for about 1 month ago and when they created the account i decided to post it here. Yeah i know it’s kind of useless, but just want to you guys know we are in a really important site that has 1.000.000 accounts now. And well, i think about 30% of the accounts are fakes so… don’t know if this accounts is really someone new on kongregate.

http://www.kongregate.com/accounts/crazyhavok911 (well, he only entered one day so…)

So, thanks for watching this useless topic but important for me. And how i know he is the 1.000.000 account? This is my little secret i’m going to share: http://www.kongregate.com/users/1000000/posts

 
Flag Post

Topic: Kongregate / New card art!

^Now THERE’s a person with issues. Quick, no female should be seen to have boobs. So even depicting a woman AT ALL is offensive now? Let’s just ban images of women from the site, and introduce a ban on all words for body parts. This is getting absurd.

Have you ever heard of sarcasm? Sorry if you took my response to the picture too serious.

 
Flag Post

Topic: Kongregate / Ultimate Kongregate Photo Topic

LazloZania, you are truly a guitar hero. Congrats u_u

RAMBO CAT!

 
Flag Post

Topic: Kongregate / New card art!

Damn, even that “female” robot have boobs, what is wrong with you perverted people? o_o

 
Flag Post

Topic: Kongregate / If you were a Kongregate administrator...?

It’s pretty obvious what i would do, i would just fix a mistake a hazor did a longe time ago:

 
Flag Post

Topic: Kongregate / What should purchased cards look like? (Jim Greer Emailed Me!)

The “$” symbol is so epic, i aprove it.

 
Flag Post

Topic: Kongregate / Kongregate - Vote for KONGREGATE!

Voted. Hell yeah!

 
Flag Post

Topic: Kongregate / Room Rivalries

Not that i know, i think all rooms live in perfect harmony betweeen them.

 
Flag Post

Topic: Kongregate / Will Kongregate ever just "shut down"

It happened once but won’t happen again. They fixed it and hired a security guy to watch the firewall.

 
Flag Post

Topic: Kongregate / The Kongregater Quiz

  1. 1 – Same magazine as AioriaRox
  2. 2 – Not really, i usually read the “help” page from sites.
  3. 3 – Harmonia
  4. 4 – No
  5. 5 – To watch fun flash videos i would choose newgrounds, to play addicting games i would choose kong.
  6. 6 – No, molly did.
  7. 7 – 35
  8. 8 – Chill
  9. 9 – It’s boxcat, the cat that gone devour your soul
  10. 10 – 421
  11. 11 – 72
  12. 12 – 1 year and 4 days
  13. 13 – No, i think i signed up two months later when i really got bored in my computer
  14. 14 – Easy badge from Fancy Pants 1 Dude!
  15. 15 – Mass Attack
  16. 16 – Quite a bit.
 
Flag Post

Topic: Off-topic / 1'v3 607 1337 p01n75!

Google translator don’t have your english sorry :/

Maybe speaking it in english can help a little bit?

 
Flag Post

Topic: Kongregate / Backgrounds For Kongregate Profiles

I think the option to choose that kongregate avatars would be great. You know, that bee, the robot, the other strange objects or animals i never knew what they were…

 
Flag Post

Topic: Kongregate / Famous people on Kongregate

<embed src="http://www.youtube.com/v/LkCNJRfSZBU&amp;hl=pt-br&amp;fs=1" height="344" width="425"></embed>

Since nobody posted who is the famous LERRROOOYYY JENKINS!!

 
Flag Post

Topic: Kongregate Labs / Shoot!/Kongregate Labs FAQ and Discussion

Um… what about what i can put into the game? I mean it has to be only a shooter game that has a side-scrolling system or i can put more things on it, like a button to summon a dragon with 5 heads and 2 tails or i don’t know, put a boss on the final level and stuff like that.

If i can’t put more things just anwser to me, it has to be like the original game? Like one ship destroying other ships and rescuing little monsters in the ground?

 
Flag Post

Topic: Kongregate / avitars

If you want to know who is the person that did the kongregate avatars talk with a administrator. I think jindo made some of them, i’m not sure about it.

 
Flag Post

Topic: Kongregate / Forum update: Muting, quoting & reporting [greasemonkey script]

Another great idea aC, very useful to the forums as alway. Thanks.

 
Flag Post

Topic: Kongregate / Ultimate Kongregate Photo Topic

Your room is a little messed up e_e