Javascript: toggling between a jpeg and a flash movie

Posted on 2009-02-18
Last Modified: 2012-06-21
Is it possible to toggle between a jpeg and a flash movie with javascript? PLease take a look at this page and let me know how to do it ... if it's possible.

I suppose this could be facilitated by exporting from flash with certain settings, so I'm putting this in the flash zone as well.


Question by:gabrielPennyback
    LVL 15

    Accepted Solution

    like this?
    <script type="text/javascript"> 
    function validate_email(field,alerttxt)
    with (field)
    if (apos<1||dotpos-apos<2) 
      {alert(alerttxt);return false;}
    else {return true;}
    function validate_form(thisform)
    with (thisform)
    if (validate_email(email,"Not a valid e-mail address!")==false)
      {email.focus();return false;}
    <script type="text/javascript"> 
    function mouseOver()
    document.getElementById("div1").style.display = "none";
    document.getElementById("div2").style.display = "block";
    function mouseOut()
    document.getElementById("div2").style.display = "none";
    document.getElementById("div1").style.display = "block";
    .textBox{width:200px; line-height:16px}
    body{margin:40px; font-family: Gill Sans MT; font-size:14px;
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> 
    <div id="div1" style="position:absolute;top:50px;left:20px;width:200px;height;200px;" onmouseover="mouseOver();" onmouseout="mouseOut();"> 
    <a href="" target="_blank"> 
      <img border="2" alt="Visit W3Schools!" 
    src="" name="x"
    <div id="div2" style="display:none;position:absolute;top:50px;left:20px;width:200px;height;200px;" onmouseover="mouseOver();" onmouseout="mouseOut();" >
    <object width="200" height="200"> 
    <param name="movie" value=""> 
    <embed src="" width="200" height="200"> 

    Open in new window

    LVL 1

    Author Comment

    Fantastic!  I love it when the answer is so simple and intuitive.

    Thanks, quincydude.

    - John
    LVL 1

    Author Closing Comment

    Great answer!

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    How to convert code to a png file 22 80
    PHP Radio Array 4 28
    Problem to Popup 37 65
    jQuery-Validation-Engine button onclick problem 13 16
    The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
    This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now