HELP PLEASE! (TypeError: loadmsg has no properties')

Discussion in 'Jiggy Runtime Development' started by OneFan, Apr 25, 2008.

  1. OneFan

    OneFan Active Member

    Joined:
    Feb 25, 2008
    Messages:
    949
    Likes Received:
    67
    Device:
    iPhone 4 (White)
    When Ever I Try To Select "Police Or "All" On The Settings I GEt An Error At Line 19...

    Download And Check It Out For Yourself!

    If You CAn Get Those two Bars/Choices To Work I WIll Include You In Credits...

    DOWNLOAD LINK:
    http://www.[PIRACY.mf].com/?1irszxtqce3

    The Main.Js File Is Located Below For Quicker Fix...


    ==================================================
    // com.davteam.excuses
    // /Applications/Excuses.app/main.js

    Plugins.load( "UIKit" );
    Plugins.load( "FileManager");

    var LoadedList = new Array();
    var subject="/all.txt";
    onLoad = function()
    {
    menu.popupAlertAnimated( true );
    }

    function LoadList(theList){
    var load = new Data();
    load.loadFromFile( Bundle.bundlePath + theList);
    var loadmsg = "";
    var loadmsg = load.asString();
    LoadedList = loadmsg.split("\n");

    subject=theList;
    var files = new Array("/work.txt", "/school.txt", "/police.txt", "/all.txt");
    var names = new Array("Work", "School", "Police", "All", "Back");
    for( var x = 0, b = names.length; x<b; x++ )
    {
    if (files[x]==subject){
    var itemOne = new UINavigationItem( names[x] );
    bar.pushNavigationItem( itemOne );
    x=x+1;
    break;
    }
    }
    }

    function ShowSubjects(){
    var files = new Array("/work.txt", "/school.txt", "/police.txt", "/all.txt");
    for( var x = 0, b = files.length; x<b; x++ )
    {
    if (files[x]==subject){
    x=x+1;
    break;
    }
    }
    if (x<4) {
    set.setDefaultButton(x);
    set.popupAlertAnimated( true );
    }else set.popupAlertAnimated( true );
    }

    function ShowLine(){
    var Excuse = Math.floor(Math.random()*LoadedList.length)
    if (LoadedList[Excuse] != "")
    {
    var number = Excuse + 1;
    cover.text = "Excuse " + number + ": " + LoadedList[Excuse];
    }
    }

    var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
    window.setHidden( false );
    window.orderFront();
    window.makeKey();
    window.backgroundColor = [ 1 , 1 , 1 , 1 ];

    var mainView = new UIView();
    window.setContentView( mainView );

    var help = new UIAlertSheet("Excuses v0.9 Help", ["How Do I Generate A Excuse" , "What Is Settings For" , "Special Thanks" , "Other" , "Exit Help"], 0);
    help.setAlertSheetStyle( 4 );
    help.onButtonClicked = function(button){
    if (button == 1)
    hdigae.popupAlertAnimated( true );
    help.dismiss(true);
    if (button == 2)
    wisf.popupAlertAnimated( true )
    help.dismiss(true);
    if (button == 3)
    st.popupAlertAnimated( true )
    help.dismiss(true);
    if (button == 4)
    other.popupAlertAnimated( true )
    help.dismiss(true);
    if (button == 5)
    help.dismiss(true)
    };

    var hdigae = new UIAlertSheet("How Do I Generate A Excuse", ["Go Back To Help" , "Exit Help"], 0);
    hdigae.setAlertSheetStyle( );
    hdigae.setBodyText("Press The New Excuse Tab In The Top Left Corner... After You Do This You Will Have A New Randomly Generated Excuse...");
    hdigae.onButtonClicked = function(button){
    if (button == 1)
    help.popupAlertAnimated( true );
    hdigae.dismiss(true);
    };

    var wisf = new UIAlertSheet("What Is Settings For", ["Go Back To Help" , "Exit Help"], 0);
    wisf.setAlertSheetStyle( );
    wisf.setBodyText("Settings Allow You To Choose Which Kind Of Excuses You Want, Rather Then All Of Them");
    wisf.onButtonClicked = function(button){
    if (button == 1)
    help.popupAlertAnimated( true )
    wisf.dismiss(true)
    };

    var st = new UIAlertSheet("Special Thanks", ["Go Back To Help" , "Exit Help"], 0);
    st.setAlertSheetStyle( );
    st.setBodyText("Special Thanks\n\nc0der_4_Life - Part Developer\nWinterBoard - Graphic Designer\nGoJohnnyBoi - Tech Help \n\n\nCopyright © 2008 DAV Team");
    st.onButtonClicked = function(button){
    if (button == 1)
    help.popupAlertAnimated( true )
    st.dismiss(true)
    };

    var other = new UIAlertSheet("Other", ["Go Back To Help" , "Exit Help"], 0);
    other.setAlertSheetStyle( );
    other.setBodyText("If You Still Can't Figure Out How To Use Excuses.APP V0.9 BETA, Please PM OneFan On ifans.com\n\n\nCopyright © 2008 DAV Team");
    other.onButtonClicked = function(button){
    if (button == 1)
    help.popupAlertAnimated( true )
    other.dismiss(true)
    };

    var bar = new UINavigationBar( [ 0 , 0 , window.bounds[ 2 ] , 48 ] );
    bar.showButtonsWithLeftTitle( "New Excuse" , "Settings" );
    mainView.addSubview( bar );

    var itemOne = new UINavigationItem( "Excuses" );
    bar.pushNavigationItem( itemOne );

    var menu = new UIAlertSheet("Excuses v0.9", ["Start" , "Settings" , "Exit" ], 0);
    menu.setBodyText("INSTRUCTIONS:\nPlease Press Start To Play.... To Select A New Excuse Please Press New Excuse... \ \n\nCREDITS:\nOneFan - Main Developer\n\nCopyright © 2008 DAV Team");
    menu.onButtonClicked = function(button){
    if (button == 1)
    set.popupAlertAnimated( true );
    if (button == 2)
    ShowSubjects();
    menu.dismiss();
    if (button == 3)
    terminate()
    };

    bar.onButtonClicked =
    function( bar , theButton )
    {
    if ( theButton == 1 ) ShowLine();
    if ( theButton == 0 ) ShowSubjects();
    };

    var set = new UIAlertSheet("Excuse Catagories", [ "Work", "School", "Police", "All", "Back" ], 0);
    set.onButtonClicked = function(button){
    switch(button){
    case 1:
    LoadList("/work.txt");
    set.dismiss(true);
    break;
    case 2:
    LoadList("/school.txt");
    set.dismiss(true);
    break;
    case 3:
    LoadList("/police.txt");
    set.dismiss(true);
    break;
    case 4:
    LoadList("/all.txt");
    set.dismiss(true);
    break;
    case 5:
    set.dismiss(true);
    break;
    }
    };

    var cover = new UITextView( [ 0 , 48 , window.bounds[2] , 410 ] );
    cover.color = [ 1 , 1 , 1 , 1 ];
    cover.textSize = 20;
    cover.text = ("Copyright © 2008 DAV Team")
    cover.backgroundColor = [0,0,0,1];
    cover.textColor = [1,1,1,1];
    cover.visibleRect = true;
    cover.editable = false;
    cover.onTap = ShowLine;
    mainView.addSubview( cover );

    var bar2 = new UINavigationBar( [ 0 , 415 , window.bounds[ 2 ] , 48 ] );
    bar2.showButtonsWithLeftTitle("Menu", "Help")
    bar2.onButtonClicked = function(bar,buttNo){
    switch ( buttNo ) {
    case 1:
    menu.popupAlertAnimated( true );
    break;
    default:
    help.popupAlertAnimated( true );
    }
    }
    mainView.addSubview ( bar2 );

    var itemTwo = new UINavigationItem( "Excuses" );
    bar2.pushNavigationItem( itemTwo )
  2. Winterboard

    Winterboard Well-Known Member

    Joined:
    Dec 26, 2007
    Messages:
    2,345
    Likes Received:
    53
    Device:
    iPad 2 (Black)
  3. RazerM

    RazerM New Member

    Joined:
    Oct 4, 2007
    Messages:
    279
    Likes Received:
    5
    At the moment I'm not sure what is causing this, I'll try figure it out though..
  4. Magically delicious

    Magically delicious New Member

    Joined:
    Feb 2, 2008
    Messages:
    176
    Likes Received:
    11
    Device:
    iPod touch
    here I tried I dought it will work though.

    Please Register or Log in to view images

    The app looks like a good one.

    Attached Files:

  5. OneFan

    OneFan Active Member

    Joined:
    Feb 25, 2008
    Messages:
    949
    Likes Received:
    67
    Device:
    iPhone 4 (White)
    please try to fix it as fast as you can.. im planning on releasig final version tmr night.. or sunday morning


    can you make it a zip file since i cant open rar on my computer???
  6. Magically delicious

    Magically delicious New Member

    Joined:
    Feb 2, 2008
    Messages:
    176
    Likes Received:
    11
    Device:
    iPod touch
    Here's the zip.

    Attached Files:

  7. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    Ok here's how to fix your lists
    Look for this line....
    Officer please excuse me beacuse, I didn't realize my radar wasn't plugged in.
    ...delete and retype the ' in didn't and wasn't....turns out their not standard ones...standard ones have a hex value of 27 and these ones have a hex value of 92 and so that was what JS was chocking on....as ive said before its not the code.
    Do I get credit now?

    Please Register or Log in to view images

    1 person likes this.
  8. OneFan

    OneFan Active Member

    Joined:
    Feb 25, 2008
    Messages:
    949
    Likes Received:
    67
    Device:
    iPhone 4 (White)
    so I use the word "didnt" without ' am I correct?
  9. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    sorry bout the late reply, have people over and im tired as usual

    Please Register or Log in to view images



    anywayz here's a link to the fixed lists and I made a couple of changes to the code again (couldnt help myself)...there was one error and the way the dialogs was working seemed a little wrong...see if ya like the changes....
    http://uppit.com/FJZVU6

    EDIT:just noticed ya said ya cant do rar's....here's a zip
    http://uppit.com/KUOONM
  10. OneFan

    OneFan Active Member

    Joined:
    Feb 25, 2008
    Messages:
    949
    Likes Received:
    67
    Device:
    iPhone 4 (White)
    thanks so much.... i will be releasing the final version v1.0 tonight and you will be under the special thanks!

Share This Page