Results 1 to 10 of 10

Thread: Flash Integration

  1. #1
    Join Date
    Mar 2007
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Flash Integration

    Can anyone help me find tutorials/help pages on how to use javascript to swap out content with flash. I'm trying to integrate a website using that and can't find anything I'm looking for!

  2. #2
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    you can do this without javascript I think. why do you need it.

  3. #3
    Join Date
    Mar 2007
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I made a navigation in flash but the website itself I am not coding in flash so I was told that I can use javascript to swap content in the div for the flash navigation.

  4. #4
    Join Date
    Apr 2007
    Location
    Phoenix, AZ
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    There are other alternatives, but the standard that I've seen used most is swfObject. Very stable. Search-engine friendly. Easy to use. It allows you to put in alternate content that gets swapped out if Flash is available.

    http://blog.deconcept.com/swfobject/

  5. #5
    Join Date
    Mar 2007
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What is the best way to do that then? Is javascript not recommended?

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Personally, I would prefer JavaScript over Flash, because with Flash for people without Adobe Flash Player (or equivalent) they can't navigate through your site.
    DD has a couple Content Switch scripts, here's one of them:
    http://www.dynamicdrive.com/dynamici...tabcontent.htm
    - Mike

  7. #7
    Join Date
    Apr 2007
    Location
    Phoenix, AZ
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I made a navigation in flash but the website itself I am not coding in flash so I was told that I can use javascript to swap content in the div for the flash navigation.
    Again, the best way I know to do this is to use the javascript found at
    http://blog.deconcept.com/swfobject/

    First, put the swfobject.js script on your server.
    In the head of your HTML page, link the script to your document like this:

    Code:
    <script type="text/javascript" src="swfobject.js"></script>
    Make a <div> that will hold your flash menu. This can be an empty <div> or it can have content (perhaps an HTML version of your menu):

    Code:
    <div id="flashcontent">
      This text is replaced by the Flash movie.
    </div>
    After that <div>, add the javascript function call:

    Code:
    <script type="text/javascript">
       var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#FFFFFF");
       so.write("flashcontent");
    </script>
    The parameter "movie.swf" should be the path to your swf movie. "mymovie" is the id that will be assigned to the object or embed tag. the next two are the width and height, followed by the Flash version that should be detected, and finally the background color. There is a lot more info about it on the link above.

    This code will insert your flash movie into your HTML file if the required Flash version is present. If not, people will just see whatever HTML you had in the <div> to start with.

  8. #8
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Whoa... never seen anything like that before. That's a pretty snazzy script. I don't particularly like all the browser detection though, but I guess that's necessary in some cases.
    - Mike

  9. #9
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    But what about the people with JS turned off...

    they cant veiw the movie, assume it isn't there and move onto another site.
    To be safe, have noscript tags in the div with the movie.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  10. #10
    Join Date
    Apr 2007
    Location
    Phoenix, AZ
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    But what about the people with JS turned off...
    If people have js turned off, they just see the alternate content provided in the <div> (if any). If it were a menu like this one, I'd just provide an HTML menu there. In a lot of cases, people who don't have Flash or have JS turned off won't even know that the Flash was supposed to be there.

    Plus, search engines see your alternate HTML content even though most users see the Flash.

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
  •