Results 1 to 6 of 6
  1.    #1  
    Hi!

    In my app preGym I want to give the users the chance to select their own Sounds. There for I use this code:

    Code:
    button1Tap: function(event, inSender) {
    		var params = {
    			defaultKind: 'audio',
    			onSelect: function(file){
    				this.sound = Object.toJSON(file);
    			}
    		}
    		Mojo.FilePicker.pickFile(params, this.controller.stageController);
    	}
    This code doesn't work for me. I want to have the full path nothing more.

    Means: ./app/test.mp3
    Not: Fullpath:./app/test.mp3

    What do I have to do? I have never worked with JSON. Tried to google my problem but havn't found a sulution yet. Would love to get some help. Thanks!
  2. #2  
    I don't fully understand the question.


    My bad J, that code before was for the people picker, not the file picker...

    you cannot use "this.sound" in an anonymous method...create a method to handle the selection and replace your anonymous method with the function ala this:

    onSelect:this.handleFileSuccess.bind(this)
    Last edited by infamousdutch; 04/19/2010 at 09:12 PM.
    Wifi Media Sync 3.0 now available for PC and Mac OSX.
  3.    #3  
    Quote Originally Posted by infamousdutch View Post
    I don't fully understand the question.


    My bad J, that code before was for the people picker, not the file picker...

    you cannot use "this.sound" in an anonymous method...create a method to handle the selection and replace your anonymous method with the function ala this:

    onSelect:this.handleFileSuccess.bind(this)
    This code is actually ripped from the mojo examples of the Palm SDK. I installed the mojomatters sdk examples and there everything seems to work fine. I will try your method. I would love if you could get a bit more detail. Because I don't fully understand you. What I need is a filepicker for audio that gives me the fullpath in a string (only the fullpath nothing more). That would be awesome. I will experement tomorrow. Thank you so much for helping me out a bit!
  4. #4  
    I pulled this from one of my apps, I hope it helps...it was for picking a picture

    //image picker code
    Mojo.FilePicker.pickFile({kinds: ['image'],
    actionName: 'Tweet Pic!',
    onSelect:this.handleCameraSuccess.bind(this)
    }
    ,this.controller.stageController);


    ///handle on select code
    .handleCameraSuccess = function(file){

    //
    var imgf = Object.toJSON(file);
    this.photoPath = file.fullPath;
    this.iconPath = file.iconPath;
    Wifi Media Sync 3.0 now available for PC and Mac OSX.
  5.    #5  
    Works more then perfect! Thank you very much. Sorry for the late response. Was on a holiday trip!
  6. #6  
    NP J, what's the app's name? is it in the app cat yet?
    Wifi Media Sync 3.0 now available for PC and Mac OSX.

Posting Permissions