Solved

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

Posted on 2004-09-25
4
275 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

830 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