5 Replies Latest reply on Dec 24, 2012 9:22 AM by kglad

    Flash templates with text?

    Sillyjilly917

      Hi. I am working on a small video that includes a picture, a song, falling snow (I am using Flash's snow template) and scrolling text. My problem is i can get everything to work property until the last step, which is adding the text. When i add the text the snow stops. I have no idea why its happening or what im doing wrong. Also, while im here, is there a way to slow down the text? The scrolling text zips through the stage and i can't figure out how to slow it down.

       

      I am using Adobe Flash CS5 on Mac 10.8.2. Yes, I checked the updates last night and I have all the updates.

       

      Thank you in advance!

        • 1. Re: Flash templates with text?
          kglad Adobe Community Professional & MVP

          what code are you using to display snow and text?

          • 2. Re: Flash templates with text?
            Sillyjilly917 Level 1

            Here is the code for the snow...  as for the text i am just making a text box, inserting a frame and then creating the tween. then i go to play it and the snow is gone... not sure what to do.

            Screen Shot 2012-12-23 at 5.02.03 PM.png

            • 3. Re: Flash templates with text?
              kglad Adobe Community Professional & MVP

              not enough of your code is displayed to determine exactly what you're doing.  you should copy and paste your code here.

               

              or, just assume the problem is caused by the playhead re-entering the frame that contains that code.  if that's the situation, use something like:

               

              var alreadyExecuted:Boolean;

               

              if(!alreadyExecuted){

              alreadyExecuted=true;

              .

              .

              // your snow creating code

              .

              .

              }

              1 person found this helpful
              • 4. Re: Flash templates with text?
                Sillyjilly917 Level 1

                try this one...

                 

                 

                // Number of symbols to add.
                const NUM_SYMBOLS:uint = 75;

                 

                var symbolsArray:Array = [];
                var idx:uint;
                var flake:Snow;

                for (idx = 0; idx < NUM_SYMBOLS; idx++) {
                    flake = new Snow();
                    addChild(flake);
                    symbolsArray.push(flake);
                    // Call randomInterval() after 0 to a given ms.
                    setTimeout(randomInterval, int(Math.random() * 10000), flake);
                }

                 

                function randomInterval(target:Snow):void {
                   
                    // Set the current Snow instance's x and y property
                    target.x = Math.random()* 550-50;
                    target.y = -Math.random() * 200;
                   
                    //randomly scale the x and y
                    var ranScale:Number = Math.random() * 3;
                    target.scaleX = ranScale;
                     target.scaleY = ranScale;
                   
                    var tween:String;
                    // ranScale is between 0.0 and 1.0
                    if (ranScale < 1) {
                        tween = "slow";
                       
                    // ranScale is between 1.0 and 2.0
                    } else if (ranScale < 2) {
                        tween = "medium";
                       
                    // ranScale is between 2.0 and 3.0
                    } else {
                        tween = "fast";
                       
                    }
                    //assign tween nested in myClip
                    myClip[tween].addTarget(target);
                   
                }

                 

                • 5. Re: Flash templates with text?
                  kglad Adobe Community Professional & MVP

                  again, use:

                   

                   

                  var alreadyExecuted:Boolean;

                   

                  if(!alreadyExecuted){

                  alreadyExecuted=true;

                   

                   

                  // Number of symbols to add.
                  const NUM_SYMBOLS:uint = 75;

                   

                  var symbolsArray:Array = [];
                  var idx:uint;
                  var flake:Snow;

                  for (idx = 0; idx < NUM_SYMBOLS; idx++) {
                      flake = new Snow();
                      addChild(flake);
                      symbolsArray.push(flake);
                      // Call randomInterval() after 0 to a given ms.
                      setTimeout(randomInterval, int(Math.random() * 10000), flake);
                  }

                   

                  function randomInterval(target:Snow):void {
                     
                      // Set the current Snow instance's x and y property
                      target.x = Math.random()* 550-50;
                      target.y = -Math.random() * 200;
                     
                      //randomly scale the x and y
                      var ranScale:Number = Math.random() * 3;
                      target.scaleX = ranScale;
                       target.scaleY = ranScale;
                     
                      var tween:String;
                      // ranScale is between 0.0 and 1.0
                      if (ranScale < 1) {
                          tween = "slow";
                         
                      // ranScale is between 1.0 and 2.0
                      } else if (ranScale < 2) {
                          tween = "medium";
                         
                      // ranScale is between 2.0 and 3.0
                      } else {
                          tween = "fast";
                         
                      }
                      //assign tween nested in myClip
                      myClip[tween].addTarget(target);
                     
                  }

                   

                  }