|
-
Flash Intermediate
Simple? Problem with menus
Hey all, I've created a simple game, but the game itself isnt a problem.(Knock on wood)
My biggest annoyance, since this is my second time using AS3, is I cant get the game to reset. I have a game over and finished screen, but I want to add A reset button.
My button itself works fine, I created my own "NavigationEvent", and it can trace "reset" when I click it. the thing is, I cant get rid of the original level!
it is somehow still running, and it gives me a hurricane of error messages why I try remove child.
does anyone know the correct way to remove a level instance without everything blowing up in my face?
I think I need to stop all the processes somehow, but no Idea how to do that.
all help is welcome!
XenElement
In the process of designing a quirky little game engine called gulp. Check out it's progress below: @ my blog.
---
Check out my blog at XenElement.com
-
need more details as to what exactly is your level and how your game is structured. removeChild does NOT remove instances or dynamically allocated objects. It only takes them off the display list. To reset, you basically call whatever you called the first time when the game started up and load the game again. Should also reset or nullify any unnecessary variables so you dont get leaks when you reset.
-
Flash Intermediate
Yes, thank you for that. I actually resolved my problem;
The eventListeners that I had were not removed after I removed the child, so It flooded with errors about not being able to find the thing I removed. dioh.
All I can do is sit back, smack myself, and move on.
thank you for helping though.
In the process of designing a quirky little game engine called gulp. Check out it's progress below: @ my blog.
---
Check out my blog at XenElement.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|