1 Reply Latest reply on Nov 12, 2009 5:29 PM by zeroskillz

    Constant Image in Flash Slideshow

    mcdowell5436 Level 1

      Hi There,

       

      I am trying to create a "slideshow" in flash CS4 and I have set it to fade out one image is it fades in another (using alpha) for about 10 - 15 images.

       

      However, I want to add a "border" to my slideshow, that stays there throughout the entire process without it fading in and out along with the pictures.

       

      Is there a way to do this?

       

      Thanks!

       

      Chris

        • 1. Re: Constant Image in Flash Slideshow
          zeroskillz Level 3

          It's hard to say exactly without knowing how your file is setup, but the basics would be to have the 'border'--just a box with a white stroke applied, sitting in front of the pictures. If your using the timeline, add a new layer and drag it above your picture layers. Add your border there...

           

          If programaticly, create the frame and add it to the stage 'above' the pictures.

           

          as example this will add a 10px border...

           

           

          //just a var for the width -- makes it easier to adjust if need be

          var borderWidth:int = 10;

           

          // the sprite that will be your border

          var border:Sprite = new Sprite();

           

          // set the fill color and alpha for the border

          border.graphics.beginFill(0xff0000,1)

           

          //draw the outer rectangle for the border the same size as the stage in this case

          border.graphics.drawRect(0,0,stage.stageWidth, stage.stageHeight);

           

          //draw the inner rectangle, inset by the borderWidth var--the values are start x and y, the width and height.

          border.graphics.drawRect(borderWidth,borderWidth,stage.stageWidth-(borderWidth*2), stage.stageHeight-(borderWidth*2));

           

          //just good form, end the fill

          border.graphics.endFill();

           

          //check for children, and if there are some, add the border on top, else just add a border.

          if(this.numChildren>0){

               addChildAt(border, this.numChildren-1);

          }else{

               addChild(border);

          }

           

           

          //END CODE

           

           

          HTH!

          -Ted