Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2008
    Thanked 0 Times in 0 Posts

    Drop down menu for Flash object

    I would like to create a drop down menu similar to the one that displays images as in:


    But rather than for images, I would like it to open and display also flash object on the one webpage from the drop down menu.

    Can this be done? and if so anyone give me some hints on how to code it.

    I have tried to replace the image name (heart.jpg) with the flash object name (animation.swf) but this did not work.

    Thanks in advance.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    In a place far, far away...
    Thanked 1,043 Times in 1,019 Posts
    Here try this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    function showAnimation(what)
    	var flashfile = what.split(',')[0]+'.swf';
    	var width = what.split(',')[1];
    	var height = what.split(',')[2];
    	var so = new SWFObject(flashfile, "mymovie", width, height, "8", "#FFFFFF");
    window.onload = function()
    <form action="#" method="post">
    <select name="flash" id="flash" size="1" onChange="showAnimation(this.options[this.selectedIndex].value)">
    <!--the value of each option contains three items separated by a comma, flash file name (no extension), width, height-->
    <option selected value="animation1,100,100" selected="selected">Animation 1</option>
    <option selected value="animation2,50,75">Animation 2</option>
    <option selected value="animation3,75,100">Animation 3</option>
    <div id="flashcontent">A flash animation should appear here</div>
    Attached are the files you need. swfoject.js comes from http://blog.deconcept.com/swfobject/ so if you need to parameters or something read the documentation.
    Attached Files Attached Files
    ||||If you are getting paid to do a job, don't ask for help on it!||||


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts