Dissolve gelatin in boiling water. Drain pineapple, reserving juice. Stir cold water, bananas, marshmallows and pineapple into gelatin. Pour into 13x9x2-inch pan that has been coated with nonstick cooking spray. Refrigerate until firm.
In a saucepan, combine sugar and flour. Stir in pineapple juice until smooth. Bring to a boil over medium heat; cook and stir for 2 minutes until thickened and bubbly. Reduce heat and cook 2 minutes longer. Remove from heat.
In a small bowl, stir a small amount of hot filling into beaten egg; return all to pan, stirring constantly. Bring to a gentle boil, cook and stir 2 minutes longer. Cool.
In a mixing bowl beat cream cheese until smooth; add cooled egg mixture. Fold in whipped cream and spread over gelatin. Sprinkle with nuts and coconut, if desired. Serves 12.