7 Replies Latest reply on Jun 6, 2011 1:20 PM by Maxime Chupin

    SWFLoader and progress bar

    Maxime Chupin Level 1

      Hi!

       

      I try to understand how ProgressBar runs.

      I read http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8c.html#WS2d b454920e96a9e51e63e3d11c0bf63b33-7f99

      but this does not help.

      Indeed, I have a List and a SWFLoader which loads what it is choosen in the list:

       

      <?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"
                     >
        <fx:Script>
          <![CDATA[
               [Bindable]
               public var selectedListItem:Object;
              
          ]]>
        </fx:Script>
       
        <fx:Declarations>
          <fx:Model id="anim">
            <states>
          <state label="Anguinéa" data="animations/flex-ang.swf"/>
          <state label="Mouvement rétrograde" data="animations/flex-astro.swf"/>
          <state label="Bielle de Bérard" data="animations/FLEX-ber.swf"/>
            </states>
          </fx:Model>
        </fx:Declarations>
       
        <s:Panel title="Lot d'animations"
             width="300"  x="600" y="50">
          <s:VGroup left="10" right="10" top="10" bottom="10">
            <s:Label text="Selectionner une animation"/>
            <s:Label text="Actuellement '{selectedListItem.data}'"/>
            <mx:List id="source" width="100%" color="blue"
                 dataProvider="{anim.state}"
                 change="selectedListItem = List(event.currentTarget).selectedItem"/>
          </s:VGroup>
        </s:Panel>
       
        <s:Panel x="30" y="50" width="510" height="580">
          <mx:Canvas>
            <mx:ProgressBar width="200" source="animation" mode="polled"/>
          </mx:Canvas>
          <mx:SWFLoader id="animation" source="{selectedListItem.data}" autoLoad="true"/>
        </s:Panel>
      </s:Application>

       

      But I do not understand what I have to write in the source tag of the progress bar.

      Can someone explain to me?

      Thanks.