I want to be able to use a button to load a swf into a movie clip, and then wen the button is pressed again to be able to tell if the swf has been loaded into the mc.

Posted on 2006-05-29
Last Modified: 2010-04-03
I have about 10 buttons on the main page. Each button takes you to a specific frame in the timeline, plays an animation and then stops at a frame that loads a specific external swf into a specific MC using loadMovie. Now when that person leaves the loaded external swf and returns back to the main page, if he clicks the button again he will end up loading the entire external swf AGAIN, even though he already did that during his session.

This is very frustrating for the end user b/c it takes a very long time to navigate.
Is there a way to avoid this situation, for example to write some AS (either in the main movie or on the external swf), that checks if the external swf has been loaded already, and if it has, not to load it again?

Thank you
Question by:Lunar76
    LVL 7

    Accepted Solution

    the loaded movie should not take long time in the second time as it should be loaded from the cache
    however , you can load the external movie once at the begining of the main movie and make it invisible , when a button is calling it , you just make it visible and make it go to the specific frame, something like that


    and so on..

    then you will load the external movie once and no need to load it each time a button is pressed..


    Author Comment

    Thanks for the help Ramy, but if I load all the external swfs in the beginning (which Ive already done before, and is why I am doing it this way) it will take way too long. The load time will be extremely long, and if the user wanted to enter a specific section and it hasnt completely loaded yet it causes alot of problems.

    Thanks anyway,
    LVL 7

    Expert Comment

    Well, you can make a preloader or better to divide that loaded moive into smaller swf (one for each button) that way you will minimize the downlaod time as the user will only load the moives he wanted ..


    Author Comment

    Thats exactly what I am doing, but everytime I click on the button which has a loadMovie function, it loads the movie all over again and the user waits for it to load all over again. Just like I stated in my original question on top.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
    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,…
    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…
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    733 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

    18 Experts available now in Live!

    Get 1:1 Help Now