Answered
Listener for dispatched event
Hi,
I had a problem which the majority of got sorted out with help from other people but it's left me with one last part i dont get...
I have a main.swf which loads into a loader an external swf called menu1.swf. I'm trying to get a function triggered in the main.swf when it recieves an event dispatched from the menu1.swf. The main problem i had was getting the event to dispatch from the loaded swf but that's now sorted. My main problem now is where to add the listener in the main.swf to listen out for this event.
I've been informed it's not the loader i should be attaching the listener to, but rather it's contents ( the function i want to call is to unload the loader once the event from the contents of that loader has been dispatched). Now the contents is menu1.swf, but i didnt think you could attach a listener to a swf? I was also told that once the loader has completed loading, the swf is no longer a swf, but instead becomes content.data...
So what am i attaching a listener to? should it be loader.content.data.addEventlistener(... );
it's got me stumped?
I had a problem which the majority of got sorted out with help from other people but it's left me with one last part i dont get...
I have a main.swf which loads into a loader an external swf called menu1.swf. I'm trying to get a function triggered in the main.swf when it recieves an event dispatched from the menu1.swf. The main problem i had was getting the event to dispatch from the loaded swf but that's now sorted. My main problem now is where to add the listener in the main.swf to listen out for this event.
I've been informed it's not the loader i should be attaching the listener to, but rather it's contents ( the function i want to call is to unload the loader once the event from the contents of that loader has been dispatched). Now the contents is menu1.swf, but i didnt think you could attach a listener to a swf? I was also told that once the loader has completed loading, the swf is no longer a swf, but instead becomes content.data...
So what am i attaching a listener to? should it be loader.content.data.addEventlistener(... );
it's got me stumped?