Richard wrote:
[color=blue]
> On Fri, 04 Feb 2005 18:20:03 -0300 eft0 wrote:
>
>[color=green]
>>Hi there, the question:[/color]
>
>[color=green]
>>I have this array:[/color]
>
>[color=green]
>>var Thumbnails = new Array();
>>Thumbnails[0] = new Array('1', 'listing_34.jpg', 'Home View');
>>Thumbnails[1] = new Array('2', 'sexy2.jpg', 'Sexy');
>>Thumbnails[2] = new Array('3', 'blue-sun-m.jpg', 'New Test');
>>Thumbnails[3] = new Array('4', 'viva_firefox_eats_ie.jpg', 'Firefox');[/color]
>
>[color=green]
>>All fine at this point. But when a try to change the value for one:[/color]
>
>[color=green]
>>Thumbnails[0][1] = '2';
>>Thumbnails[1][1] = '1';[/color]
>
>[color=green]
>>This don't work. Any ideas ?, thanks in advanced.[/color]
>
>[color=green]
>>-- eft0.[/color]
>
>
>
>
> Me thinks you're trying to do some things you should not be doing.[/color]
Coming from you, thats funny.
[color=blue]
> As I understand it, the way you show, just ain't kosher.
> Thumbnails[0]="images/name1.jpg"
> This is a ONE dimensional array to begin with.[/color]
There are no other kinds of Arrays in ECMAScript.
[color=blue]
> You can have var Thumbnails="new Array("name1.jpg", "name2.jpg",
> "name3.jpg")
> But not Thumbnails[0]= new Array( what, ever)[/color]
Ummm, YES you can. If you would bother learning the subject before
offering advice on the subject you might understand that.
[color=blue]
> Now you want to compound the issue by using a 2 dimensional array to do
> what?
> Thumbnails[0][0]="name1.jpg"[/color]
Thats not a "2 dimensional array", it is a nested array. Learn the
difference.
[color=blue]
>
> What you may want to try is something like this:
>
> Thumbnails1=new Array('1', 'listing_34.jpg', 'Home View');
> Thumbnails2=new Array('2', 'sexy2.jpg', 'Sexy');
>
> ThumbChoice=new Array()
> ThumbChoice[0][0]=thumbnails1
> ThumbChoice[0][1]=thumbnails2[/color]
Not withstanding your typos which would throw a "thumbnails1 is not
defined" error message, all you have done is create a nested array with
extra overhead.
Before you continue to give advice in this group, please at least read
the group, buy some books, do a lot of reading and get a basic grasp of
the language before you attempt to give answers.
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?