6 Replies Latest reply on May 3, 2007 12:08 AM by DanM.

    Loading Same Movie Without Reload

    DanM. Level 1
      Here's what i'm wanting:
      I have a flash header that plays nicely at index or home page, this is the only page i want the animation to play from beginning (ie loading a menu) from other pages on the site, i want it to be at the state of the last frame.

      My Question:
      Is there a way to tell flash which frame to start with, from outside the movie, but on the same page? (will it load quickly to that last frame, if the movie has already loaded in a previous page? , if it does load quickly, what if someone does not go through the homepage? )

      If there is no way to do the above, can i pass my preloader a variable. my preloader tells it to start at frame 2 when movie is completely loaded, is there anyway i can pass the movie a variable to jump to the last frame?

      i have called functions/ pass variables from the movie to out, but don't know how to do it from the page to the movie.

      I'm using php if that makes it any easier.

      let me know if you have another solution to my problem.

      (previously i've made two movies, one shorter than the other) but this still is two movies to load, and hence more "load" on the user.

        • 1. Re: Loading Same Movie Without Reload
          MotionMaker Level 1
          You can pass a variable to Flash from the web document using FlashVars.

          However is sounds like your problem is more an implementation problem. Each menu choice should not need to reload the banner and I take it a banner is not referring to rotating ads but to say a title for the page or something like that which is the same for all other pages.

          Thus you might load that and the first menu on frame 1 and then the menu buttons only load the other pages.

          If that is the case, then load that item separately one time and not with the external swfs loaded with the menu buttons. In fact a typical way is to make something like that part of the shell movie that loads first.
          • 2. Re: Loading Same Movie Without Reload
            Level 7
            DanM. wrote:
            > Here's what i'm wanting:
            > I have a flash header that plays nicely at index or home page, this is the
            > only page i want the animation to play from beginning (ie loading a menu) from
            > other pages on the site, i want it to be at the state of the last frame.
            >
            > My Question:
            > Is there a way to tell flash which frame to start with, from outside the
            > movie, but on the same page? (will it load quickly to that last frame, if the
            > movie has already loaded in a previous page? , if it does load quickly, what if
            > someone does not go through the homepage? )
            >
            > If there is no way to do the above, can i pass my preloader a variable. my
            > preloader tells it to start at frame 2 when movie is completely loaded, is
            > there anyway i can pass the movie a variable to jump to the last frame?
            >
            > i have called functions/ pass variables from the movie to out, but don't know
            > how to do it from the page to the movie.
            >
            > I'm using php if that makes it any easier.
            >
            > let me know if you have another solution to my problem.
            >
            > (previously i've made two movies, one shorter than the other) but this still
            > is two movies to load, and hence more "load" on the user.
            >
            >
            >
            There is the anchor label type, you might be interested in it.
            • 3. Re: Loading Same Movie Without Reload
              DanM. Level 1
              thanks for the quick reply, figured out FlashVars.

              my movie consistes of a banner and the menu that animate. i want this animation the first time a page is accessed on the site, links from that page on would not do the animation, but rather go to the last frame of the movie (where menu and banner animation is completed and is at the state it was on a previous page) does that make sense.

              Haven't tried it yet, but my initial solution is this: see if the user is a new one with php session variables, pass that to the flash. if new_user, play from frame 2 and on (preload is on frame 1) if not new_user, goToAndPlay last frame.

              this way, i load one movie, i don't have to load a second swf for the second pages that don't need the menu animation repeated.

              i'll post back if it works. but i'm curious of two things now:

              MotionMaker: what do you mean by: "If that is the case, then load that item separately one time and not with the external swfs loaded with the menu buttons. In fact a typical way is to make something like that part of the shell movie that loads first."

              henrik: should i google anchor label type or are you gonna tell me? :) it's 4:00 AM i'm going to bed.

              thanks guys,

              • 4. Re: Loading Same Movie Without Reload
                Level 7
                DanM. wrote:
                > thanks for the quick reply, figured out FlashVars.
                >
                > my movie consistes of a banner and the menu that animate. i want this
                > animation the first time a page is accessed on the site, links from that page
                > on would not do the animation, but rather go to the last frame of the movie
                > (where menu and banner animation is completed and is at the state it was on a
                > previous page) does that make sense.
                >
                > Haven't tried it yet, but my initial solution is this: see if the user is a
                > new one with php session variables, pass that to the flash. if new_user, play
                > from frame 2 and on (preload is on frame 1) if not new_user, goToAndPlay last
                > frame.
                >
                > this way, i load one movie, i don't have to load a second swf for the second
                > pages that don't need the menu animation repeated.
                >
                > i'll post back if it works. but i'm curious of two things now:
                >
                > MotionMaker: what do you mean by: "If that is the case, then load that item
                > separately one time and not with the external swfs loaded with the menu
                > buttons. In fact a typical way is to make something like that part of the shell
                > movie that loads first."
                >
                > henrik: should i google anchor label type or are you gonna tell me? :) it's
                > 4:00 AM i'm going to bed.
                >
                > thanks guys,
                >
                >
                >
                It is actually quite simple, add a label normaly and then change the
                label type to "Anchor", then you can easily jump to that part by going
                to the url Http://www/flash.swf#anchorlabel
                • 5. Re: Loading Same Movie Without Reload
                  DanM. Level 1
                  anchor was a wonderful idea, but didn't work (for me), it still loaded the movie from beginning and THEN detected the anchor and went to it.

                  clicked on a blank frame, labeled it "last" type "anchor"
                  called it from movie.swf#last

                  did i do it wrong? why wouldn't it 'jump' to the last frame? my page is php, for some reason after the flash loaded, it would add the #last to the URL?0

                  as in index.php#last

                  weird.

                  • 6. Re: Loading Same Movie Without Reload
                    DanM. Level 1
                    still haven't resolved it. right now i'm trying to pass it a variable.

                    on index.php:
                    movie.swf?firstTime=true

                    on all other pages:
                    movie.swf?firstTime=false


                    in the second frame i have:

                    if(_root.firstTime==false)
                    {
                    gotoAndPlay(39);
                    }

                    is that how i catch that variable? my if function works well as i tested it with just

                    if (true) { ... };