Hi Coronalabs,
I’m having an issue with your loadPlayerPhoto implementation. What is your motivation for returning a displayObject as the event.data.photo? What we need is the binary data, either as a replacement or as an extra value. Something that can be saved to disk without any hassle.
If you play for instance 10 matches against the same opponent and you show them in a tableview, there will be 10 rows. To be able to show the opponent image on all the rows, we have to loadPlayerPhoto 10 times. If we instead had it saved on disk it would be just 1 network roundtrip.
If the game has 2 tabs - “My turn” and “Opponent turn”, it gets even worse. The normal thing to do when the tabs are switched is to remove the old tableview and create a new one with the correct data. But display.remove(tableview) will also remove the photo display objects. Which means we’ll have to issue another 10 network roundtrips to get new copies of the photos.
If you only supported cloning of display objects your implementation of loadPlayerPhoto would be OK. As it is now, it just stinks.
You’ll probably suggest to flash the loaded photo on the stage, save the displayObject group to disk and then use that. And that is probably what we’ll end up doing, even if it will look really unprofessional with the flashing. But it does not make up for the loadPlayerPhoto Corona Stupidness…
Or do you have any better solutions? How about adding event.data.binaryphoto to the table data, that would be valuable for everyone using your product.