I am having trouble with the below code. The object is : when a user left-clicks this button the button copy's itself, places the button at a placeholder (which is a graphic object) and renames itself. when a user right-clicks the botton removes itself if the name of the button starts with an A.
I cannot find what I am doing wrong in the following code
Code: Select all
on mouseup pButtonNumber
if pButtonNumber = 1 -- (left Mouse button)
then
copy me to grp "grp_BuyBlock" of this card
put it into tNewObjectID
set the topleft of button id tNewObjectID to the topleft of graphic "PlacementPoint"
set the short name of btn tNewObjectID to "A_" & the short name of me
end if
--
if pButtonNumber = 3 -- (Right Mouse button)
then
if the the first character of the label of me is "A"
then
delete me
else
exit mouseup
end if
end if
end mouseup
Paul