Archive for the ‘SWFObject’ Category

SEO and Flash part 2

Saturday, November 10th, 2007

In the previous article I said my tutorial about search engine optimization was going to be in 2 parts, well it’s going to be in 3 parts. In this part, I’ll explain the brute force way of making what we did the last time even better and I’ll explain the motivation behind it.

Remember that in part 1 I said that one of the most important factor in search engine optimization was what is inside the title tag. Well the easy way of making you flash website be present in search engines didn’t really optimize that factor; we used it a bit but not to its full potential. Also there is something else I didn’t speak about; the description meta tag. This tag is not a factor to be well ranked in search engine, but it can definitely be a reason why the user will click on your link on the Google page or any search engine’s page. The description meta tag define the paragraph of text that will be displayed below the link in the search engine search result page. Having a good and precise description can really help get users to your website. Lastly, if somebody searched for an expression that is present in your flash website but it is really far in and not that easy to find, in our previous method, the user will have to search trough your site to find it and might leave before even finding it.

Ok, so the previous method was that we dumped all the text present in the swf file in the html page embedding it. This was fine, but not really optimal as I have explained. Going from there, what the brute force is all about is dividing all the content we dumped in the first method into different html pages. For each section in the flash website, we make a page for it in Html and we embed the same swf in all pages. There are 3 particularities you have to add to make this work.

First, in the embedding method using SWFObject, you have to pass a variable the swf file telling it what page it is on. You can do it in this way:

<script type=“text/javascript” src=“swfobject.js”></script>
<script type=“text/javascript”>
    var flashvars = {
	page : "WRITEYOURPAGEHERE"
    };
    swfobject.embedSWF(“myContent.swf”, “myContent”, “300″, “120″, “9.0.0″, “expressInstall.swf”, flashvars);

</script>

So now the swf files knows what page it is on, but it has to do something with it. When the flash loads it has to check in ActionScript for the variable that was passed to it in our case _root.page and display the good content section according to it.

The last thing you have to do is in the alternative content, make a link menu that links all html pages you created. This menu has to be in every html page of your site. You have to do this so that search engines spiders can access all your pages and index them.

What we did with this method is create multiples entry pages to your flash website instead of just one. Also this enables us to give a different title and description to each page which optimize those factors. With all this said, I can now explain why I call this the brute force method; this is not yet the best method to optimize your website for search engines. It will give you the same results as the next method, but will require more time as is harder to maintain since when you make a change in content in the flash file, you also have to do the same modification in the html page. The good point is that this method doesn’t require any server side scripting like php or asp.

Finally something about SEO and Flash

Wednesday, November 7th, 2007

I have been postponing this for a while but I think this is a good time for it now. This article will be the first part of a two part tutorial about how to optimize your website in flash for search engines. This tutorial is about the straight forward way of doing it involving no server side scripting. It is not the ultimate way to do it, but it sure is way better than doing nothing.

The first thing anyone interested in optimizing their site for search engines should do is read this article on seomoz.org on the topic. It is about how to optimize in html but a lot of thing that applies to html still applies in flash, read on to know why.

So if you read the article you will know that one of the most important factor is title of the Html page. The title in html is the text you see appearing in the blue bar at the top of your browser. That’s nice because with a flash based website, the title is still the html title, so you should give a lot of attention to it. And also it is really easy thing to modify. You should really think about the words you put in your title because you only have a limited number of words. Some say 60, some say more, I have a tendency to put more and let the search engines crop the end of them. Keeping that in mind put the most important key words first. Don’t just dump keywords, try to make sentences and slogans, search engines have been around for a while now, they know when you are trying to fool them.

Next thing you have to optimize is your text content. Google, and other search engines, cannot see in your Flash files (well I think now it can, but it sure cannot see dynamic text) so we have to find a way to make your text content accessible to them. It all happens in the html integration of your site. First, don’t use the default html page that flash, even flash CS3, creates for you. It’s just not good enough and there is a lot of bugs related to it. The best way to integrate a Flash is to use SWFObject. It’s so good that Adobe is even speaking with the makers of it to put it in the next version of Flash. Go read about it and check the examples, it is very well explained. The basic of SWFObject is that it will replace a div (or a td) using javascript by the proper Html to embed a swf. All the magic for us happens in the replacing of the div. Here is a sample code of how to embed using SWFObject:

