Compiling code. Error
Error parsing program.
Error description: Undeclared variable 'button2' is used before it was assigned any value.
Occurred on line: 57
Button2.setbackgroundimage(LoadBitmap(File.dirassets,"credits.jpg"))
My code looks like this:
Sub Button2_Click
Button2.setbackgroundimage(LoadBitmap(File.dirassets,"credits.jpg"))
End Sub
'Activity module
Sub Process_Globals
End Sub
Sub Globals
' declare your image variable which is credits.jpg
Dim creditButtonImage As Bitmap
' tell the compiler you are setting up a button
Dim creditButton As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
' load the image into memory
creditButtonImage.Initialize(File.DirAssets, "credits.jpg")
'
' load the apps main layout
Activity.LoadLayout("main1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub creditButton_Click
' here set the creditButton you told the compiler about and call setbackgroundimage with the file you earlier loaded into memory
creditButton.setbackgroundimage(LoadBitmap(File.dirassets,"credits.jpg"))
End Sub
Well, we are getting closer to what I want. Now when I click on Button2, the JPG file overlays Button2. I would like it to replace the current view with just the JPG image.