3 Replies - 592 Views - Last Post: 03 December 2008 - 07:25 AM Rate Topic: -----

#1 t_goody  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 20-October 08

arrays and timers

Post icon  Posted 01 December 2008 - 09:23 PM

So I'm having some problems conceptualizing how the code would work for this and all I have written are the arrays that contain the information I want to display so I don't have much code other than that.

What I am trying to do is when an artist is selected and the video starts to play the timer starts and after ten seconds a fact about the artist pops up and does so throughout the song. The problem I am having is getting the program to know which array to use from the artist selected. I have written individual arrays for each artist. How I had done this before was by using selected index and having it select the object to be loaded from that. I have tried writing an array that contains the other arrays in it and pulling the selected index into this main array and from there the matching artist array would be selected. Any help on conceptualizing this would be helpful thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: arrays and timers

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: arrays and timers

Posted 01 December 2008 - 10:19 PM

Can you describe what you mean by selecting an artist (ie. clicking on an item in a ListView, TreeView, etc)?
Was This Post Helpful? 0
  • +
  • -

#3 t_goody  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 20-October 08

Re: arrays and timers

Posted 01 December 2008 - 10:47 PM

Yeah I have a list box that uses a text file to read the artists names into it. From there when one of them is selected it will pop up a second window and display a picture of the artist's album and then they can select to read a biography or watch a video if video is selected another form is brought up that starts the video its from there that I want the timer to start. I had got all the other parts to work by putting the file name into an array that matched that of the text file order of artists. That way when an artist was selected the select index would be put into the the array holding the file name and then that file name would be used to pull up the picture or video. I tried using that same sort of format for having the facts pop up but that doesn't seem like it will work. I thought about doing another set of text files for each artist and having them load from data read code to get the facts but thought I would first try by creating an array of facts for each artist and trying to pull the facts from that. So my problem is getting the program to know that a certain array is for a certain artist and then pulling the facts from that array when the video starts. Hope that makes sense...

  Dim num() As String = {"aha.mpg", "bb.mpg", "BS.mpg", "Buggles.mpg", "FBS.mpg", "FF.mpg", "Madonna.mpg", "MJ.mpg", "RP.mpg", "Queen.mpg"}
dim name as string = {"aha()", "BB()"......}
	Dim aha() As String = {"every scene was shot live then projected onto paper and drawn", "It took 14 artists 3 months to create the 2000 frames", "the lead singer really stuck his hand through a hole  in the table", "A HA used a drum machine on this song", "A HA was the first Norwegian band to have a #1 single in America"}

	Dim BB() As String = {"The 1994 video for 'Sabotage' is a spoof on 70's crime drama/cop television shows", "It was shot by Spike Jonze, and features the Beastie Boys, each portraying a fictional cop-character", "The song 'Eggman' from 'Paul's Boutique' samples from both films Jaws and Psycho simultaneously. It is a very creative use of sampling in a rap song", "Mike D, MCA, and Ad-Rock are all of Jewish ancestry"}

	Dim BS() As String = {"Britney's first single, 'Baby One More Time' was initially offered to TLC. TLC declined the song", "In January 2007, Britney drew negative attention once again, when she gave her 15-month-old son Sean Preston a wad of bubblegum to chew on", "Britney posed nude while she was pregnant for the August 2006 cover of Harper's Bazaar magazine", "In Britney’s Baby One More Time video, her love interest is played by her cousin", "The school featured in her Baby One More Time music clip is the same place the movie Grease was filmed in 1978"}

	Dim Buggles() As String = {"Trevor Horn wrote this after reading a science fiction story about an opera singer in a world without sound", "This was the first video to air on MTV. The network launched August 1, 1981, and this provided the first evidence that MTV was going to make it", "Artists to cover this song include The Violent Femmes, Pixies, The Offspring, Radiohead, the Japanese Indie Rock band Rocket K, and The Presidents of the United States of America, whose cover was included on the soundtrack for The Wedding Singer"}

	Dim FBS() As String = {"Fatboy Slim's real name is Quentin Cook but in school his friends called him 'Norman' due to his somewhat 'dorky' name"}
	Dim FF() As String = {}
	Dim Madonna() As String = {}
	Dim MJ() As String = {}
	Dim RP() As String = {}
	Dim Queen() As String = {}

   Static factboolean As Boolean = True
		If factboolean Then
			name(FamousVideosForm.ArtistListBox.SelectedIndex)





Here is the code that I have done might help it make a little more sense... Thanks..
Was This Post Helpful? 0
  • +
  • -

#4 magicmonkey  Icon User is offline

  • D.I.C Regular

Reputation: 106
  • View blog
  • Posts: 484
  • Joined: 12-September 08

Re: arrays and timers

Posted 03 December 2008 - 07:25 AM

You really want to create a class and use collections instead of arrays. You also should consider storing the data in a database or XML file instead of hard coding it into your application. I would also make an interface to add the artists, songs and facts to the database. This way once it is all coded you can easily add new data without having to modify the code and recompile the application.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1