5 Replies Latest reply on Apr 26, 2007 7:05 AM by peterent

    .swf end of movie

      Hello guys,

      First of all I'm not a flash or flex coder, so please pardon my lack of knowledge about it.
      Here is our story ...
      We have about 50 flash presentations (each less than a minute) on a web server. The web service written in .NET is getting the list of all .swf files (these files were made in Flash8, and I believe it's ActionScript 2.0) and passing it on to a Flex front end application.
      What we want to do on the flex side is, play these presentations randomly, one after the other (may be add a minute or half a minute delay between each presentation).
      I was talking to the guy who is working on Flex side and he said, basically, Flex is ActionScript 3.0 and Flash movies are ActionScript 2.0, so Flex would not know when the first movie ended for it to start another one.
      My question is, is it at all possible to do what we are trying to do in Flex? If it is then how do we go about it?

      If you could only point us in the right direction, that would be great too (Of course, if you guys have more detailed answers they are very welcome)

        • 1. Re: .swf end of movie
          peterent Level 2
          Flash does not dispatch any events when it reaches its last frame. I'm going to assume that the SWFs cannot be rewritten. What I suggest is writing one more Flash 8 SWF. This one would use LocalConnection to communicate with Flex (there's an article about this on my blog, just search for LocalConnection). This new SWF would also load all of the other SWFs and monitor their running. When it completes, use LocalConnection to tell the Flex SWF that the movie had completed. Flex could then communicate back when it was time to load another SWF.

          I'm sure there are some other ways to do this, but that's what comes off the top of my head.
          • 2. Re: .swf end of movie
            shatru2k Level 1
            Thanks for the information. I think I have ready your post about it few hours back. and it did make sense to me. I also read similar thing written on weblycan. I see what you are saying and thanks for the idea.
            But, if you don't mind... I've another question; you said we can load existing Flash8 movie into newly created Flash8 movie and the newly created Flash8 movie will do all the communication. Then why can't we just add that "communication" part of code to the existing movies? That ways each movie, now, can communicate with Flex on it's own. Isn't that it? Or am I missing something?
            • 3. Re: .swf end of movie
              peterent Level 2
              In my earlier reply I said I was under the assumption that you cannot change the SWFs. If you can change the SWFs, then put the LocalConnection code in them.
              • 4. Re: .swf end of movie
                shatru2k Level 1
                Hello Peter,

                My bad. I did read it, but I was assuming that when you said "modifying existing SWF" you were saying "modifying them in AS3 or Flash9" or something. And now, that doesn't sound right in my head...

                Anyway, thanks for the guidence.

                I'm sure this is going to solve our problem.

                Thanks again

                • 5. Re: .swf end of movie
                  peterent Level 2
                  If you get a chance, you'll find that Flash CS3 integrates smoothly with Flex 2 so you might want to explore that for the future.