2 Replies Latest reply on Dec 4, 2008 1:56 AM by Garfyld

    Slide show with embedded images

    Garfyld
      Hi,
      I want to create a slide show (sort of - only one picture should be visible at one time) with embedded images.
      My idea was to create an array full of image-objects like this:

      <mx:Array id="ImageDataSet">
      <mx:Image id="i04" source="@Embed('c:\blabla\blub.jpg')" />
      ....
      </mx:Array>

      and to set the selected image (I want to use a slider, that returns an index (int) for the selection) as my displayed image - something like this :

      <mx:Image id="realImage"/> //my displayed image container
      realImage = ImageDataSet[index]; //activated in a AS-function when the slider index changes

      It does not work this way.
      An other idea was to use DisplayObjectContainer and the addChild function, but I didn't got it to display the child on the top in my "realImage".

      Can somebody help me to display embedded images in one image container like a slide show?
      Thanks,
      Steffen
        • 1. Re: Slide show with embedded images
          Level 7

          "Garfyld" <webforumsuser@macromedia.com> wrote in message
          news:ggp45n$lb2$1@forums.macromedia.com...
          > Hi,
          > I want to create a slide show (sort of - only one picture should be
          > visible at
          > one time) with embedded images.
          > My idea was to create an array full of image-objects like this:
          >
          > <mx:Array id="ImageDataSet">
          > <mx:Image id="i04" source="@Embed('c:\blabla\blub.jpg')" />
          > ....
          > </mx:Array>
          >
          > and to set the selected image (I want to use a slider, that returns an
          > index
          > (int) for the selection) as my displayed image - something like this :
          >
          > <mx:Image id="realImage"/> //my displayed image container
          > realImage = ImageDataSet[index]; //activated in a AS-function when
          > the
          > slider index changes
          >
          > It does not work this way.
          > An other idea was to use DisplayObjectContainer and the addChild function,
          > but
          > I didn't got it to display the child on the top in my "realImage".
          >
          > Can somebody help me to display embedded images in one image container
          > like a
          > slide show?

          This might help:
          http://examples.adobe.com/flex2/inproduct/sdk/photoviewer/PhotoViewer.html


          • 2. Slide show with embedded images
            Garfyld Level 1
            I found one possible solution. Use the ViewStack element!
            Like this:

            <mx:ViewStack id="ImageViewStack" selectedIndex="0">
            <mx:Canvas>
            <mx:Image id="iv01" scaleContent="true" source="@Embed('blabla/image001.png')" />
            </mx:Canvas>
            < ... next canvas with image ...>
            </mx:ViewStack>

            To select the different levels/images I used a slider:

            <mx:HSlider id="ImageSlider"... change="ImageViewStack.selectedIndex=ImageSlider.value-1" />
            With this change-attribut it is possible to scroll through the images.

            Steffen