This happened to me in IE7, with an as3/flash using externalInterface: if inserted with swfObject the flash object is not initialized upon page reloads (the object tag is there, but only a white box is visible – even if the movie has a different bg color). It does work if a new tab is opened or the browser is opened and closed, but not with reload; the only solution that worked for me is the old non javascript insertion method; is this another swfObject bug?
Posts Tagged ‘flash’
Flash movie not initialized after reload in IE
Wednesday, November 4th, 2009Flash movie hide/show and externalInterface problems
Wednesday, November 4th, 2009Flash 10 on Firefox has some pretty weird problems if the flash object or the container is hidden and shown again.
Using show/hide totally destroys the externalInterface registered methods (in the flash, trying to call from js); position absolute, relative, or overflow hidden (zero sizing the container or locating it outside the visible area) doesn’t deregister the externalized methods, but renders them useless (meaning it will not throw a js error, it just won’t do a thing).
Without talking about the horrors of IE, in this case the solution seems to be the position absolute trick (left: -1000px or smg similar), remove the hider class to show the container then one must use a setTimeout to wait for the flash object to “stabilize”. If requested I can send an example, now I’m just too tired…
Cancel KeyboardEvent.KEY_DOWN in as3 TextField
Friday, October 9th, 2009For flash people this is probably easy, but it gave me a slight headache: I want to catch a couple of keys in a TextField and do things; but since the key has also been catched by the control, a black square appears (in my case) which I’d rather not have. Since the KEY_DOWN event is not cancellable and I couldn’t find a solution with the propagation phase / priority, I did end up cancelling TEXT_INPUT itself:
addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
addEventListener(TextEvent.TEXT_INPUT, cancelKey);
//...
private function onKeyDown(event:KeyboardEvent):void
{
cancelChar = false;
if ((event.ctrlKey) && (event.charCode == "b".charCodeAt(0))) {
cancelChar = true;
//do something with ctrl+b here
}
}
private function cancelKey(event:TextEvent):void
{
if (cancelChar) {
event.preventDefault();
cancelChar = false;
}
}
My sIFR clone
Friday, May 1st, 2009To learn a bit of a flash I created a (yet another) sIFR clone: docs, flashdevelop project file and demo page are on rosamez.com. As a conclusion I must say, debugging in FD is quite a pain, add some SwfObject idiosyncracies and you’re ready for a nice headache.
Flash, Flex, Apollo – where to start?
Saturday, February 10th, 2007Extracted the flex 2 sdk to my bin dir and gave it a spin: the compiler is written in java and everything is pretty straightforward, BUT: since the whole opensource flash community is revolved around the MTASC universe (which is AS2) I am standing here without a relieable free and opensource AS3 editor to begin with. So far, the contenders:
- SciTe|Flash: too lightweight, maybe nothing Jedit could not do?
- Flashdevelop: pretty good, but built on .NET… afaik it does not work with Mono
- SePy: a flash ide written in Python for Win32 and Mac. Works nice with Wine at least
- Eclipse: the beast Macrodobe choose for their Flex platform; as of this writing ActionScript IS Flex2 which costs quite a lot just for fooling around (not to mention that right now it is much better for the UI stuff (mxml) than for AS)
I consider HaXe a dead end and as for Flex I would prefer OpenLaszlo, but the compiler is pretty tempting. With a useable ide, a debugger library and SwfMill I think this might be worth checking out…