5 Replies Latest reply on Aug 16, 2006 3:35 PM by dizcofly

    New to ActionScript

    TDW1181
      I am working in Flash for really the first time, and I have gone about as far as I can go on my limited knowledge. The website I am working on uses flash to "animate" the text when a new page loads (the text comes up from the bottom of the screen quickly, appearing as a black line and then expands horizontally to reveal the text). The problem I am running into is that the text I want to put on this page is about 7 pages long (a page equaling the size of the area I want the text to appear in).

      What I need know is how do I write ActionScript that tells the flash movie to stop once the first page is loaded (each page of text has been imported to Flash as a .jpeg), but then when the user wants to read the next page they simply have to click the text (which is actually a .jpeg image) and it automatically goes to the next page text?

      I appologize if this is very simple and I am not understanding how to do it, or if it is too vague and you don't understand what I am trying to do. Any suggestions or guidance would be much appreciated. Thanks for your help


        • 1. Re: New to ActionScript
          blemmo Level 1
          I guess we need some more info to help you, preferably some code lines.
          Are you loading the jpgs into a MovieClip (the text area)? If so, you can add an onRelease event to that MovieClip, so it will react to a click on it. Inside the event, you can tell Flash to load the next page of text.

          That's all I can offer now, maybe you can upload your fla somewhere or describe the setup of your movie in more detail.

          cheers,
          blemmo

          • 2. Re: New to ActionScript
            TDW1181 Level 1
            There is the problem, I am not sure where to even begin in terms of code. Like I said, I am very new to Flash (less than a month).

            Here is what I can tell you:

            I have seven images that I want to build into a MoveClip. When you go to this particular page on the website, there is a short animation that brings the image to the screen. I want the MovieClip to stop once the image has been fully viewable. From there, I want the reader to be able to click the image (which is simply text in a funky font) and be taken to the next image (which will contain a similar animation and then image #2 appears). I also want the MovieClip to stop once image #2 is fully viewable. I want this to happen for all seven images, with the last image going back to the first image. It would be easy if I could simply have it go to another page, but I don't to do that because I have music embedded on that page and I have not setup the site using frames (which means loading a new page will cause the music to start over).

            I apologize if I am not up to snuff in terms of the code, I am basically a print graphic designer and although I have designed a fair amount of websites, I have never used Flash.
            • 3. Re: New to ActionScript
              blemmo Level 1
              So there's one MovieClip that contains the images and animations? Then you need to put a stop(); command in the frames where the image is in full view, so the playing stops there and the text can be read. To go to the next image, just add an onRelease event to that MC and put a play(); command inside, that will play the MC from the current frame until the next stop() occurs.
              You can add the code to the MC itself, using this lines:

              on(release){
              this.play();
              }

              or to the frame that holds the MC, using this:

              mc.onRelease = function(){
              this.play();
              }

              In the 2nd way, the MC needs an instance name (here 'mc'). I like this way more than the 1st, because your script is on the frame and not on some object, this makes it easier to find it later ;).

              It should also jump to frame 1 when the end of the MC is reached, so there's no special code needed for this case.

              hth,
              blemmo
              • 4. Re: New to ActionScript
                TDW1181 Level 1
                Thanks blemmo, I will give it a try tonight. I appreciate the feedback
                • 5. Re: New to ActionScript
                  dizcofly

                  May I suggest that you do not use JPG images? Instead, write the text inside Flash. Then your text will be vector-based -- it will download way way faster. Also, you may look for a tutorial on masking. Here's one:
                  http://www.webworksite.com/textmasking.shtml
                  If that's not what you meant, you may wish to look instead for a tutorial on 'Tweening'. (Search Google like : 'Flash tutorial tweening'. )