2 Replies Latest reply on Aug 17, 2010 9:34 PM by Vasiqullah

    Image Slideshow problem ?

    Vasiqullah

      The following is the code for the image slideshow which I've created ..

       

      The problem in this application is that when it reaches  the 4th image and after ending the effects of the 4th one it abruptly displays the 1st image rather than displaying it  by increasing the transperancy effect. I don't know where did i get  wrong. Any help on this guys..

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
          <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
              <s:Sequence id="homeSlideShow1">
                  <s:Animate id="homeImage12"
                             duration="3000"
                             effectEnd="homeImage4.alpha=0;"
                             target="{homeImage1}">
                      <s:SimpleMotionPath property="alpha"
                                          valueFrom="0" valueTo="1"/>
                  </s:Animate>
                 
                  <s:Animate id="homeSlideshow12"
                             duration="3000"
                             target="{homeImage2}"
                             effectEnd="homeImage1.alpha=0;">
                      <s:SimpleMotionPath property="alpha"
                                          valueFrom="0" valueTo="1"/>
                  </s:Animate>
                 
                  <s:Animate id="homeSlideshow13"
                             duration="3000"
                             effectEnd="homeImage2.alpha=0;"
                             target="{homeImage3}">
                      <s:SimpleMotionPath property="alpha"
                                          valueFrom="0" valueTo="1"/>
                  </s:Animate>
                 
                  <s:Animate id="homeSlideshow14"
                             duration="3000"
                             target="{homeImage4}"
                             effectEnd="homeImage3.alpha=0, homeSlideShow1.play();">
                      <s:SimpleMotionPath property="alpha"
                                          valueFrom="0" valueTo="1"/>
                  </s:Animate>       
              </s:Sequence>
          </fx:Declarations>
         
          <s:BorderContainer x="100" y="167.15"
                             id="home_slideshow"
                             width="700" height="300"
                             dropShadowVisible="true"
                             creationComplete="homeSlideShow1.play()">
              <mx:Image x="0" y="0"
                        id="homeImage1"
                        width="700" height="300"
                        source="../HomeSlideshow/1.png"/>
              <mx:Image x="0" y="0"
                        id="homeImage2"
                        alpha="0"
                        width="700" height="300"
                        source="../HomeSlideshow/2.jpg"/>
              <mx:Image x="0" y="0"
                        id="homeImage3"
                        alpha="0"
                        width="700" height="300"
                        source="../HomeSlideshow/3.jpg"/>
              <mx:Image x="0" y="0"
                        id="homeImage4"
                        alpha="0"
                        width="700" height="300"
                        source="../HomeSlideshow/4.gif"/>
          </s:BorderContainer>
         
      </s:Application>

        • 1. Re: Image Slideshow problem ?
          Balakrishnan V Level 3

          The problem is in the fact that you never set the homeImage4.alpha to 0 at any stage.

           

          A workaround to this problem would be replacing your <s:Sequence /> with the following

           

          <s:Sequence id="homeSlideShow1">

          <s:Animate id="homeImage12"

             duration="3000"

             effectStart="homeImage4.alpha=0"

             effectEnd="homeImage4.alpha=0;"

             target="{homeImage1}">

          <s:SimpleMotionPath property="alpha"

          valueFrom="0" valueTo="1"/>

          </s:Animate>

           

          <s:Animate id="homeSlideshow12"

             duration="3000"

             target="{homeImage2}"

             effectEnd="homeImage1.alpha=0;">

          <s:SimpleMotionPath property="alpha"

          valueFrom="0" valueTo="1"/>

          </s:Animate>

           

          <s:Animate id="homeSlideshow13"

             duration="3000"

             effectEnd="homeImage2.alpha=0;"

             target="{homeImage3}">

          <s:SimpleMotionPath property="alpha"

          valueFrom="0" valueTo="1"/>

          </s:Animate>

           

          <s:Animate id="homeSlideshow14"

             duration="3000"

             target="{homeImage4}"

             effectEnd="homeImage3.alpha=0">

          <s:SimpleMotionPath property="alpha"

          valueFrom="0" valueTo="1"/>

          </s:Animate>

          <s:Animate id="homeSlideshow15"

             duration="3000"

             target="{homeImage4}"

             effectStart="homeSlideShow1.play();">

          <s:SimpleMotionPath property="alpha"

          valueFrom="1" valueTo="0"/>

          </s:Animate>       

          </s:Sequence>

           

          Hope this helps,

           

          Balakrishnan V

          • 2. Re: Image Slideshow problem ?
            Vasiqullah Level 1

            Thanks for the help it's working fine now.....