0
votes
var result:int;
if(observerButton.selected == true)
    result = assignMemberAsObserverToEvent(dataGrid.selectedItem.id_event,dataGrid2.selectedItem.id_person,assignmentDescription.text);
else if(adminButton == true) 
    result = assignMemberAsAdministratorToEvent(dataGrid.selectedItem.id_event,dataGrid2.selectedItem.id_person,assignmentDescription.text);
else
    alert("please select the assignment type");

There is error on two assign function calls. The error is: Description Resource Path Location Type 1067: Implicit coercion of a value of type void to an unrelated type int. AssignUser.mxml /pui2/src line 149 Flex Problem

Here their declarations:

protected function assignMemberAsAdministratorToEvent(id_person:String, id_event:String, description:String):void
        {
            assignMemberAsAdministratorToEventResult.token = actions.assignMemberAsAdministratorToEvent(id_person, id_event, description);
        }


        protected function assignMemberAsObserverToEvent(id_person:String, id_event:String, description:String):void
        {
            assignMemberAsObserverToEventResult.token = actions.assignMemberAsObserverToEvent(id_person, id_event, description);
        }
2

2 Answers

1
votes

In both assignMemberAsAdministratorToEvent and assignMemberAsObserverToEvent, you never return anything. 'void' is a type, and the compiler is trying to cast it into an int (your result var) in which it can't because they are not compatible. Either remove the result var or make the functions return something.

0
votes

Both functions return void (i.e. nothing). You are then trying to store void or 'nothing' into an int.

The functions need to return something for result to hold a value