Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,865 members, 7,817,562 topics. Date: Saturday, 04 May 2024 at 02:24 PM

Let's Learn Something 5: Flash Abuse - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Let's Learn Something 5: Flash Abuse (1087 Views)

Let's Learn PHP / Let's Learn Something 2 - The Importance Of Specifying A Doc Type / Let's Learn Something: Website Optimization (2) (3) (4)

(1) (Reply) (Go Down)

Let's Learn Something 5: Flash Abuse by yawatide(f): 1:08pm On Jul 03, 2008
I know, I said I wouldn't be writing another series so as to focus more on my upcoming Ebook (7 of 15 chapters have been written. Stay tuned for details on how to purchase your copy. I am even thinking of organizing a seminar). However, this learning things is in my blood and I get ideas of what to talk about all the time. What's more? This particular lesson won't be in the book.

How many times have you been to a website where they have some "cool" flash effect in the header that keeps playing over and over. Then you click to the next page, flash plays again. You click to the next page, flash plays again. How many pages can you withstand b4 u say, "to hell with this site. I am not coming here again"? For me, it's usually 2-3 pages. I noticed this on a particular site I visited this morning, hence this post. So I have decided to take off my developer hat in favor of a researcher hat in order to find a possible solution to what prodgalson termed "flashterbation" many many posts ago.

My solutions hover around having the flash play on the home page but just displaying a static version of the same flash (what the last frame looks like with everything assembled) on subsequent pages.

Please note:
I don't claim to have THE solution but claim to have A solution. Feel free to chip in as well.

Solution 1 (good):
Have the flash version on the home page and the image version on subsequent pages.

Disadvantage:
I would imagine we all code with includes in mind. I have includes for my header, footer, nav section and anything that repeats itself more than once. If you have 5 different versions of the same thing for example, making updates will be a pain as you would have to do so 5 times

Solution 2 (better):
Have one include for the home page and another include for the other pages with the static image.

Disadvantage:
Bad from a maintenance standpoint. Imagine having to make a change. You would end up repeating code at least twice. Imagine further a situation where you are no longer in charge of the site and/or someone else is hired to make a change in your stead. If th person doesn't know anything about your site's architecture, the change(s) will be implemented only once.

Solution 3 (best, at least to me):
Have one include for both the flash and static versions. You set a back end (say, in PHP) cookie with an initial value of false. You then set the cookie to true once the page loads. You then check the value of the cookie on subsequent pages. If the value is true, display the image, else display the flash. To reset the cookie, I would imagine you could call a javascript code snippet on unload, setting the cookie back to false (yes, you can mix back end code with your javascript code).

Advantage:
All the code resides in one include.

Disadvantage:
Reliance on javascript - users may turn this off although in this age of AJAX, I doubt this would be the case.

So that's it folks. Anyone have a better solution? In the end, the aim is to prevent the flash from playing more than once so that pple like me who are easily distracted by moving objects on the screen can concentrate on the main reason they went to a site - information gathering, etc.

Let's LEARN something.
Re: Let's Learn Something 5: Flash Abuse by prodgalson: 6:08pm On Jul 08, 2008
Option #1 is what I've typically used, but with a twist. Your solutions rely on having the display logic reside entirely in the php (or whatever you have on the middle tier). An efficient solution would require some knowledge of Flash/AS, and involve having some of the logic on the flash side of things:

1) Have a single include for all pages, say banner.php
2) Within banner.php, you instantiate your flash swf
3) In banner.php, conditionally pass a variable *into* the swf, depending on if the swf has been cached or if this page has been hit before
eg. : instead of loading "banner.swf" , you load "banner.swf?hasBeenViewed=<?=isCached?>"
you can 'feed' variables to a swf using a query string.
4) In flash, before displaying or animating anything, check the flag 'hasBeenViewed' , and display appropriate content.
Re: Let's Learn Something 5: Flash Abuse by yawatide(f): 6:30pm On Jul 08, 2008
@prodgalson
Pretty cool! I am happy I have been able to coax you out of your posting slumber and that I have finally heard from a flash guru with regards this issue, considering flash isn't one of my strongest points, so to speak cool

So, what are the advantages of passing in a var into the swf as opposed to the say, the PHP? I am not saying mine is better. I just want some more convincing. I know you've said that it's more efficient but how so? Let us learn some more.

Thanks
Re: Let's Learn Something 5: Flash Abuse by mambenanje(m): 8:44pm On Jul 08, 2008
@yawa
I think the main advantage of doing it in the flash swf file itself is to solve the disadvantage of having two differnt banners and ,
so if you do some php or server side logic in the banner you include to test and pass in the variables as "flash vars" to the shock wave file. whenever you load the banner, it will know what to do either to animate it or to show just the end of the animation (last frame ) wink
good post yawa, am amazed a girl is writing this much kudos
Re: Let's Learn Something 5: Flash Abuse by yawatide(f): 8:52pm On Jul 08, 2008
@mambe

Girl? Excuse me! I will forgive you this time tongue

Thanks for the clarification. I totally get what you are saying. With my conditional, I would have to say, "if true, show flash, else show image" whereas with yours, everything is done completely within one file. Makes total sense to me.

Wow! I just learnt something new today. Let's keep it flowing.
Re: Let's Learn Something 5: Flash Abuse by uspry1(f): 10:13pm On Jul 08, 2008
I agree with @prodgalson.

That's why I favor Flash website to load external file such as PHP, XML, PDF, all photos, CSS, javascript, database file, and goes on into flash movie instead of HTML website that way no one can see view source except for swf-decompiler.

London's Computer Arts magazine was the first Flash Dynamic Website actionscript release including PHP, XML, video/audio files back 2003. (it was free distribution in the US, now it is discontinued).

That's how i learned while distance schooling earning my Bachelor of Fine Arts Visual Communication degree. All Federal government agencies/companies in the USA already changed their mind that USED TO BE BANNED DEVELOPING FLASH SITES because of accessibility law.

Now no longer ban it anymore after they (USA) learned about London hottest dynamic Flash sites popular, the same way London learned about USA's web usability and accessibility law.

USA admitted to think all Flash sites annoying---they were wrong, London showed them PROOF!!! That's why Adobe.com work harder to make developers happy in the quality of multimedia/development software improvements.

Hooray! Hooray!

(1) (Reply)

Ait Website Down? / Unable To Login - Help / Professional Opinions About An SMF Nairaland Look Alike Forum

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 29
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.