Controling layers in dreamweaver using flash

Hi, i want some buttons on my flash movie which is on a .html page so that when they are clicked it can either show or hide a layer. The layers im talking about though are the layers that are on the html page in dreamweaver.

Hope someone can help!

thanks, Chris

You can instruct the browser to execute a javascript statement through a link by placing “javascript: callThisFunction()” in the link.

In this case, in the Flash button, just place the "javascript: layername.path.visibility=‘hidden’ " inside a getUrl() command with AS.

On your button, paste the following code:

getUrl("javascript: thehiddenlayercode");

Then figure out the code to make the layer hidden. I think all you have to do is make it hidden with Dreamweaver, look at the code see which changes it made, and then hide it.

If you don’t know what I’m talking about, then just attach you’re page and your fla and I’ll do it for you, and explain what I did.

BTW, for some reason, by “javascript” becomes “java script” in the above code. It should be “javascript”.

.fla file

sorry - i realised how to attach them both now! me a n00b!

Thanks, Chris

lol.

It’s pretty complicated, so I just put it in there for you.

All I did was add a bit of code inside a getUrl() action. Adding “javascript:” behind a piece of javascript code in a url will activate it when the link is clicked.

The actual code I got from here (number 2).

It isn’t crossbrowser compaitable, meaning it won’t work for all browsers. I only copied the code for the DOM browsers. Just read the browser compaitability bit on the previously mentioned site and that should teach you how to fix the problem. I’d do it, but I’m in a bit of a hurry right now.

If you don’t get something, just PM me (I’ve been unsubscribed from this thread somehow, and so it won’t email me when you respond, and so I’ll probably forget to check this thread.)

Once again, for some strange Kirupa Board Error, the “javascript” comes out to be two words. The words should be combined.

Sorry, forgot to attach it. (-:

ok thank you very much. Much appreciated.

If you got time though could you tell me when i click the “open layer 1” button (and the other buttons) it shows the layer but then loads the page with just “visible” or “hidden”.

I am running Win 2000 with Internet Exlorer 6.

If not then dont worry and thank you for your precious time.

Thanks, Chris

No problem :wink:

I don’t seem to be getting a problem. I’m running Windows XP IE6 SP1.

Also, after I downloaded the attachment myself, it doesn’t work at all anymore for some reason. Submit the attachment you have, I don’t know why it won’t work. I’ll try my best to fix it.

ok - thank you once again!

Attachement below :stuck_out_tongue:

hmmm…

Still won’t work at all for me.

I"m sorry I couldn’t help… But the people at http://www.codingforums.com are experts at Javascript and the others. I suggest going there with the whole Javascript thingy :slight_smile:

Also, some more people on this fourm are Javascript literate. One is lostinbeta (shane), I can’t remember the others right now :slight_smile: