10 search engines and flash

One of the biggest arguments against flash is problems with search engines. The content of the swf is not searchable. After some search I found this text that suggest that you should use the swfobject-replace-div-tag to place the content in and then load the flash. The search engines indexes the text and everyone is happy. You can even style it if you want with css.

The problem with this is that you loads the content twice. One when you load the html and one time when you loads the swf. Thats not a big problem since the files are often small and everyone has a fast connection, but its not nice. I made this javascript thats takes the content och the div-tag and sends it to the swf as a flashvar. Another great thing about this is that you dont have to wait until the xml i loaded since its already there in _root.texts. One limitation to this approach is the 65kb -limit on flashvars, but that is a lot of xml.

Before it send the text it replaces the div tags to simpler xml-nodes. Div tags are used in the replace-div to make the html valid xhtml. The class attribute is used to store the note name and the id is kept as a id-attribute.

<div id="swf">
<div class="text" id="text2">This is a two
line text, åäö å</div>
<div class="choice" id="useFlash">true</div>
<script type="text/javascript">
// <![CDATA[

var div_id = "swf";
var div_txt = document.getElementById(div_id).innerHTML;
var xml_txt = div_txt.replace(/<div class=\"(\w+)\" id=\"(\w+)\">([^<]*)<\/div>/g, "<$1 id=\'$2\'>$3</$1>");
var so = new SWFObject("flash.swf", "flashmovie", "400", "200", "8", "#FFFFFF");
so.addVariable("texts", "<root>"+xml_txt+"</root>");
// ]]>

the result i can be shown below, its only an example, the code is not used in the example due to wordpress editing possibilities. A plugin has to be written to make it possible to use.

The flash only contains a textfield and the code
txt.htmlText = unescape(_root.texts);

There is a bug somewhere with special characters as åäö. They are not sent to the swf even if utf-8 is used. I have to investigate that further. [update: found a solution, see comment below ]

10 Comments to “search engines and flash”
  1. Roseann, on October 27th, 2014 at 20:32:11, said:

    With only 24 hours in a day, all focus is required to pull
    through each day successfully. In fact, this is one of the most common reasons why relationships fail.
    It’s your night and you only have 4 minutes with each person so go for it.

  2. escondido title insurance, on January 21st, 2015 at 03:02:43, said:

    Good blog you have here.. It’s hard to find excellent writing like yours these days.
    I seriously appreciate individuals like you! Take care!!

  3. what to text girls, on March 13th, 2015 at 04:55:00, said:

    It’s the opposite of attractive and is quite repulsive.

    Adorable tattoo dersigns for girls are straightforward
    to arriv by. If youu are a guyy who is eager to create a good image on your first text message to a girl, here aare some tips based
    on prsonal experience.

  4. text a girl you like, on July 16th, 2015 at 23:41:20, said:

    Don’t overdo it because that’s the complete opposite. When a few Long Island residents were asked, “What’s the best way to approach a girl after you meet her at a party. The Crucible: Townspeople are not willing to stand up to the court for fear of being accused of being a witch.

  5. Wayfair free shipping, on July 16th, 2017 at 06:38:29, said:

    Thanks a lot! A good amount of information!

  6. “Neutralizers provide total EMF protection”, on November 13th, 2017 at 19:53:57, said:

    I enbjoy what you guys are usually upp too. Such clever work and reporting!
    Keep up the superb works guys I’ve you guys to my blogroll.

  7. emf computer protection, on January 4th, 2018 at 01:28:03, said:

    Ahaa, its nice discussion about this article att this place at this webpage,
    I have read all that, so at this time me also commenting at thuis place.

  8. “Neutralizers provide total EMF protection”, on December 13th, 2018 at 10:03:26, said:

    Nice post. I used to be checking continuously this blog and I am inspired!
    Extrmely helpful info speciffically the ultimate phase :) I take care of such info much.
    I used to bee seeking this certain info for a very long time.
    Thank you and best of luck.

  9. “Protection Pendants provide total EMF protection”, on December 16th, 2018 at 12:20:31, said:

    I want to too thank you for this great read!! I definitely enjoyed every little bit of it.
    I hage goot you saved as a favorite to check out
    new stuff you post…

  10. https://smart-meter-radiation.microalpha.com/, on May 17th, 2019 at 06:57:24, said:

    Thhis site was… how do you say it? Relevant!! Finaoly I’ve found sometthing
    which helped me. Appreciate it!

Comment on this post below

You can leave a response, or trackback from your own site.