开发者

Action Script function call from PHP error

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);
        }


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