Results 1 to 4 of 4
  1.    #1  
    more that one javascriptfile for one scene ?


    I am pretty new to webos and javascript programming, and I have some questions which I haven't seen beeing discussed anywhere...
    My background is more the classical, class-based, object oriented java programming. I just mention this so you might "understand" whats the "source" of my questions ;-)

    So, is it possible to have more that one javascript file assigned to a scene ?
    For example if I'm going to write a litte "clock" application with two scenes in it, one scene that shows an analog clock and one scene that shows a digital clock. Therefore I'd like to use two different functions, e.g. "AnalogClock" and "DigitalClock". But since there is probably some code both functions need, I'd like to introduce a third function called "BaseClock" that should serve as the prototype for "AnalogClock" and "DigitalClock". In java I'd create a class BaseClock and the classes "Analogclock" and "Digitalclock" that both would extend "BaseClock".

    So, what would be the proper way in javascript to do something like this ?

    thanks for any advise
  2. #2  
    All javascript files can be shared for all scenes.
    Create it and add it in source.json.
    I advise to create another folder out of "app/assistants/" , like "app/models" to collect those files.
  3. #3  
    You might find the following tutorial useful. It essentially uses "object oriented" programming for WebOS. Jump to Part 2 of the tutorial and see how he creates the WBCookie object.
    Mojo Lists (Part 1) WebOS Boston
    Developer of: FFplayer - a file/folder based music player. FFplayer home
  4.    #4  
    Thanks for your both replys. Now it works :-)

Posting Permissions