Naming photo from library
Posted: Sat Sep 12, 2015 7:28 pm
I am hoping someone can help me. I am trying to import an image from the iOS camera roll library. This button script works fine except for the namePhoto part. It's as if it's not running. I am testing it in the simulator. I have tried to call it from the card script, place it within the else section, and as shown after the else/end if statements. I also added a wait 0 milliseconds with messages after the end if. It's important that the user be able to name the photo. Thanks!
on mouseUp
set the icon of me to 2228
mobilePickPhoto "library", 640,480
if the result is "cancel" then
answer "No picture selected"
else
if there is an image "photoPreview" then
delete image "photoPreview"
end if
set the name of last image to "photoPreview"
wait 10 milliseconds
set the rect of image "photoPreview" to the rect of card button "imageHolder"
set the loc of image "photoPreview" to the loc of card button "imageHolder"
set the visible of image "photoPreview" to true
set the bottom of image "photoPreview" to the bottom of button "photoLocator"
end if
namePhoto
end mouseUp
on namePhoto
ask "Please name your photo"
put it into tName
put tName into field "fImageName"
end namePhoto
on mouseUp
set the icon of me to 2228
mobilePickPhoto "library", 640,480
if the result is "cancel" then
answer "No picture selected"
else
if there is an image "photoPreview" then
delete image "photoPreview"
end if
set the name of last image to "photoPreview"
wait 10 milliseconds
set the rect of image "photoPreview" to the rect of card button "imageHolder"
set the loc of image "photoPreview" to the loc of card button "imageHolder"
set the visible of image "photoPreview" to true
set the bottom of image "photoPreview" to the bottom of button "photoLocator"
end if
namePhoto
end mouseUp
on namePhoto
ask "Please name your photo"
put it into tName
put tName into field "fImageName"
end namePhoto