Quiero refrescar el contenido al cambiar de contenedor, ya que en en uno se va a agregar algo y en otra tengo que mostralo, trate de modificar algo en change, pero no me funciona me da error #1069.
Aqui esta el problema, en newIndex me imagino
Código Flex :
private function stackHandle(event:IndexChangedEvent):void{
var obj:Object = viewstack1.getChildAt(event.newIndex);
obj.reload();
}Dejo el codigo completo
Código Flex :
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" width="990" height="550" xmlns:com="com.*">
<mx:Script>
<![CDATA[
import mx.events.IndexChangedEvent;
import mx.controls.Alert;
import mx.rpc.events.*;
private function stackHandle(event:IndexChangedEvent):void{
var obj:Object = viewstack1.getChildAt(event.newIndex);
obj.reload();
}
]]>
</mx:Script>
<mx:HBox width="100%" height="100%" y="0" x="0" styleName="colorPanel">
<mx:VBox width="230" height="100%">
<mx:Canvas width="100%" height="100%">
<mx:Canvas left="10" top="10" width="100%" height="60" backgroundColor="#ebebe9" styleName="homeSection">
<mx:Label left="10" top="10" text="Bienvenido!" width="112" height="22" styleName="sectionHeader"/>
<mx:Label x="10" y="30" text="Nombre Apellido"/>
</mx:Canvas>
<mx:Canvas left="10" top="78" width="100%" height="336" backgroundColor="#ffffff" styleName="homeSection">
<mx:VBox left="10" top="10" width="100%" height="311" verticalGap="0">
<mx:Label text="Mi Closet" styleName="sectionHeader"/>
<mx:HRule height="5" width="197"/>
<mx:LinkBar dataProvider="viewstack1" direction="vertical" borderColor="#FFFFFF">
</mx:LinkBar>
<mx:Spacer height="8" width="100%"/>
<mx:Label text="Lo que Busco" styleName="sectionHeader"/>
<mx:HRule height="5" width="197"/>
<mx:LinkButton label="Agregar" textAlign="center" styleName="homeProgramHeader"/>
<mx:LinkButton label="Modificar"/>
<mx:LinkButton label="Eliminar"/>
<mx:Spacer height="8" width="100%"/>
<mx:Label text="Buscar" styleName="sectionHeader"/>
<mx:HRule height="5" width="197"/>
<mx:HBox width="100%" horizontalAlign="center">
<mx:TextInput width="121"/>
<mx:Button label="Buscar" styleName="glass"/>
</mx:HBox>
</mx:VBox>
</mx:Canvas>
<mx:Canvas left="10" top="422" width="100%" height="118" styleName="homeSection" backgroundColor="#ebebe9">
<mx:VBox left="10" top="10" width="100%" height="100%" verticalGap="0">
<mx:Label text="Mi Cuenta" styleName="sectionHeader"/>
<mx:Label text="Actualizar Datos"/>
<mx:Label text="Cambiar Contraseña"/>
<mx:Label text="Ver mi Perfil"/>
</mx:VBox>
</mx:Canvas>
</mx:Canvas>
</mx:VBox>
<mx:VBox width="750" height="100%">
<mx:Canvas width="100%" height="100%">
<!-- can't use binding to set the mapImage source because the style isn't available early enough -->
<mx:Canvas width="100%" height="530" backgroundColor="#ffffff" borderStyle="solid" cornerRadius="4" bottom="10" right="10">
<mx:ViewStack creationPolicy="all" selectedIndex="0" change="stackHandle(event)" x="21.5" y="10" id="viewstack1" width="716.5" height="518">
<com:verPrendas id="verPrendas" label="Mi Ropa"
height="518" width="714" show="{verPrendas}"/>
<com:crearPrendas id="AgregarPrenda" label="Agregar"
height="518" width="714"/>
<mx:Canvas label="Actualizar" width="100%" height="100%">
</mx:Canvas>
<mx:Canvas label="Quitar" width="100%" height="100%">
</mx:Canvas>
</mx:ViewStack>
</mx:Canvas>
</mx:Canvas>
</mx:VBox>
</mx:HBox>
</mx:Canvas>
Espero su ayuda
saludos
