Skip navigation
mcommini
Currently Being Moderated

Is it possible to load an external swf at a specific frame?

May 17, 2007 4:21 PM

Hey! I've got a flash file which acts as the main menu for a program I'm developing. Everything works fine from the main menu however when you click to return to the main menu the whole main menu file reloads. Is it possible to use loadMovieNum( ) to go to a specific frame within the main swf file? If not, is there a way to do this?

Here's the button code I'm using now:
on (release) {
unloadMovieNum(0); //unloads the current movie so we can reload the main menu
loadMovieNum("DemoMainMenu.swf", 0); //reloads the main menu
}

Thank you for whatever help you can provide! :)

 
Replies
  • Currently Being Moderated
    May 17, 2007 4:49 PM   in reply to mcommini


    mcommini wrote:
    > Hey! I've got a flash file which acts as the main menu for a program I'm
    > developing. Everything works fine from the main menu however when you click to
    > return to the main menu the whole main menu file reloads. Is it possible to
    > use loadMovieNum( ) to go to a specific frame within the main swf file? If
    > not, is there a way to do this?

    First let me clarify one thing with you. Level zero is the main level on the flash
    player. By loading things in level zero you will remove current content and replace
    it with the new one. This is not a good idea because it works like purge, clears the
    player and from there on you can't maintain any functionality unless you reload the
    whole html document over again. Also, do not unload and load in the same time in the
    same level. Flash can hold single SWF per level, once you load content, whatever previously
    loaded will be automatically replaced, so just the loadMovie action and you all set.
    Good practice is to have the main level (zero) an empty base and than load and unload
    things in above levels, 1 and so on...

    > Here's the button code I'm using now:
    > on (release) {
    > unloadMovieNum(0); //unloads the current movie so we can reload the main menu
    > loadMovieNum("DemoMainMenu.swf", 0); //reloads the main menu
    > }
    >

    In regard to the load and go to. Yes it is possible but no matter what frame you want to
    go to,you need to load the whole movie first. I will come back to that in a second.

    While you execute the loadMovie action, you can set up a variable, for example:

    loadMovieNum("file.swf", 1);
    Variable="mcommini_01";

    Than in the loaded movie you have preloader which makes sure that the movie is loaded before
    playing and once done loading, make it jump to frame which has IF ELSE condition in some kind
    of loop, using setInterval or Enterframe. That condition checks for the variable value and based
    on it proceed to particular frame.
    That's why I told you not to clear level zero, if you set variable and load movie in that level
    in the same time, all the information will be gone and you have totally no reference point to
    get the variable from.
    You could as well use shared object which is native form of Flash's cookies. Write SOL file into
    user drive temp folder, than read it from the other file and go to frame based on the given value.




    --
    Best Regards

    Urami


    --

    Beauty is in the eye of the beer holder...


    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>
     
    |
    Mark as:
  • Currently Being Moderated
    May 22, 2007 12:37 PM   in reply to Newsgroup_User
    i dont quite understand that bit on how you make it go to a certain frame in the file you are loading

    do you think you could make it a bit simpler and give me bits of code that i need?

    thank you
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points