Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3674632
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:52:41+00:00 2026-05-19T02:52:41+00:00

I’m attempting to use multiple movies inside the same container and make them play

  • 0

I’m attempting to use multiple movies inside the same container and make them play when different buttons are clicked.

One is for my landing page, one is for the about us…etc.

I am attempting to use JavaScript to write a function to call the movies interdependently. I would like to press on navigation button’s then different things pop up. JavaScript is what I assume I should use but I’m an a**hole so I figured I’d ask you good people. I am studying the DOM but really have no practice in using it. I have made an Image map which is a (swf.) which I’d like to load when people click about us, a Quick Time movie for the landing page, also a file I’m working on to run and loop after the landing page movie runs or if someone clicks on home. As I said I want them all to appear in the same container when some one clicks on the navigation buttons.

I know, that’s it…I’m stuck, I have been confused for a few days reading different blogs, w3schools, StackOverflow, QuirksMode…still no idea how to approach it appropriately.

I figured I’d first create a separate JavaScript file. Duh

OK I should be more specific.
WHERE DO THE OBJECTS GO? IN THE HTML OR JAVASCRIPT?
HOW DO I REFERENCE THEM? OnClick, getElementById()...both????

I understand the basic principles so I have confidence if you gave me a nudge I could write the code correctly so please don’t smack the programming out of me.

What I do know is they all have to be the same size, how to airbrush and screenprint...that doesn't help though, and how to go to w3schools and read.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:52:42+00:00Added an answer on May 19, 2026 at 2:52 am

    A good book for you might be PPK on JavaScript. A good reference is Javascript: The Definitive Guide, 5th Edn (nb: 6th Edn due by March!)

    Here’s how it should work for you:

    a) you put all of your resources into an HTML file – swf’s, pictures, movies, the lot. Put all the swappable things inside their own <div id="thingId" /> elements inside a big <div id="centrestage"/> element. It will seem a big mess of things for now, but don’t panic. For the element that you want to show ‘first’ when the page loads, make it a <div id="thingId" class="onstage" />

    … this gets all your resources into the HTML file.

    b) supposing all your buttons are img’s, you’ll put <img id="button1" />, for button2, button3, etc.

    b) you attach a stylesheet to your HTML with a rule as follows:

      div.centrestage div { display: none; }
      div.centrestage div.onstage { display: block; }
    

    … this hides the resources you don’t want displayed for now

    c) you attach a JavaScript to your HTML that does the following things:

      window.onLoad = function(e) {
    
         var centrestage = document.getElementById('centrestage');
         var r1 = document.getElementById('resource1');
         var r2 = document.getElementById('resource2');
    
         var currentResource = r1;
    
         var b1 = document.getElementById('button1');
         button1.onClick = function(e) {
             currentResource.className = '';
             r1.className = 'onstage';
             currentResource = r1;
         }
    
         var b2 = document.getElementById('button2');
         button1.onClick = function(e) {
             currentResource.className = '';
             r2.className = 'onstage';
             currentResource = r2;
         }
    
      }
    

    … notice that this script doesn’t DO anything yet … it just attaches some functions to some onClick events, of some objects that you’ve picekd out of the DOM tree by name. The functions basically turn on/off the ‘onstage’ class attribute for the DIV‘s, and the stylesheet does the rest.

    As you probably get the gist of … once the browser has read your HTML, you’ve got a DOM object model ‘in memory’. Once this model finishes loading, the browser hunts for any scripts which registered themselves in the onLoad event, and executes them. This way of doing things helps to separate all the structure (HTML/DOM) from the look (CSS) from the behaviour (JavaScript hanging off DOM events).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.