<script type=“text/javascript” src=“swfobject.js”></script> <script type=“text/javascript”>
    swfobject.embedSWF(“myContent.swf”, “myContent”, “300″, “120″, “9.0.0″);
    </script>
</head>
  <body>
    <div id=“myContent”>
      <p>Alternative content</p>
    </div>
  </body>

So you see, everything that is in the div with id myContent will be replaced by your swf file. You can also see the text Alternative content in there, this is where you are going to put all the text that is in your swf file. Think of it as a tune down version of an html page. So don’t just cut and paste your text in there; use p tags around paragraphs and most importantly h1 tags around your titles. In the article from seomoz, you can read that text inside h1 tags is also really good for search engines. So use it to put your titles and important text. Another good point of using this technique is that screen readers for blind peoples just as search engines will be able to read your alternative content. Well that is it for part 1 of this article, part 2 will be about creating more than one entry point to your site using either brute force or server side scripting.

SWFObject and SWFAddress again

Monday, November 5th, 2007

Well this is just to tell you that SWFObject released the version 6 of their beta. I really hope they put the finishing to their code soon, my project which will rely on SWFObject and SWFAddress has to go live in January. Speaking of SWFAddress, they said that they were going to release version 2 November 16th. I don’t know how they can release it before SWFObject which it is based on, but maybe they have some inside information saying that SWFObject won’t change much until release. Anyway, we will see.

I was a bit wrong about SWFAddress

Tuesday, October 16th, 2007

Yesterday I was granted a comment by one of the developers of SWFAddress, pointing the fact that I was not using the latest version of SWFAddress and that was indeed true. So I started the day, thinking that my problem would be solved. So I got the latest version and tried it. Well it did not work either. But don’t let go so easily so I put some time into it.

First at SWFAddress they are using SWFObject 2 beta 3, I was using beta 4. But in beta 4, SWFObject is used as a static method. I think that will mean a lot of changes for the guys at Asual. Anyway, I downgraded my version to beta 3(which is not very logic) and tried once more. It didn’t work again. I tried with Explorer, Firefox, Opera, nothing worked. I then decided to mess with the code. I did calls from the externalInterface in flash to a javascript alert function. With all that I found that the SWFAddress.value was never initialized and it did a check for that before executing the setValue function. If I removed the check, I could now use the back button, which is half what I want to use it for.

I don’t know if it is my setup, I always have an external preloader; the SWF that includes SWFAddress ActionScript, is loaded in the preloader. Maybe this is what disrupts it from working, I don’t know. My point for all this is, yes I was wrong, SWFAddress will work with SWFObject; eventually.

SWFObject and SWFAdress will not work anymore together

Tuesday, October 16th, 2007

I have tried the beta of the new SWFObject (SWFFix renamed) and it works quite well. I don’t have the mouse wheel problems I had previously. On the website that I am currently working on, I wanted to use SWFObject, but also to use SWFAdress. But since SWFObject changed considerably from version 1.5, SWFAddress won’t work with it, we will have to wait for another version or tweak it to make it work. It was nice that SWFAddress worked with SWFObject, it reduced the overhead, but the drawback is that if SWFObject changes, SWFAddress has to change too.

SWFFix no more, back to SWFObject

Thursday, October 4th, 2007

Some news on the side of SWFFix; it doesn’t exist anymore… Back to SWFObject. Well only in name. Since the name SWFFix implied there was something that needed to be fixed with flash, Adobe wasn’t to happy about it and why start from scratch when every flash programmer knows what SWFObject is. They made this announcement earlier this week and at the same time released a new beta for the application. I can’t wait to try it since it solved some problems but created other. Well this is for the best.


Close
E-mail It