Hi everyone I'm new to flex and I've been trying to creat a program but i'm 
stuck on something simple and i'm not sure what im doing wrong please help

I'm conecting flex to php using the zen service, and i can load the data on the 
form with no problem, following the adobe tutorial i'm trying to update or save 
the changes made to the data, but im getting this error "1067: Implicit 
coercion of a value of type valueObjects:DatosEmpresa to an unrelated type 
valueObjects:Empresa."

This is the complete code:


<?xml version="1.0" encoding="utf-8"?>
<ns:MDIWindow xmlns:fx="http://ns.adobe.com/mxml/2009";
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          xmlns:mx="library://ns.adobe.com/flex/mx"
                          xmlns:ns="http://code.google.com/p/flexlib/";
                          xmlns:empresaservice="services.empresaservice.*"
                          xmlns:valueObjects="valueObjects.*"
                          creationComplete="init()"
                          width="80%" height="80%" layout="absolute" 
title="Empresa">
        <fx:Script>
                <![CDATA[
                        import mx.controls.Alert;
                        
                        protected function init():void
                        {
                                getEmpresaByIDResult.token = 
empresaService.getEmpresaByID(parseInt("1"));
                        }
                        
                        
                        protected function 
button2_clickHandler(event:MouseEvent):void
                        {
                                datosEmpresa.NOMBRE_EMP = 
nOMBRE_EMPTextInput.text;
                                datosEmpresa.DIRECCION_EMP = 
dIRECCION_EMPTextInput.text;
                                datosEmpresa.TELEFONO1_EMP = 
tELEFONO1_EMPTextInput.text;
                                datosEmpresa.TELEFONO2_EMP = 
tELEFONO2_EMPTextInput.text;
                                datosEmpresa.TELEFONO3_EMP = 
tELEFONO3_EMPTextInput.text;
                                datosEmpresa.EMAIL_EMP = 
eMAIL_EMPTextInput.text;
                                datosEmpresa.LOGO_LINK_EMP = 
lOGO_LINK_EMPTextInput.text;
                                updateEmpresaResult.token = 
empresaService.updateEmpresa(datosEmpresa);
                        }
                        
                ]]>
        </fx:Script>
        <fx:Declarations>
                <empresaservice:EmpresaService id="empresaService"
                                                                           
fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                                           
showBusyCursor="true"/>
                <s:CallResponder id="getEmpresaByIDResult"
                                                 result="datosEmpresa = 
getEmpresaByIDResult.lastResult as DatosEmpresa"/>
                <valueObjects:DatosEmpresa id="datosEmpresa"/>
                <s:CallResponder id="updateEmpresaResult"/>
        </fx:Declarations>
        <mx:Form top="50" defaultButton="{btnActualizar}" horizontalCenter="0">
                <mx:FormItem label="Nombre">
                        <s:TextInput id="nOMBRE_EMPTextInput" 
text="{datosEmpresa.NOMBRE_EMP}" width="150"/>
                </mx:FormItem>
                <mx:FormItem label="Dirección">
                        <s:TextInput id="dIRECCION_EMPTextInput" 
text="{datosEmpresa.DIRECCION_EMP}" width="250"/>
                </mx:FormItem>
                <mx:FormItem label="Telefono 1">
                        <s:TextInput id="tELEFONO1_EMPTextInput" 
text="{datosEmpresa.TELEFONO1_EMP}"/>
                </mx:FormItem>
                <mx:FormItem label="Telefono 2">
                        <s:TextInput id="tELEFONO2_EMPTextInput" 
text="{datosEmpresa.TELEFONO2_EMP}"/>
                </mx:FormItem>
                <mx:FormItem label="Telefono 3">
                        <s:TextInput id="tELEFONO3_EMPTextInput" 
text="{datosEmpresa.TELEFONO3_EMP}"/>
                </mx:FormItem>
                <mx:FormItem label="Email">
                        <s:TextInput id="eMAIL_EMPTextInput" 
text="{datosEmpresa.EMAIL_EMP}" width="250"/>
                </mx:FormItem>
                <mx:FormItem label="Logo link">
                        <s:TextInput id="lOGO_LINK_EMPTextInput" 
text="{datosEmpresa.LOGO_LINK_EMP}" width="100"/>
                </mx:FormItem>
        </mx:Form>
        <s:Button id="btnActualizar" y="299" label="Actualizar" 
click="button2_clickHandler(event)"
                          horizontalCenter="0"/>
        <s:FormHeading top="10" label="Datos de la Empresa" 
horizontalCenter="0"/>
        
</ns:MDIWindow>


Any ideas!!! Help

Reply via email to