1 Reply Latest reply on Jul 19, 2009 6:17 AM by Ned Murphy

    Can someone explain the structure behind this common practice in most flash websites?

    MorisatoKei

      I'm kind of a newbie with flash. I havent used it in a long long time and when I was using it, I wasnt really fully understanding what I was doing at the time. Anyways, it's been like 10 years now and I have to use it to make a website, but I can't figure out how others are doing this specific thing. I understand the basic concept of how flash works with making a website, and I've even built a very basic website with audio/video and mouse interaction, but now I want to step it up. I've seen many flash websites before and some have a lot of things going on at once and I'm wondering how you implement that smoothly while still allowing mouse interaction and navigation. I know this sounds confusing but basically, what I mean is:

       

      let's say I have a website and on the website I have buttons that lead to different pages(frames) when clicked. On the main page I have something like a bird that flies from left to right. Let's say that the bird is in the middle of the screen and a user clicks a button. How do I make it so that the bird continues to fly off screen before switching pages? Obviously, I cant tell what the location of the bird will be when the button is clicked since it will vary from user to user so I am completely confused on how to structurally set this up. Would the bird be it's own swf embedded in the main swf? Or is this feature a massive keyframing project for every frame of animation that bird has?

       

      Also, how do have multiple animations that run on different clocks looping simultaneously? What I mean by this is, lets say the previously mentioned bird has a 25 frame animation loop and a second element, like a sunrise/sunset has a 30 frame animation loop... how do I loop both of them so that they loop seemlessly at the same time? Will I have to animate both of them in a loop until both reach a common frame (150 frames from 6x 25frame bird loops and 5x 30frame sunrise/sunset loops)?

       

      Thanks,

       

      MorisatoKei

        • 1. Re: Can someone explain the structure behind this common practice in most flash websites?
          Ned Murphy Adobe Community Professional & MVP

          You will have to experiment to see what works well and what doesn't.   You can have things animating along a timeline in parallel, but you can also have them be their own movieclips and animated when commanded to play().

           

          In the case of your bird flying off before a button click is processed, you could manage that as follows.  Have the button set a variable that is defaulted at false to be true.  At the end of the bird's flight, you test that variable ( as in ... if(variable == true)...) to see if it is true, and if so, you process whatever command that button is intended for.  If you used a timeline animtion for the bird, then that test would occur at the last frame of the animation.  If you used a coded tween to move the bird across the scene, then you could use an event listener to detect the animation completed and do the test then.

           

          There are almost always a variety of choices for achieving the same design goal.  The key to determining a solution is knowing what tools you have to work with... and coming to know what those tools are and how to use them is where learning comes in.