sory I did not asked right ...my img are not quoted as an array ...
the names would be ...img_pa1, img_pa2, img_gr1, img_s3,img_m2 ...
I select a view with mouse clicked ...and with the 4 buttons I mouve the selected view to left,right, top and bottom ...
the sub btn_left_mouseclicked ... must receive a view coresponding to the selcted view
Ok ...I have solved the problem by initialising all views with
imgx.initialise("img")
imgx.tag="imgx"
anyway my example does not fit for a general case so I had to change a bit the code
Thank you!
B4X:
Sub btn_left_MouseClicked (EventData As MouseEvent)
Dim img_x As ImageView
img_x=pnl_tixi.GetNode(get_nodindex)
img_x.left=img_x.left-1dip
End Sub
Sub btn_right_MouseClicked (EventData As MouseEvent)
Dim img_x As ImageView
img_x=pnl_tixi.GetNode(get_nodindex)
img_x.left=img_x.left+1dip
End Sub
Sub btn_up_MouseClicked (EventData As MouseEvent)
Dim img_x As ImageView
img_x=pnl_tixi.GetNode(get_nodindex)
img_x.top=img_x.top-1dip
End Sub
Sub btn_down_MouseClicked (EventData As MouseEvent)
Dim img_x As ImageView
img_x=pnl_tixi.GetNode(get_nodindex)
img_x.top=img_x.top+1dip
End Sub
Sub get_nodindex As Int
Dim xv As Int
Select imgtag
Case "img_pa1"
xv=img_pa1.Id
Case "img_gr1"
xv=img_gr1.Id
End Select
Log("view"&xv)
Return xv
End Sub