Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. Ti.UI.setBackgroundImage("347.png");
  2.  
  3. var bands = {
  4. "sevenfold": {
  5. "headTitle": "Avenged Sevenfold",
  6. "footTitle": "Orange County Metal Band",
  7. "members": [
  8. {
  9. "name": "M. Shadows",
  10. "info": "Lead Singer. Known for his raspy yet powerful vocals"
  11. },
  12. {
  13. "name": "Synyster Gates",
  14. "info": "Lead guitarist and backup vocalist. Known for technical solos and melodic riffs."
  15. },
  16. {
  17. "name": "Zacky Vengeance",
  18. "info": "Rhythm guitarist and backup vocalist. Capable of tight and fast riffs and harmonizing with lead guitar parts. "
  19. },
  20. {
  21. "name": "Johnny Christ",
  22. "info": "Bassist. Contributes heavy grooves as well as intricate undertones to the rhythm section."
  23. },
  24. {
  25. "name": "Arin Iljey",
  26. "info": "Drummer. New-comer to the band. Filled in for the late Jimmy 'The Rev' Sullivan."
  27. },
  28. ]
  29. },
  30. "adtr": {
  31. "headTitle": "A Day To Remember",
  32. "footTitle": "Ocala Based Pop-Punk Band",
  33. "members": [
  34. {
  35. "name": "Jeremey McKinnon",
  36. "info": "Lead Singer. Capable of hitting clean high notes as well as low screams."
  37. },
  38. {
  39. "name": "Neil Westfall",
  40. "info": "Rhythm guitarist and backup vocalist. Plays fast punk inspired rhythm sections while contributing back up screams during live shows."
  41. },
  42. {
  43. "name": "Joshua Woodard",
  44. "info": "Bassist. Contributes to the heavy tones of the rhythm section."
  45. },
  46. {
  47. "name": "Kevin Skaff",
  48. "info": "Lead guitarist and backup vocalist. Plays the melodic section of songs and aids Jeremy with clean vocals both in the studio and on live shows."
  49. },
  50. {
  51. "name": "Alex Shelnut",
  52. "info": "Drummer. Adds fast punk fills with metal influenced double bass beats."
  53. }
  54. ]
  55. }
  56. };
  57.  
  58.  
  59. var mainWindow = Ti.UI.createWindow({
  60. title: "Band Members",
  61. backgroundImage: "347.png"
  62. });
  63.  
  64. var navWindow = Ti.UI.iOS.createNavigationWindow({
  65. window: mainWindow
  66. });
  67.  
  68.  
  69. var getDetail = function(){
  70. var detailWindow = Ti.UI.createWindow({
  71. title: this.text,
  72. backgroundColor: "white"
  73. });
  74. var detailText = Ti.UI.createLabel({
  75. text: this.details,
  76. top: 30,
  77. left: 15,
  78. right: 15
  79. });
  80. detailWindow.add(detailText);
  81. navWindow.openWindow(detailWindow);
  82. };
  83.  
  84. var makeUI = function(){
  85. var spacing = 30;
  86. for(n in bands){
  87. var titleLabel = Ti.UI.createLabel({
  88. text: bands[n].headTitle,
  89. left: 30,
  90. right: 30,
  91. borderRadius: 5,
  92. top: spacing,
  93. height: 25,
  94. textAlign: "center",
  95. backgroundColor: "#333",
  96. font: {fontSize: 22, fontFamily: "Verdana", fontWeight: "bold"},
  97. color: "#fafafa"
  98. });
  99. spacing = titleLabel.top + titleLabel.height + 10;
  100. for(m in bands[n].members){
  101. var itemLabel = Ti.UI.createLabel({
  102. text: bands[n].members[m].name,
  103. details: bands[n].members[m].info,
  104. left: 30,
  105. right: 30,
  106. borderRadius: 5,
  107. textAlign: "center",
  108. top: spacing,
  109. height: 25,
  110. backgroundColor: "#ffffff",
  111. font: {fontSize: 22, fontFamily: "Verdana"},
  112. color: "#333"
  113. });
  114. mainWindow.add(itemLabel);
  115. spacing = itemLabel.top + itemLabel.height + 10;
  116. itemLabel.addEventListener("click", getDetail);
  117. }
  118. mainWindow.add(titleLabel);
  119. spacing = itemLabel.top + itemLabel.height + 40;
  120. }
  121. };
  122.  
  123.  
  124.  
  125. makeUI();
  126.  
  127.  
  128. navWindow.open();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement