• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Loading External SWF, Listening to Dispatched Events

Hi there,

I need to load external SWFs into a main movie. The problem is that I need to listen to dispatched events in the external SWFs in the main movie. How would I go about that?

Details:
I am putting together a web application that loads content (external SWFs) dynamically into a main movie container. The external SWFs all have their own functionality and expose certain events to the 'parent'. For example, the user presses a button in the loaded SWF, which needs to trigger an action in the main container.

Hope this makes sense. I'm looking for a short code example or outline and not a complete solution.

Thanks,

JB
0
jsound
Asked:
jsound
  • 2
1 Solution
 
Dushan De SilvaCommented:
I can give a partial solution for your problem.
Try to load movies to LEVELS. Then it will not overlap your codings. (eg: _root)

BR Dushan
0
 
Aneesh ChopraCommented:
You can simply write a function in main movie, which can be called on loaded SWF button press..

suppose main.swf is main movie.. and external.swf is being loaded in a movieclip "container" which is on _root of main.swf
--------
container.loadMovie("external.swf");
--------

main movie has a function doThis() on _root. and "external.swf" has  a button which call main.swf movies function.
put this code on "external.swf" movie button..
---------
on (release) {
      _parent.doThis();
}
---------

I hope all would be clear

Rgds
Aneesh
0
 
jsoundAuthor Commented:
Thanks for the suggestion.

My problem is (even with implementing levesl properly) that the main container does not seem to get the triggered events from the loaded SWFs.

For the moment I'm still hunting for a solution.

JB
0
 
jsoundAuthor Commented:
I hadn't thought of that, aneeshchopra. I have done this on another project. On this project I had hoped to use the event listener model to get action out of the main movie.

I'll use your suggestion as a backup. Still looking for a solution using event listeners.

Thanks,

JB
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now