# Hiding Flash, Showing Flash

**URL:** https://forum.kirupa.com/t/hiding-flash-showing-flash/262371
**Category:** web dev
**Created:** [June 5, 2008, 1:59pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371 "2008-06-05T13:59:09Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![gregmax](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gregmax](https://forum.kirupa.com/u/gregmax)
#### Post date: [June 5, 2008, 1:59pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/1 "2008-06-05T13:59:09Z")

</div>

Hello everyone. I seem to be stuck on showing and hiding the object/embed tags through JS. I have a div that displays on top of the page when the user clicks on a link. Before I user clicks on the link to show the div, the div is display:none; and after the user clicks on the link it will be display:block. However, before I set the div to have a display:block, I want it to hide all the object/embed tags. I do so by calling a function passing a value of either “close” or “open”. It seems I have it working both ways, but is doesn’t become “visible” again after I hide it? This is what I have:

```auto

function swfAction(action) {

	var swfs = document.getElementsByTagName("EMBED");
	if(swfs.length === 0) {
		swfs = document.getElementsByTagName("OBJECT");
	}
	
	for(var i = 0; i < swfs.length; i++) {
		swfs*.style.visibility = (action === "close" ? "hidden" : "visible");
		alert(swfs*.style.visibility);
	}

}

```

When I do the “alert”, the expected value is set accordingly, but the swf/flash file isn’t to be seen!? I appreciate it if anyone can tell me what I am doing wrong, thanks

---

<div class="post-metadata">

### Author: ![fasterthanlight](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fasterthanlight](https://forum.kirupa.com/u/fasterthanlight)
#### Post date: [June 5, 2008, 4:09pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/2 "2008-06-05T16:09:31Z")

</div>

> **[\[Read Before Posting!!\] Asking Questions / Posting Problems Etiquette](https://www.kirupa.com/forum/showthread.php?t=299432)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

---

<div class="post-metadata">

### Author: ![gregmax](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gregmax](https://forum.kirupa.com/u/gregmax)
#### Post date: [June 5, 2008, 5:04pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/3 "2008-06-05T17:04:41Z")

</div>

Yes, I understand… But what if my case you are developing the site on the local server AND you don’t want to give the link out to your site until you finish developing it?

I mean, this is the Development section of this forum and anyone could take my idea and quickly round up a team and develop the site, and there goes my hard work and idea… I am only one programmer compared to how many out there - and I am really slow at programming, hehe. No offense, but I am sure I speak for a lot people who are in the “cautious” zone about this. I understand that “we” (like you mentioned) need to see the site to troubleshoot the problem, but “we” have to take account that a lot of people come here to develop something that is not finished and that is why they are here for help and understanding.

---

<div class="post-metadata">

### Author: ![fasterthanlight](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fasterthanlight](https://forum.kirupa.com/u/fasterthanlight)
#### Post date: [June 5, 2008, 5:11pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/4 "2008-06-05T17:11:28Z")

</div>

Then don’t expect to get any answers that fix your problem.

Here’s my answer to your problem:

the issue you are having lies somewhere in this code:

```auto

function swfAction(action) {

    var swfs = document.getElementsByTagName("EMBED");
    if(swfs.length === 0) {
        swfs = document.getElementsByTagName("OBJECT");
    }
    
    for(var i = 0; i < swfs.length; i++) {
        swfs*.style.visibility = (action === "close" ? "hidden" : "visible");
        alert(swfs*.style.visibility);
    }

}

```

If you can’t trust the people you’re asking a question about, with your work, then whats the point of asking

---

<div class="post-metadata">

### Author: ![Syous](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Syous](https://forum.kirupa.com/u/Syous)
#### Post date: [June 5, 2008, 5:25pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/5 "2008-06-05T17:25:15Z")

</div>

[quote=gregmax;2337369]Yes, I understand… But what if my case you are developing the site on the local server AND you don’t want to give the link out to your site until you finish developing it?

I mean, this is the Development section of this forum and anyone could take my idea and quickly round up a team and develop the site, and there goes my hard work and idea… I am only one programmer compared to how many out there - and I am really slow at programming, hehe. No offense, but I am sure I speak for a lot people who are in the “cautious” zone about this. I understand that “we” (like you mentioned) need to see the site to troubleshoot the problem, but “we” have to take account that a lot of people come here to develop something that is not finished and that is why they are here for help and understanding.[/quote]

I understand what you are saying, but it isn’t likely to happen. No offense, but now a days almost any idea you have will not be new or something so spectacular that people will want to copy it.

You could of also PM’d the link.

---

<div class="post-metadata">

### Author: ![gregmax](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gregmax](https://forum.kirupa.com/u/gregmax)
#### Post date: [June 5, 2008, 5:26pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/6 "2008-06-05T17:26:06Z")

</div>

> 

If you can’t trust the people you’re asking a question about, with your work, then whats the point of asking

Again…

> 

Yes, I understand… But what if my case you are developing the site on the local server AND you don’t want to give the link out to your site until you finish developing it?

Because I have had previous partners who have taken my idea and went off and used them… thats why.

I will try my best to figure it out

thanks for nothing 😕

---

<div class="post-metadata">

### Author: ![Syous](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Syous](https://forum.kirupa.com/u/Syous)
#### Post date: [June 5, 2008, 6:26pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/7 "2008-06-05T18:26:20Z")

</div>

^ You suck at being a kirupian today.

---

<div class="post-metadata">

### Author: ![gregmax](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gregmax](https://forum.kirupa.com/u/gregmax)
#### Post date: [June 5, 2008, 7:22pm UTC](https://forum.kirupa.com/t/hiding-flash-showing-flash/262371/8 "2008-06-05T19:22:56Z")

</div>

After reading some of my posts, yes I am sounding like a jerk, I didn’t mean to come so negative. Apologizes.

I just don’t like being told “can’t help you unless you give us your link” stuff, because of reasons I mentioned above.

Again, sorry.
