change layer text across frames

They have: 56 posts

Joined: Feb 2000

i have two frames (top and bottom). in the bottom frame i have a layer. in the top frame i have a bunch of images. click on an image and the text inside the layer in the bottom frame changes (like a description change). how can i get it to change?

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

Essentially the same as you would if it were in same frame. Simply change the DOM reference so that you are accounting for frames. That is, for IE: parent.framename.document.all.divID.innerHTML = text;

If that doesn't make sense to you, see the "dHTML: an Introduction" script/tutorial at my site. Modify the code it comes with for the frames as in above.

Vinny

Where the world once stood
the blades of grass cut me still

They have: 56 posts

Joined: Feb 2000

funny you mentioned your site because that is what i used to figure it out Smiling this time i bookmarked your site so i can look at it again if i need. it is very helpful. thank yiou very much for all your help

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

Thanks Smiling Glad the suggestions got it working. Be adding some neat dHTML stuff soon (if I ever take time to write them up; it's the tutorial that goes with them that's the hard part to create).

Vinny

Where the world once stood
the blades of grass cut me still

They have: 56 posts

Joined: Feb 2000

how did you learn dhtml? i learned html and some javascript by looking at other peoples code. is thta how you learned or did you have a book or someone teach you? i ask a lot of questions i know Smiling

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

I cheat Smiling I've got a programming background (c/c++, sql, etc, so a lot of this stuff is like deja vu -- mostly a matter of learning new terms and getting over frustrations because things don't work the way they would in a 'real' language.)
Beside rightClicking, downloading and fiddling with scripts:
I learned javascript from http://www.htmlgoodies.com and SAM's Javascript in 24 hours.
I learned HTML from the BareBones Guide to HTML (it's on the web somewhere), a 4 or 5 page html document.
I bought 3 other books:
From O'reilly publishers: Javascript: the definitive guide (which I use as a reference) and dHTML: the definitive reference (which I'm not sure of where it is)
and the javascript bible by danny goodman (which I use when I want to know why netscape is mucking up)
the rest of it comes with trying.

BTW: keep asking; you can't learn otherwise. And always remember: there is always someone who knows more, and at least the majority of people who know something different.

Besides: I'm ooooooolllllddddddd Smiling
Vinny

Where the world once stood
the blades of grass cut me still

They have: 56 posts

Joined: Feb 2000

I use to have the book Javascript: The Definitive Guide but it got stolen the second day I got it Sad I guess I need to get it again. I am on a roll. I recently learned JavaScript (not a master yet but working on it) and I recently learned Flash. I use a lot of JavaScript syntax in ActionScript as well as Lingo. Once I got the basics of JavaScript (what this means and what that means) then a lot of things have come together pretty good. I probably don't know as much as you do but I will eventually get there. I am very persistant and I love to learn. We will meet again. I will always have a problem that I have worked on for so long and still can't figure out Smiling

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

Shoot I've got problems tying my shoelaces some mornings.
Come by often; if I can, I'll help out. The only thing I'm not wild about doing is solving script conflicts for people who refuse to learn. About the only thing I can't do is graphics.

Vinny

Where the world once stood
the blades of grass cut me still

They have: 56 posts

Joined: Feb 2000

I am willing to learn if you are willing to teach. The only kind of people that I do not want to learn from or be around are the people that know more than I do and act better than me because they know it and I don't yet. You don't seem like kind of person. If you ever need help with graphics, I can help as much as I can. I know all kinds of stuff about Illustrator and Photoshop.
Until that time, my only other questions are what is the different between document.write and document.writein and what is the difference between null and return false? They seem to do the same thing as the other.

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

document.writeln() is supposed to add a newline character (sort of like a ) into your code. So, you should not use writeln unless the parameter within the parenthesis is a complete statement.

false is false (0); true is true (1); null is nothing. In C, it has a definite value. I'm not sure about javascript -- it tends to be used a lot as an empty string. void is closer to null than false is.

Vinny

Where the world once stood
the blades of grass cut me still

They have: 56 posts

Joined: Feb 2000

I just realized that we are having out own little conversation here Smiling

If I never used document.writeIn for anything would I notice? I mean can I get away without it 100% of the time and be ok or do I need to try making myself a couple little tests using writeIn?

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

The only time you might use it is if you are creating a complete html document from scratch. So, no you don't need to use it.

Vinny

They have: 56 posts

Joined: Feb 2000

if i get annoying asking all these question just stop replying. replying only encourages me to learn and ask more questions Smiling
two more questions: case and break
i sometimes look at someone elses javascript and that have something that says case 1, case 2, etc. what is that? is that kinda like a variable? if so why not just write it as name = blah blah ?
i also see break a lot. i am guess that that is kinda like an end tag. break means quit or end a certain thing right?

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

case is part of the switch statement. If you check out the Arguments Object script at my site, you'll see an example.
Essentially, it works like a series of if/elses with some special frills.

function area()
{
var area;
switch(arguments.length)
{
case 3:
area = arguments[1] * arguments[2];
break;
case 2:
switch (arguments[0])
{
case 'c': //circle
area = arguments[1] * arguments[1] * 3.14;
break;
case 's': // square
area = arguments[1] * arguments[1];
break;
}
case 1: // assume a square
area = arguments[1] * arguments[1];
break;
default:
}
return (area);
}

The above can be called as follows:
x = area('r',2,4);
x = area('s',2);
x = area('c',2);
x = area(2);

The main 'frill' occurs if you leave out the 'break' statement -- the code will go to the first case that evaluates as true, process the statements and then each and every case's statements below it. This comes in extremely handy in some situations -- the trick though is in arranging the cases so that the falling is accumulative and not destructive.

Hope this helps some. I'm off to slumberland.
Vinny

Where the world once stood
the blades of grass cut me still

They have: 56 posts

Joined: Feb 2000

woah! i definatly need to research that more. i will take a loot at your site some more and check it out and get the internet for more example, then try to more my own. i'm starting to love javascript more Smiling

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi Rage,

Good idea, but maybe you should start a new thread for your next question.

Vinny

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.