How does a loaded swf talk back to the main movie?

Hi,
I'm new to as3 and have troubles finding the right path for
swfs to "talk" to one another.
In my movie, I load an swf "news.swf" into a mc called
container_mc.
At one point I want to swap the "news.swf" to "ueberuns.swf"
via button click in my main movie, but not directly: "news.swf" has
a frame labeled "out", which builds down some elements over appr.
20 frames. In the last frame of "news.swf", I want "news.swf" to
either load the next "ueberuns.swf" into that same container_mc of
my main movie or have my main movie find out that "news.swf" is
through with it's last frame and then throw out "news.swf" and put
"ueberuns.swf" in that container_mc.
I already found out that I address "news.swf" by the
following code:
if (newsLaden.content != null) {
newsLaden.content.gotoAndPlay("out");
where newsLaden is the Loaders name. But how do I get
"news.swf" to reply?
Anyone can help? Thanks a lot!
Cheers, Karl

This is one of the biggest problems of AS3 as communication
between swfs, levels, and nested MCs has taken a completely
different path than the previous 9 versions of Flash. Both Erick's
and TheWabbit's suggestions will work but I sort of follow Erick's
approach as LocalConnection is the perfect fit for .swfs
communicating in the same HTML page not for nested. The key is
defining the timelines of MovieClips in each class when you want to
tell them to do something.
Try tera's example and see if that helps but if you
understand Erick's approach keep going. I just wanted to add that
you have to start thinking about defining the MCs you want to
communicate with in each Object Class file such as:
var _root:MovieClip = new MovieClip(parent);
and then you can always sort of define who you want to talk
to a bit easier.
THIS REALLY REALLY SUCKS for those of us who have been with
Flash since version 2 because they took away one of the best and
easiest things to do (but I'm glad telltarget is gone!! lol). Now I
fear people are going to start throwing everything back into one
LARGE SWF again thereby undoing all the work we in the Flash
community did in the first ten years to define 'best practices'
and_levels definitely was one of them along with an 'actions'
layer. I think Adobe's programmers who joined the Macromedia guys
led the product somewhere it didn't necessarily need to go. The
problem is many didn't know how to use the Flash Community's Best
practices. They were new to Flash.

Similar Messages

  • How do I get my tabs back into the main window?

    I've had a problem with an add-on displaying a small extra window every time I open a session for some months now: I know you're supposed to try disabling and re-enabling every add-on you've got to find out which one is responsible, but this is a work computer and with all the add-ons I have, it would take too long, so I've just closed the extra window every time and got on with my work. However, for some reason today my forty-odd tabs have all opened in the small extra window, which has no tab bar, navigation bar or menu button. How do I get my tabs back into the main window of Firefox, or alternatively get that window to behave like a normal Firefox window so I can use it?

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    *http://kb.mozillazine.org/Multiple_profile_files_created
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder

  • I have purchased apps for my ipod touch and they are not loading properly.  They appear on the screen, however when I touch them, they do not load and bounce back to the main screen.  Any suggestions on how to fix?

    I have purchased apps for my ipod touch and they are not loading properly.  They appear on the screen, but when you touch them, they do not open and bounce back to the main screen.  Any ideas on how to fix?

    Try the basics from the manual:
    restart.
    reset.
    restore.
    iPod touch User Guide (For iOS 4.3 Software)

  • Can an AS1/2 swf loaded via Loader class tell the main movie (AS3) that it has run to the end of its timeline?

    If I load an external swf:
    my_loader.load(new URLRequest("abc.swf"));
    addChild(my_loader);
    abc.swf starts playing - how do I get it to tell the main movie that it reached the end of its timeline and finished playing?  Added bonus: the loaded swf is AS1 and the main movie is AS3.  I'm not sure if I could convert the loaded swf to AS3.
    Thanks,
    Sean

    I have not used this component but it may work for you:
    http://www.jumpeyecomponents.com/Flash-Components/Various/ActionScript-Bridge-91/

  • I start to open an app and it opens and starts to load then flashes back to the home screen this is doing it on all games but not the mail.

    I start to open an app and it opens and starts to load then flashes back to the home screen (desk top)

    Hello jerrysgirl777
    For issues with apps closing on you at start up, try closing the app from multitasking, restarting your device, checking for updates or just deleting the app and downloading it again. Check out the article blow for more information.
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open
    http://support.apple.com/kb/TS1702
    Regards,
    -Norm G. 

  • Calling a function in the main movie from a loaded swf

    I realize this is probably a very basic question, but I have
    loaded a SWF file into another movie. I now want to call a function
    in the main SWF. Is there a way to do that? Alternatively, I have a
    custom class where I could put the function, but I haven't been
    able to figure out how to call it from the loaded SWF either. Do I
    somehow need to associate the class with the main movie,
    or...?

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • I tried to make a second library, but my first one was deleted so I did it again but now I have doubles of every song. How do I restore my itunes back to the way it was before I tried to make a 2nd library?

    Like I said I tryed to make another library, I did what Itunes told me to do but it only erased the library I had and made a new one. So I did it again but I now have duplicates of every song. How do I get my it back to the way it was, before I tried to make a second library?

    C:\Users\Cheye\Music\iTunes should be the original library. You should be able to connect to it as follows.
    Close iTunes, wait a few seconds, click the icon that starts iTunes and immediately press and hold down the shift key. Keep holding until asked to choose or create a library. Click choose and browse to the file C:\Users\Cheye\Music\iTunes\iTunes Library.itl.
    Depending upon exactly what you did this has either restored your library, or done absolutely nothing at all. That was the reason for asking you to check using the script.
    Assuming you still have a library full of dupes there are a number of ways to go. I've written a script called DeDuper which can help remove unwanted duplicates which I discuss in some detail in this  thread. While it should work it will be ideal if it discards the copies that are outside the media folder C:\Users\Cheye\Music\iTunes\iTunes\iTunes Media. I've a feeling it will do exactly that, but it depends in part on exactly you got into this mess. It would be worth doing a few sample runs of just a few sets of duplicate files first.
    tt2

  • I was trying to download my itunes to my iphone and did a restore by mistake.  Now all my contacts, pictures etc are gone from april to now.  How can I revert my iphone back to the way it was

    I was trying to download my itunes to my iphone and did a restore by mistake.  Now all my contacts, pictures etc are gone from april to now.  How can I revert my iphone back to the way it was

    - You do have iTunes version 11 on the computer, right. Saying the latest is not sufficient.
    - Have you tried everthing here:
    iOS: Device not recognized in iTunes for Windows
    - You should
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    Your library/media will not be affected.
    - Does the iPod charge?

  • I just bought a song and my ipod shuffle will not play it.. how do i get my money back from the song??, I just bought a song and my ipod shuffle will not play it.. how do i get my money back from the song??

    I just bought a song and my ipod shuffle will not play it.. how do i get my money back from the song??, I just bought a song and my ipod shuffle will not play it.. how do i get my money back from the song??

    Assuming you bought the song at the iTunes Store, you can go here
    http://www.apple.com/support/itunes/
    and follow one of the "paths" to get what you need or to an Apple customer support employee.  One path is to click Contact Support at the bottom of the list of choices, and use the Express Lane.
    The iTunes app also has a way to report a problem with a purchase.  Select iTunes Store in the sidebar (of the iTunes window).  Toward the upper right corner, click on your Apple ID.  This gets you to your Account Information screen.  Find Purchase History and click See All.  On that screen, you can select a specific purchase with that problem, and Report a Problem.
    If you want to try to figure out WHY that song does not play on your iPod shuffle, please post back...

  • How to pass the caught exception in Thread.run back to the main program?

    I have following three Java files (simplified from a real world application I am developing, see files at the end of this posting):
    1. ThreadTest.java: The main program that invokes the Manager.run()
    2. Manager.java: The manager that creates a thread to execute the Agent.run() for each agent
    3. Agnet.java: The run() method can throw Exception
    My goal is twofold:
    1. To execute the run() method of an Agent in a thread (the reason for this is there are many Agents all managed by a Manager)
    2. To catch the exception thrown by Agent.run() in the main program, ThreadTest.main() -- so the main program can alert the exceptions
    My problem:
    Bottomline: I cannot pass the exception thrown by Agent.run() in the Thread.run() back to the main program.
    Explanation:
    The signature of Thread.run() (or Runnable.run()) is
    public void run();
    Since it does not have a throws clause, so I have to try/catch the Agent.run(), and rethrow a RuntimeException or Error. However, this RuntimeException or Error will not be caught by the main program.
    One work-around:
    Subclass the ThreadGroup, override the ThreaGroup.uncaughtException() methods, and spawn the threads of this group. However, I have to duplicate the logging and exception alerts in the uncaughtException() in addition to those already in the main program. This makes the design a bit ugly.
    Any suggestions? Am I doing this right?
    Thanks,
    Xiao-Li "Lee" Yang
    Three Java Files:
    // Agent.java
    public class Agent {
    public void run() throws Exception {
    throw new Exception("Test Exception"); // Agent can throw execptions
    // Manager.java
    public class Manager {
    public void run() throws Exception {
    try {         // <===  This try/catch is virtually useless: it does not catch the RuntimeException
    int numberOfAgents = 1;
    for (int i = 0; i < numberOfAgents; i++) {
    Thread t = new
    Thread("" + i) {
    public void run() {
    try {
    new Agent().run();
    } catch (Exception e) {
    throw new RuntimeException(e); // <=== has to be RuntimeException or Error
    t.start();
    } catch (Exception e) {
    throw new Exception(e); // <== never got here
    // ThreadTest.java
    public class ThreadTest {
    public static void main(String[] args) {   
    try {
    Manager manager = new Manager();
    manager.run();
    } catch (Throwable t) {
    System.out.println("Caught!"); // <== never got here
    t.printStackTrace();

    The problem is, where could you catch it anyway?
    try {
    thread.start();
    catch(SomeException e) {
    A thread runs in a separate, er, thread, that the catch(SomeException) isn't running within. Get it?
    Actually the Thread class (or maybe ThreadGroup or whatever) is the one responsible for invoking the thread's run() method, within a new thread. It is the one that would have to catch and deal with the exception - but how would it? You can't tell it what to do with it, it (Thread/ThreadGroup) is not your code.

  • How does Media Manager handle Motion Projects within the Sequence being cop

    How does Media Manager handle Motion Projects within the Sequence being copied?
    I've highlighted my sequence, opened Media Manager, and copied it to another drive. When I open up the sequence in it's new project, the rendered Motion Project plays within my sequence but it won't let me go back into this Motion Project to make changes. I tried starting over. This time I highlighted the actual motion sequence and clip that is created within FCP after sending something to Motion and copied those to the new drive. When I went into the newly created 'media' folder and double clicked on the motion project it launched. It looked liked it was going to play but while my crops moves and borders were there, the filmed material is shown as a freeze frame for the duration of the motion project.
    I did this with and without 'including master clips within selection'. Any advice would be appreciated. Thanks.

    Is there anyone who knows the answer to this? Thanks.

  • Dear apple, can you please tell me how to put my 'x' key back onto the computer properly without giving me an answer which will make me want to buy a pc like 'we WILL only replace the entire keyboard'?

    dear apple, can you please tell me how to put my 'x' key back onto the computer properly without giving me an answer which will make me want to buy a pc like 'we WILL only replace the entire keyboard'?

    My profile does say level 1 (0 points) quite obviously pointing out i am a noob at this, although i did try to correct myself in the previous responce to **macbook.
    I am confused why you think i havn't answerd michaels question though. 'I assure you the keyboard or the joining parts aren't broken and if it isn't broken i dont feel the need to replace it. '- that was me in the first responce explaining why im not buying a new one, answering the very question he asked.

  • My ITunes library was wiped from Itunes app on my PC, but it is still in a folder on my hard drive. How can I reinstall my library back to the Itunes app? My library is available in Itunes on my Ipad but I can't find an option to synch to my PC?

    My ITunes library was wiped from the Itunes app on my PC, but I think the files are still in a folder on my hard drive. How can I reinstall my library back to the Itunes app? My library is available in Itunes on my Ipad but I also can't find an option to synch to my PC?

    How to recreate iTunes Library
    No content shows up in iTunes after updating

  • How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8)

    How does one continue to use Mail on the early MacBook Pro, Model 1,1, that is not upgradable to Lion?  I have been running iCloud on my iPhone (OS5) and iMac (Lion) along with the MacBook Pro (OS Version 10.6.8) since November until now.  Mail will no longer download on the MacBook Pro and keeps asking for my password.

    Mail should still be usable with your machine - but you'll need to update the settings to conform to the requirements of your system. Check with your ISP (like ATT, etc.) for the settings that will work with your Mail. Once you've updated this, you should be able to email like before.
    For example, my ISP required that I go to Mail Preferences/Accounts and make sure the details conform to your email settings.
    I have no idea of what your ISP is or what the settings might be, but this is likely the source of the problem.

  • How do I change my theme back to the Firefox 4 original theme? Having downloaded an add-on.

    How do I change my theme back to the Firefox 4 original theme. Having downloaded an add-on.

    At the Addons manager (URL: '''about:addons''' ; Tools > Addons ; FirefoxButton > Addons), '''appearance''' section, choose to enable the default theme. Restart Firefox.

Maybe you are looking for

  • Checkbox in alv report-doubt

    hi all     can anybody tell me the coding lines for 1)when checking a check box 'test run' in selection-screen, a particular output field(for eg.,itab_final-WBS1) has to be updated in standard table(e.g,CATSDB-WBS)  ,if not checked,it should not be u

  • Mavericks (Apple OS 10.9) and Photoshop Elements 11 compatibility

    Will Apple's new OS 10.9 (Mavericks) be compatible with Photoshop Elements 11. I enquired at Apple and they said that I should need to ask Adobe

  • [SOLVED] Gnome & Firefox: Fonts are too small

    Hi, I am really used to using firefox in Windows XP where fonts are readable out-of-the-box. By this I mean I didn't have to fiddle with firefox when I installed it, the fonts looked great. Now that I'm using Gnome, I see that firefox's fonts are rea

  • TS1702 App Store suddenly declining my visa debit as billing payment?

    I've been using my ipad 3 for the last few days and my payment methods been my visa debit card. However today after multiple attempts to download a free game for my son it comes up with a message saying the payment methods been declined? I have tried

  • Audio Won't Import After First Clip

    So I'm having this weird glitch in Premiere the last few days. The first video clip I drag into a timeline works fine. But after that, any clip I drag from the Project window onto the timeline will ONLY give me video - not audio... even though I know