Solved

How do I communicate between the main movie and an externally loaded swf movie in flash ?

Posted on 2004-09-25
4
286 Views
Last Modified: 2012-05-05
Hi,

I can load external swf into my main movie. I want to know how to communicate between an externally loaded swf and the main movie. Say I wanted to get the current frame number of the externally loaded swf as I played how would I do that? Also say I had a button in the external swf that I wanted to use to play a frame number or label in the main movie how would I do that ? And finally how do I control the externally loaded swf like gotoandplay a frame number or label in the external swf?

I use:

this.createEmptyMovieClip("movie1_mc", 1);
movie1_mc.loadMovie("external1.swf");

As I find loading external swf's into a movie clip easier to control so you may want to take that into account when answering

Any help would be appreciated

Cheers
Rabid Lemming
0
Comment
Question by:Rawdon Hume
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Assisted Solution

by:FLAASHER
FLAASHER earned 170 total points
ID: 12153542
look man
i will learn u how to make this with loadMovieNum not with loadMovie

at the frist frame in the main moviw we will put this code

loadMovieNum("external1.swf",9);
this will load "external1.swf", in level "9"

and i make 2 buuton
the frist will make external1.swf to go to frame 15 and the second will make it go to frame 30
u see i control the external1.swf from the main movie
ok :)???

and this is an example
see it and tell me if u eant any other thing :)

http://www.midoco.com/rabidlemming.zip

wiating 4 u
0
 
LVL 8

Accepted Solution

by:
Cerf earned 170 total points
ID: 12156572
Hello Friend,

If you're using loadMovie, which is the recomended for flexibility, when you load an external swf into an empty movie clip, it becomes part of the main movie. So, you can comunicate  with it as easy as using the name of the movie clip you used to load it.
For example,
Lets say that you have an external movie that has a dynamic text field called "ext_text" and the mc you're loading the movie in is named "externally_loaded" (empty mc). If you want to set the text of the externally loaded movie just type this AS:
_root.externally_loaded.ext_text.text="Experts-Exchange rules :-)"

I have put together a small example. Look for "loadmovie_com.zip" at http://es.geocities.com/cerfx/flash

Hope this helps,

Cërf.
0
 
LVL 2

Author Comment

by:Rawdon Hume
ID: 12161668
hi,

Thank you to the both of you that has been very helpful at least now I have a clearer idea about communicating between flash movies loaded into each other

Thank you both

Cheers
Rabid Lemming
0
 
LVL 2

Author Comment

by:Rawdon Hume
ID: 12161756
Hi,

Yer that’s fantastic, just what I wanted. At least now I have a better understanding of how to communicate between flash movies that are loaded into a main movie

Cheers
Rabid Lemming
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question