if type(msg)="roTextureRequestEvent" then
state = msg.GetState()
if state = 3
bitmap = msg.GetBitmap()
if type(bitmap)<>"roBitmap" then
'print "Unable to create robitmap"
'print "There was great success"
If you don't use the wait function then you will never get the image.t
I have been developing for roku for several months now and one thing still boggles my mind.
Why name a method AsyncGetToFile if it is truly not Asynchronous? If i have to create a message port and put a wait timer on it for a message to appear then this is not Asynchronous at all. Why didn't the developers at roku think that it would be a good idea to allow image loading straight to an object and then it would appear whenever it was loaded? Am I completely lost or does the Roku Development team not know the meaning of the word Asynchronous. I develop for applications with iOS, Android, C#, and Java...
... and never have run into a programming language that is as horrible as brightscript.
If you don't use the wait function then you will never get the image.
And if the messagePort is a global port and it gets a message for the imageRequest completing then subsequent code will block even if user is pressing buttons because it is on the same msgPort
My main question is this:
Why is there a function AsyncGetToFile(), when said function will not place that file in the temp directory without handling a message from a messagePort?
Shouldn't it place that file straight into the tmp:/ directory without me having to handle a message.