00:00
00:00
Newgrounds Background Image Theme

christopher54000 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Very weird Event Listener problem!!

708 Views | 7 Replies
New Topic Respond to this Topic

So I'm basically going crazy here. The rule is;
"Assign an event listener to a function, and flash does whatever is in the function when the event happens"

right? Well Flash currently disagrees. I've done only that but it just doesn't work. It doesn't give errors or anything, it just doesn't work.

I'm building a portfolio website in Flash at the moment, and I have some event listeners made in the first (and only) frame of the website. They do all the work for all the buttons. But ever since I added the art lightbox, 13 listeners stopped working. Traces show that the code never even gets to the function.

Example here.

It's a difficult problem so if anyone would like to help me out please provide me your skype name or anything else to communicate with and I will show you everything about the file.

MUCH thanks in advance, I hope someone can help.
~Rhinan

Response to Very weird Event Listener problem!! 2012-05-29 09:03:22


Your "art lightbox" is probably on top of the other objects and is blocking the mouse events. It works again if you remove it, right? Solution: make the "art lightbox" mouseEnabled property false.


You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.

Response to Very weird Event Listener problem!! 2012-05-29 09:26:57


At 5/29/12 09:03 AM, ProfessorFlash wrote: Your "art lightbox" is probably on top of the other objects and is blocking the mouse events. It works again if you remove it, right? Solution: make the "art lightbox" mouseEnabled property false.

W-wow. You can't imagine how much that helped. I didn't know of such a thing! The games work again, but the art is still below the games page so that doesnt work at the moment. Would it help if I load the movieclips with actionscript instead of just placing them on the stage manually? Or do you know a better way to do this?

Thanks a LOT!

Response to Very weird Event Listener problem!! 2012-05-29 09:36:40


At 5/29/12 09:26 AM, Rhinan wrote: The games work again, but the art is still below the games page so that doesnt work at the moment.

I do not understand what you are saying here.


You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.

Response to Very weird Event Listener problem!! 2012-05-29 09:39:43


At 5/29/12 09:36 AM, ProfessorFlash wrote:
At 5/29/12 09:26 AM, Rhinan wrote: The games work again, but the art is still below the games page so that doesnt work at the moment.
I do not understand what you are saying here.

I have two movieclips with mouse event movieclips in them. They're on top of each other but I can't move them because that would screw the overall look of the website. Is there any way to get the mouse events to work again without moving the movieclips?

Response to Very weird Event Listener problem!! 2012-05-29 09:57:28


At 5/29/12 09:39 AM, Rhinan wrote:
At 5/29/12 09:36 AM, ProfessorFlash wrote:
At 5/29/12 09:26 AM, Rhinan wrote: The games work again, but the art is still below the games page so that doesnt work at the moment.
I do not understand what you are saying here.
I have two movieclips with mouse event movieclips in them. They're on top of each other but I can't move them because that would screw the overall look of the website. Is there any way to get the mouse events to work again without moving the movieclips?

You can solve this by organizing. Removing the buttons from the two movieclips sounds like the simplest solution. That way there is no overlapping, because the buttons aren't overlapping, right? It's the container movieclips that overlap?


You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.

Response to Very weird Event Listener problem!! 2012-05-29 10:01:02


At 5/29/12 09:57 AM, ProfessorFlash wrote:
At 5/29/12 09:39 AM, Rhinan wrote:
At 5/29/12 09:36 AM, ProfessorFlash wrote:
At 5/29/12 09:26 AM, Rhinan wrote: The games work again, but the art is still below the games page so that doesnt work at the moment.
I do not understand what you are saying here.
I have two movieclips with mouse event movieclips in them. They're on top of each other but I can't move them because that would screw the overall look of the website. Is there any way to get the mouse events to work again without moving the movieclips?
You can solve this by organizing. Removing the buttons from the two movieclips sounds like the simplest solution. That way there is no overlapping, because the buttons aren't overlapping, right? It's the container movieclips that overlap?

Yep, but the buttons are on the same position anyway. I'm thinking of deleting them when they're at the last frame of their fadeout frame, then bringing them back in when you click the 'games' or 'art' button. Seems the most easy way.

Response to Very weird Event Listener problem!! 2012-05-29 10:42:07


At 5/29/12 10:01 AM, Rhinan wrote: I'm thinking of deleting them when they're at the last frame of their fadeout frame

use a tween engine for such simple effects, it's much more convenient than frame based animation and a lot easier to do something when it's finished as most tween engines provide a possibility to register a callback function or event listener.

Instead of removing all buttons, put them in one container and remove/add that container.