Results 1 to 5 of 5

Thread: <img> linking to Flash player

  1. #1
    Join Date
    Apr 2010
    Posts
    58
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default <img> linking to Flash player

    So I created a flash play list using xml, and it works for the most part besides the embedding problem. Anyway, I am wondering if there is a way to have an image (or any link) on the HTML page communicate with the flash video player to have that video play.

    IE.

    HTML Code:
    <img src="images/demo1.jpg"/>
    <div class="example">
      text1: text1 <br>
      text2: text2
    </div>
    when that image is clicked on I want the flash video player to play demo1.flv.

    or when

    HTML Code:
    <img src="images/demo2.jpg"/>
    <div class="example">
      text1: text1 <br>
      text2: text2
    </div>
    is clicked the flash video player would need to play demo2.flv

    I also don't want to reload the page every time a new video is selected to play.

    Thanks for any help.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Have you tried my solution for the embedding problem?

    As for linking with a button or an image, it can be done. Not the prettiest of methods but do able.

    Have a look at the response to this thread for a quick and dirty explanation while I look for a more substantial method. This one should get you the idea though.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Apr 2010
    Posts
    58
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    I quickly went through and changed to complete links but I don't think it worked. I need to look at it closer, but don't really have time till later tonight. Thanks for the help

  4. #4
    Join Date
    Apr 2010
    Posts
    58
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    So I checked out that site and I think it was helpful, or it just made things worse.

    What I have so far:
    HTML Code:
    <div id="portfolio_flashcontent"><span class="align-center">
                                <embed
                                src="flash/demo.swf"
                                width="490" 
                                height="330"
                                allowscriptaccess="always"
                                allowfullscreen="true"
                                />
                                </span>
                            </div>
                            
                            <div class="portfolio_spacer">
                                <div class="portfolioimagesLeft">
                                    <div class="gallery">	
                                    <a href="#" onclick="setVideo('demo');"><img src="images/portfolio/motiongraphics/thumb_demo.jpg" /></a><br />
                                	</div>
                                    <div class="portfoliotext">
                                        <b>Business:</b> Demo<br />
                                        <b>Description:</b> Sample of motion graphics that can be used in a variety of different ways.<br />
                                    </div>
                               </div>
                           </div>
    Code:
    <script>
                                  	function setVideo(name) {
                                    var names = {
                                        'demo' : {
                                            'swf' : 'http://www.mysite.com/flash/demo.swf'
                                        }
    									
                                    };
                                    setFlash(names[name].swf);
                                    document.getElementById('portfolio_flashcontent').innerHTML = names[name];
                                }
                        		 </script>
    The image appears to be showing up, but I can't get the video to play

  5. #5
    Join Date
    Apr 2010
    Posts
    58
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    I was looking into this a little bit more and came across this:

    ExternalInterface

    From what I was reading it seems like that is probably want I to use, but I'm having a problem using this function.

Bookmarks

Posting Permissions

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