Results 1 to 17 of 17
  1.    #1  
    checked with downforme and its down for all.
  2. #2  
    yep, same here... that sucks. waiting on an answer to my question!
  3.    #3  
    Quote Originally Posted by jdforsythe View Post
    yep, same here... that sucks. waiting on an answer to my question!
    what's your question maybe I can help?
  4. Ccureton's Avatar
    Posts
    66 Posts
    Global Posts
    74 Global Posts
    #4  
    1.4 must be coming!!!!!

    sorry had to do it
  5. #5  
    experience the same, do you thinks its webos 1.4?
  6. #6  
    The dev site is back up.
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  7.    #7  
    Quote Originally Posted by kdubhotsauce View Post
    experience the same, do you thinks its webos 1.4?
    no reason the whole site has to come down for 1.4 most likely a glitch the site whould only come down if they where adding the pdk or flash plugin
  8.    #8  
    it's back up!!!
  9. #9  
    I need to pass a parameter to an event handler.

    Normally I'd do this:

    Code:
    Mojo.Event.listen(this.controller.get('a1'), Mojo.Event.tap, this.a1Tap.bind(this));
    but I'm making battleship and would have 100 listeners. I do not want to have 100 handler functions, so I'd rather do this:

    Code:
    Mojo.Event.listen(this.controller.get('a1'), Mojo.Event.tap, this.tap('a1').bind(this));
    but that runs the tap function at scene load every time.

    is there a way to do this? or a better way than having 100 listeners for a 10x10 grid?
  10. #10  
    btw flash plugin is not coming from palm, it'll be in the app catalog and thus wouldn't do anything to the palm site. nor would 1.4. the pdk, maybe, just while they uploaded the new site
  11.    #11  
    Quote Originally Posted by jdforsythe View Post
    btw flash plugin is not coming from palm, it'll be in the app catalog and thus wouldn't do anything to the palm site. nor would 1.4. the pdk, maybe, just while they uploaded the new site
    by flash pugin i mean the plugin for devs to create native flash apps which should be coming, i hope.
  12.    #12  
    Quote Originally Posted by jdforsythe View Post
    I need to pass a parameter to an event handler.

    Normally I'd do this:

    Code:
    Mojo.Event.listen(this.controller.get('a1'), Mojo.Event.tap, this.a1Tap.bind(this));
    but I'm making battleship and would have 100 listeners. I do not want to have 100 handler functions, so I'd rather do this:

    Code:
    Mojo.Event.listen(this.controller.get('a1'), Mojo.Event.tap, this.tap('a1').bind(this));
    but that runs the tap function at scene load every time.

    is there a way to do this? or a better way than having 100 listeners for a 10x10 grid?
    no need to have 100 handlers for 100 listeners, just check which target element was tapped.
  13. #13  
    can you give a generic example?

    the only way i've used listeners so far is to attach each to a particular div id.

    how else could they be used to check which element was tapped?
  14.    #14  
    Quote Originally Posted by jdforsythe View Post
    can you give a generic example?

    the only way i've used listeners so far is to attach each to a particular div id.

    how else could they be used to check which element was tapped?
    say you are making an on screen keyboard, you set up 30 divs for the keys, each div has a different ID, each div has a listener calling the same handler. in that handler you check which div called the handler, like so

    in setup

    Code:
    this.keyTap = this.keyTap.bind(this);
    	this.controller.listen(this.controller.get('ALEF'), Mojo.Event.tap, this.keyTap);
    	this.controller.listen(this.controller.get('BEIS'), Mojo.Event.tap, this.keyTap);
    	this.controller.listen(this.controller.get('GIMEL'), Mojo.Event.tap, this.keyTap);
    	this.controller.listen(this.controller.get('DALED'), Mojo.Event.tap, this.keyTap);
    	this.controller.listen(this.controller.get('HEY'), Mojo.Event.tap, this.keyTap);
    (note the first line its there for cleanup)

    in this.keyTap
    Code:
    	keyTapped = event.srcElement.id //important part this checks which div called the function 
    
    	if (keyTapped === 'ALEF') {letter = ALEF}
    	else if (keyTapped === 'BEIS') {letter = BEIS}
    	else if (keyTapped === 'GIMEL') {letter = GIMEL}
    	else if (keyTapped === 'DALED') {letter = DALED}
    	else if (keyTapped === 'HEY') {letter = HEY}
  15. #15  
    I get it! Thanks!

    As for the cleanup part, I get that you're doing that because the stopListening won't accept .bind(this), right? Only I've never gotten this to work correctly. Do the names have to be the same (I have assumed in the past that they couldn't so mine have always been like this: this.a1handler = this.a1tap.bind(this)

    I only saw this eluded to once, and have tried to do it.

    Anyway, thanks for the help. This will be much easier.
  16.    #16  
    Quote Originally Posted by jdforsythe View Post
    I get it! Thanks!

    As for the cleanup part, I get that you're doing that because the stopListening won't accept .bind(this), right? Only I've never gotten this to work correctly. Do the names have to be the same (I have assumed in the past that they couldn't so mine have always been like this: this.a1handler = this.a1tap.bind(this)

    I only saw this eluded to once, and have tried to do it.

    Anyway, thanks for the help. This will be much easier.
    im pretty sure they can be the same, palm apps have then the same, no thtat they are anything to go by.
  17.    #17  
    if you look into the dialpad assitant in the palm.phone app they have a method of setting up the listeners in a few short lines.

Posting Permissions