another swfobject problem, deproblemed
flash/rich HTML coexisting is definately turning up a whole new, fun set of challenges. So far, some of my favorites are: * having rich modal windows appear behind flash elements (fixable using the iframe shim technique) * setting focus of various elements (fixed by creating a variable in our base page class that let me set the default focus to any elment by ID) * today’s, having to do with the ExternalInterface.AddCallback method in flash, and its playing nice with swfobject.
In essence, we have a login function that pops up one of those nifty DHTML layers with a login box. Our top navigation is all flash, and has a login call to action…so having flash call javascript functions isnt hard, but getting javascript to “poke” at the flash and have it run an internal function is a bit trickier. Utilizing the aforementioned callback method, its fairly simple. The problem we had was, in Internet Explorer, order of operations was a bit out of whack.
we got an error on:
__flash__addCallback(coreLoader, "loginNav");
coming from INSIDE the flash…what seemed to be happening was the javascript that set up the object “coreLoader” wasnt running at the right time because of the time it took for swfObject to set up the embed. So, adding
coreLoader = $('coreLoader');
immediately AFTER
so.write("topNav"); set up the object again, this time not filling the object with a null (because swfObject had
correctly identified an embed with id=coreLoader), and allowing the internal flash “addCallback” function to work.
hm, technical writing is difficult. but i felt the need to document this problem (even if it wasnt very well) for my own future reference, and hopefully someone else will find it handy as well.
the more general moral of the story is: pay attention to order of operations, they may save your life some day.
Find out details or sign up below. Save $75 by using the code DANGER.
YUI/WordPress Comment System
somewhere in my cramped schedule i plan on taking some time to really evaluate some of the power behind the Yahoo UI Library. Ive seen Dustin Diaz do some cool stuff with it, but this morning Ryan pointed me to a sick WordPress comment installation by Jack Slocum that was rapidly built using YUI. The system allows you to comment in blocks of content within a blog post, as well as the overall post. VERY cool. And, as Ryan pointed out, really freaking fast.
Demo/source included in the posting of the project itself.
worth checking out for sure.
Find out details or sign up below. Save $75 by using the code DANGER.
click to activate? again?
ive been using deconcept’s swfobject for a while to remedy the IE Click to Activate box…along with simplifying the embedding of flash elements on the page. for one reason or another, the Click to Activate problem comes back if you leave the browser open for a little while, even though every flash element is embedded with javascript.
so while the IE bug is a strange, somewhat unpredicatble manifestation, one of my coworkers suggested this fix. I added it to the mix and everything is back to normal.
i tried to understand why, but really, it’s IE so all logic is out the window.
if anyone has any idea why this might happen, please, give a shout.
Find out details or sign up below. Save $75 by using the code DANGER.
deconcept swfObject bug debugged!
remember how i said my png transparency solution relied on deconcept’s swfobject? We noticed that whenever you clicked a link that left a page, it seemed that every embedded flash object was dumped from the page, collapsing holes and causing everything to look screwy for a second before the page switched.
for the record, this can be fixed by following these directions: http://lists.deconcept.com/pipermail/swfobject-deconcept.com/2006-August/001407.html
Or, just comment out these lines from the swfobject.swf
if (typeof window.onbeforeunload == 'function') {
var oldBeforeUnload = window.onbeforeunload;
window.onbeforeunload = function() {
deconcept.SWFObjectUtil.cleanupSWFs();
oldBeforeUnload();
}
} else {
window.onbeforeunload = deconcept.SWFObjectUtil.cleanupSWFs;
}
edit: for crying out loud, why dont any of my wordpress plugins for code formatting work???
edit 2:
Geoff at Deconcpet wrote me about this, and it was definitely a known issue. I’m previewing the next release of swfobject, which seems to have the problem locked down, although, i dont have the ability to test the main function of the cause of the bug: the release of swf’s with streaming content. I should have that soon, for testing, and will follow up a report on that.
Thanks, Geoff. You (and swfobject) are awesome.
Find out details or sign up below. Save $75 by using the code DANGER.
cleaner (?) documentation, source code, swf
check out http://www.dangerouslyawesome.com/png2swf/ for less rambley documentation, and some downloadables.
WARNING: everything is still very alpha. very much in testing/production. report bugs in the comments, but theres a good chance i’m already aware/working on it
Find out details or sign up below. Save $75 by using the code DANGER.


