2 Replies Latest reply on Jan 8, 2009 9:26 PM by rtalton

    Image Fade Out/Load new Image/Fade In

    EWN-CMI Level 1
      I think I am having an event timing issue. My desire is to change the "header" image on each selection of a tabNavigator. I can swap the image without issue through a img.load process. I placed the image on a canvas and set the "showEffect" and "hideEffect" on the canvasto fadeIn and fadeOut. (I actually have 2 images on the canvas) On the tabNavigator "change" event I call my getImage() function and set canvs.visible=false, I have the tab index for img.load=headerPic[idx] and then I set canvs.visible=true; The result is that I do not get the first visible change, I think. Tab 1 is initialized to visible in ionComplete, clicking on tab 1 has no effect since it is selected already. When tab 2 is selected the image changes to the new image immediately and then fadesOut. Tab 3 then will fadeIn. Also regardless of the tab selected, if I select another tab the ongoing fade effect will continue on the newly selected tab. It seems the load method doesn't care about effects - so I don't know how to sequence these effects.

      Thanks in advance.
        • 1. Re: Image Fade Out/Load new Image/Fade In
          Level 7

          "EWN-CMI" <webforumsuser@macromedia.com> wrote in message
          news:gk46uv$blo$1@forums.macromedia.com...
          >I think I am having an event timing issue. My desire is to change the
          >"header"
          > image on each selection of a tabNavigator. I can swap the image without
          > issue
          > through a img.load process. I placed the image on a canvas and set the
          > "showEffect" and "hideEffect" on the canvasto fadeIn and fadeOut. (I
          > actually
          > have 2 images on the canvas) On the tabNavigator "change" event I call my
          > getImage() function and set canvs.visible=false, I have the tab index for
          > img.load=headerPic[idx] and then I set canvs.visible=true; The result is
          > that
          > I do not get the first visible change, I think. Tab 1 is initialized to
          > visible in ionComplete, clicking on tab 1 has no effect since it is
          > selected
          > already. When tab 2 is selected the image changes to the new image
          > immediately
          > and then fadesOut. Tab 3 then will fadeIn. Also regardless of the tab
          > selected, if I select another tab the ongoing fade effect will continue on
          > the
          > newly selected tab. It seems the load method doesn't care about effects -
          > so I
          > don't know how to sequence these effects.

          You can use the completeEffect on Image to have an effect every time an
          image loads, such as you can see used here
          http://examples.adobe.com/flex2/inproduct/sdk/photoviewer/PhotoViewer.html,
          but I don't think there's a corresponding effect that you can apply to the
          old image before the change.

          I think you're going to need to use ActionScript to get the control over the
          effects that you want, so you can call either the end() or the reverse()
          method on the effect when the graphic needs to change in mid-effect.

          HTH;

          Amy


          • 2. Re: Image Fade Out/Load new Image/Fade In
            rtalton Level 4
            Wow you lost me! Not sure what you're trying to fade, an icon on the tab navigator's tab, or an image on a canvas...can you describe what you want to happen?