Html/javascript load movie into flash

I have a html link that opens another html page with a flash movie embedded in the page.

what i want to do is when u click on the link i want it to load the new html page with the flash movie in it to open another flash movie inside (on top) the flash movie already in the page. Is this possible???

You can insert the new flash movie in a layer and make it invisible.
Then use a JS function in the page head to make it visible.

function getElement(id) {
return document.all ? document.all(id) :
document.getElementById ? document.getElementById(id) :
document.layers ? document.layers[id] : null;
}

function vislayeron(id) {
var el = getElement(id);
if (!el) return;
if (el.style) el.style.visibility = ‘visible’;
else if (el.visibility) el.visibility = ‘show’;
}

function vislayeroff(id) {
var el = getElement(id);
if (!el) return;
if (el.style) el.style.visibility = ‘hidden’;
else if (el.visibility) el.visibility = ‘hide’;
}

You can call this function from the swf you already see in the page.
Use a button or just a frame to insert the code:

getURL(“JavaScript : vislayeron(‘Layer1’)”);

I hope that helps.

You can also use the vislayeroff function to hide the layer (new swf) again.

amaze,

cheers but i dont get how to do this.

I shall try and explain by prob a bit better. the site im working on has about 120 products you can look at. the main movie is the navigation. when u click on a the navigation buttons they load a new movie into tha main movie with all the product details.

what i want to do is when the page is loaded i want a product to show with out the user clicking on the navigation buttons to see it, but i still want to keep the navigation there.

do you want the product movie to be inside your navigation menu movie or above?
in your first thread you asked to put it “on top” and i thought you wanted it to be a pop up inside the page.

if you just want it to be loaded inside your main movie all you have to do is copy the code you inserted in your buttons and paste it in the 1st frame of your movie.

sorry for confusing you amaze.

I want it to load inside the main movie say on layer 100.

could do it simpler I think…

on the link:


<a href="mypage.html" target="whereever" Click Here </a>

the page would simply have to have the flash movie embedded in it. Then the flash movie itself could use the command loadmovie.
Put in a frame:

Loadmovienum(“mymovie.swf,level1”);

or whatever.

This may not work in the way you want it to, it depends what you want to happen exactly - its not entirely clear.

If you want to display dif products on clicking the product it would be best to use loadmovie from the start.