Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Ti.Media.saveToPhotoGallery not working?

So I have 13 views that only have images displayed on them, pulled from a folder in the Resources directory of my App. There is a RightNavButton that pops up an OptionDialog that asks if the user wants to save the file or close. If they save, it pulls the image and saves it to the Photo Gallery. For some reason it crashes whenever "Save Image" is pressed.

Here is my code.

Any help?

PS - Yes, the files are named "promo#.jpg", where # starts at 0 and goes to 13.

— asked November 4th 2010 by Colton Arabsky
  • photogallery
  • save
0 Comments

2 Answers

  • Accepted Answer

    is this line of code correct?

    if (e.index == 0) {
    

    if you look above, you don't define "e" as a parameter so this

    savedialog.addEventListener('click', function() {
    

    should be this

    savedialog.addEventListener('click', function(e) {
    
    — answered November 9th 2010 by Aaron Saunders
    permalink
    1 Comment
    • Oh lordy, you seem to be right! Let me test that out.

      — commented November 9th 2010 by Colton Arabsky
  • My goodness. Thank you for very much Aaron. Seems I must've missed that. Even the stupidest little mistakes can screw you up! :P

    Thank you! :)

    Morale of the story: Check you're defining your parameters!

    — answered November 9th 2010 by Colton Arabsky
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.