Is this possible?

Discussion in 'Jiggy Runtime Development' started by BigDaveyJ, Apr 19, 2008.

  1. BigDaveyJ

    BigDaveyJ New Member

    Joined:
    Nov 23, 2007
    Messages:
    2,751
    Likes Received:
    23
    Device:
    iPod touch
    Im working on i20 and i need to know if it is possible to say, like if 0, then and have it switch javascript files so it can read questions pertaining to a specific topic
  2. blackjak231

    blackjak231 Member

    Joined:
    Oct 1, 2007
    Messages:
    759
    Likes Received:
    6
    Device:
    iPhone 4 (White)
  3. Yongkykun

    Yongkykun Member

    Joined:
    Dec 11, 2007
    Messages:
    536
    Likes Received:
    11
    Device:
    iPhone 4S (Black)
    Wow... you blew a few fuses in my brain dude... what the F---?!
  4. jakecigar

    jakecigar New Member

    Joined:
    Mar 7, 2008
    Messages:
    83
    Likes Received:
    6
    Device:
    iPhone 4 (Black)
    you can simply include another JavaScript file at any time, thus overwriting any vars you had!
  5. BigDaveyJ

    BigDaveyJ New Member

    Joined:
    Nov 23, 2007
    Messages:
    2,751
    Likes Received:
    23
    Device:
    iPod touch
    ok i20 is 20 Questions for the iPhone/iPoT. I wanted to make it so if theys ay yes to one of the questions, it will change javascript files so basically the category changes.
  6. blackjak231

    blackjak231 Member

    Joined:
    Oct 1, 2007
    Messages:
    759
    Likes Received:
    6
    Device:
    iPhone 4 (White)
    Ok, much easier to understand!

    It is possible, but i dont have any code to give you.It should basically be a series of links.... in more complicated, lol.
    I can just tell u its possible, but how....

    Please Register or Log in to view images

  7. BigDaveyJ

    BigDaveyJ New Member

    Joined:
    Nov 23, 2007
    Messages:
    2,751
    Likes Received:
    23
    Device:
    iPod touch
    Thats my code so far. can someone help me with this so if i want to make it go into another javascript file it can do that?


    Code:
    // com.touchrevolution.i20
    // /Applications/i20.app/main.js
    Plugins.load( "UIKit" );
    
    var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.backgroundColor = [ 1 , 1 , 0 , 1 ];
    
    
    var mainView = new UIImageView(new Image('Default.png'));
    window.setContentView( mainView );
    
    var bar = new UINavigationBar( [ 0 , 0 , window.bounds[ 2 ] , 48 ] );
    bar.showButtonsWithLeftTitle( "Info" , "Play" , false );
    
    mainView.addSubview( bar );
    
    var itemOne = new UINavigationItem( "" );
    bar.pushNavigationItem( itemOne );
     
    //Buttons
    
    bar.onButtonClicked = 
    function( theBar , theButton )
    {
    if ( theButton == 1 )
    {
    alert("App created by the Dev Team of Touch Revolution");
    }
    if ( theButton == 0 )
    {
    //Q1
    
    var aboutVM = new UIAlertSheet();
    aboutVM.setTitle('Question 1');
    aboutVM.setBodyText('Is what you are thinking of an animal?');
    aboutVM.addButtonWithTitle('Yes',null);
    aboutVM.addButtonWithTitle('No',null);
    aboutVM.onButtonClicked = function( b ){
      this.dismiss(true);
    }
    
    aboutVM.popupAlertAnimated( true );
    
    {
      var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
      window.setHidden( false );
      window.orderFront();
      window.makeKey();
      window.backgroundColor = [ 1 , 1 , 1 , 1 ];
    
    var bar = new UINavigationBar( [ 0 , 0 , window.bounds[ 2 ] , 48 ] );
    bar.showButtonsWithLeftTitle( "Yes" , "No" , true );
     
    mainView.addSubview( bar );

Share This Page