Solved

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

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to record live broadcast.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now