Note that there are some explanatory texts on larger screens.

plurals
  1. POrefresh the itemrenderer of each item in the List component Flex
    primarykey
    data
    text
    <p>I have the list shown below:</p> <pre><code>&lt;s:List id="list2" width="100%" height="100%" dataProvider="{ recordingsShown }" itemRenderer="components.VideoItemRenderer2" selectedIndex="0" visible="false"&gt; &lt;s:layout&gt; &lt;s:TileLayout id="tilelayout" useVirtualLayout="true" orientation="columns" columnAlign="justifyUsingWidth" rowAlign="justifyUsingHeight" requestedColumnCount="3" requestedRowCount="2" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5" verticalGap="10" horizontalGap="10" /&gt; &lt;/s:layout&gt; &lt;/s:List&gt; </code></pre> <p>which displays in tiles a name, a date and a preview image for each one of the videos contained in the arraycollection recordingsShown given as dataprovider. The problem is when a new video is added,i save the preview pic in a folder and a node describing it in an xml and i put a new item in the arraycollection with </p> <pre><code>recordingsShown.addItemAt(newRecording,0); </code></pre> <p>it is added on stage but the preview image of the last added video is not shown! How can i redraw the whole list in order to show it?</p> <p>Here is my itemRenderer:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300" autoDrawBackground="true"&gt; &lt;fx:Metadata&gt; [Event(name="playClicked", type="flash.events.Event")] &lt;/fx:Metadata&gt; &lt;fx:Script&gt; &lt;![CDATA[ import flash.filters.GlowFilter; import mx.controls.Alert; import mx.events.FlexEvent; import mx.formatters.DateFormatter; protected function img_rollOverHandler(evt:MouseEvent):void { Image(evt.currentTarget).filters = [new GlowFilter(0xf7941d)]; Image(evt.currentTarget).alpha = 0.9; } protected function img1_rollOutHandler(evt:MouseEvent):void { Image(evt.currentTarget).filters = []; Image(evt.currentTarget).alpha = 1; } protected function playClickHandler(event:MouseEvent):void { dispatchEvent(new Event("playClicked",true,true)); } ]]&gt; &lt;/fx:Script&gt; &lt;fx:Declarations&gt; &lt;s:DateTimeFormatter id="dateTimeFormatter" dateTimePattern="DD.MM.YYYY HH.NN.SS"/&gt; &lt;/fx:Declarations&gt; &lt;s:states&gt; &lt;s:State name="normal" /&gt; &lt;s:State name="hovered" /&gt; &lt;s:State name="selected" /&gt; &lt;/s:states&gt; &lt;s:Rect width="100%" height="100%" radiusX="5" radiusY="5"&gt; &lt;s:filters&gt; &lt;s:DropShadowFilter alpha="0.32" alpha.hovered="0.5" blurX="5" blurY="5" distance="2" /&gt; &lt;/s:filters&gt; &lt;s:fill&gt; &lt;s:LinearGradient rotation="90"&gt; &lt;s:GradientEntry color="0x323232" color.selected="black"/&gt; &lt;s:GradientEntry color="#7f7f7f" color.selected="0x333333"/&gt; &lt;/s:LinearGradient&gt; &lt;/s:fill&gt; &lt;s:stroke&gt; &lt;s:SolidColorStroke color="#ffffff" color.hovered="#f7941d" color.selected="#ed7f09" caps="none" weight="2" joints="miter" miterLimit="4"/&gt; &lt;/s:stroke&gt; &lt;/s:Rect&gt; &lt;s:Label left="10" top="10" fontStyle="italic" fontWeight="bold" color="#f7941d" text="{dateTimeFormatter.format(data.date)}"/&gt; &lt;s:Label left="10" top="25" fontSize="16" fontWeight="bold" color="#ffffff" text="{data.name}"/&gt; &lt;s:Image id="previewImg" left="10" right="10" bottom="10" top="55" scaleMode="stretch" smooth="true" source="http://localhost:5080/thumbs/{data.thumb}" /&gt; &lt;!-- source="assets/img.jpg"/&gt; --&gt; &lt;s:Image source="assets/play.png" rollOver="img_rollOverHandler(event);" rollOut="img1_rollOutHandler(event);" x="136" y="102" click="playClickHandler(event)" complete="this.invalidateSize()"/&gt; &lt;/s:ItemRenderer&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload