Tuesday, March 23, 2010

addEventListener not working!!!

Adding event listeners to a loader, and it won't call the
function!! here is the code:



it doesn't trace anything... anyone know why? is AS3 still
buggy? we have weird problems with it!addEventListener not working!!!
I'm not with my Flash CS3 at the moment and I haven't done
this enough to just rattle it off the top of my head. but I think
there are several things going wrong..



First I don't think you can just add the listeners directly
to the loader. Isn't there some kind of loader progress object that
you have to attach them too?



Next check the documentation. It seems strange that some of
the events would come from the Event class and others from the
ProgressEvent class. I seem to recall they all come from the same
place.



And in general the answer is ''No.'' no version of actionscript
has been particularily buggy. I think there are probably less than
one hand's worth of bona fide bugs. Most of the time it is operator
error.addEventListener not working!!!
DOH!



looked at the help, they're passing the contentLoaderInfo
into a function... so I just did this:



splashScreenLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
splashComplete);

splashScreenLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
splashLoader);

splashScreenLoader.contentLoaderInfo.addEventListener(Event.INIT,
splashLoader);

No comments:

Post a Comment