6 Replies Latest reply on Apr 19, 2010 7:33 AM by Chorale0001

    Enable/disable a SWF on click

    Chorale0001 Level 1



      I am looking for some code to help me because my knowledge is not that good ( even BAD !)


      The idea is i will have a website with 1 button put on top of the screen ( almost in the header, but not fully ) and when i click on it, it enable the SWF which contain the menu itself for the navigation in a Z-index2 to be on top of everything.


      This action need to be repeatable just in case the viewer is enabling the SWF but then decide to stay on the webpage.


      I will make the SWF kill itself if the user stay on the same page ( switching page fully reload everything, including the code i'm looking for to activate the Swf )


      Also if the user click again on the same button , it need to turn off the SWF.


      I figure this is a good way to also be fully compatible with Firefox and Chrome and also when you want to print the website because you just kill the SWF.



      Anyone can help me ? i think this is a newbie question, but hell, i am a newbie.


      Thanks a lot


      Message was edited by: Chorale0001, Added a lot of thing

        • 1. Re: Enable/disable a SWF on click
          Linda Nicholls Level 4

          That sounds like it would be really confusing to the visitors to your site. Here's a  wikipedia article on the concept of "Mystery Meat Navigation."  http://en.wikipedia.org/wiki/Mystery_meat_navigation you might find worth a read.

          • 2. Re: Enable/disable a SWF on click
            JoeDaSilva Level 4

            You would build all of that functionality inside the Flash file using ActionScript, not HTML.


            Also, this is horrible idea from a usability standpoint.

            • 3. Re: Enable/disable a SWF on click
              Chorale0001 Level 1

              Hey thanks.


              however the initial concept was to always have the menu available but as time go on, it evolved into that idea. The probleme with the menu is that it is right in the middle of the screen like a star with 6 point and 1 sub_menu . It worked perfectly until we test in Firefox and chrome. The only way for us not to do as described above would be to be able to click through the transparent zone of the flash so that the user can click any link.


              But as far as i read, Firefox and Chrome have a big tolerance issue with that.


              In short, it is either having someone with a genius idea to fix the transparency issue with the flash.

              Or doing like i said in the original post.


              The fact that the menu is in flash allow us a much easier way to build the content of the website without having to worry about going around a "static" menu. So even now, after much evolving, we have to click the menu button.


              Demo available here ( work in progress ) www.episodesoft.com/demo/index_fr.html


              There is a third solution that is to kill the flash each require time and call it again each time. but i'm not confortable with that one.

              • 4. Re: Enable/disable a SWF on click
                Chorale0001 Level 1

                Hye JoeyD


                I understand what you want to say. but my skill with flash are Low and we dont have the budget to hire a real flash programer, si i'm stuck with doing it myself with whatever skill i have


                If you know how to make the flash resize the cavena ( not the content ! please !) so he can be a small portion at a very specific location , both X and Y it will be even better because in that case for there will be no java communication with flash, would solve many problems.


                As far as i saw about that resizing, it can be done in as3, but i'm in As2, also please considere that it is my first real project in flash, so... im a beginner that have to deliver something that is challenging like hell for him and that in a short period of time


                About the Idea, at start the idea was to have the menu available all time without having to click on a button to make it appear, the menu was on a zoom at 60 % state in center of the page, however design evolved and we replaced it by that.

                • 5. Re: Enable/disable a SWF on click
                  pziecina Level 6



                  Not really certain about the effect you are trying to achieve, but the simple method to show/hide an swf object is to use the css display property, and if you wish to achieve this then use javascript to change the display: none; to display: block; , (or which ever value you wish) to show/hide your swf.


                  The second method would be to use actionscript to resize the swf to a smaller size, or even move the swf to another position, (off screen) but this would require a knowledge of actionscript.




                  • 6. Re: Enable/disable a SWF on click
                    Chorale0001 Level 1

                    Probleme solved


                    Fixed with As2 script and Java


                    Thanks !