Posts Tagged ‘as3’

Microphone confirmation dialog not showing in Firefox

Posted in Adobe Flash, Problems & Solutions on May 11th, 2010 by Øyvind – Be the first to comment

A few days ago I was struggling with an application that made use of the client computer’s microphone for crucial functions. The problem was that the built-in security settings panel for granting access to the microphone did not open in Firefox on the Mac.

Normally, whenever you do this:

var mic:Microphone = Microphone.getMicrophone();

The Flash Player automatically opens this panel to ask the user to allow the microphone to be connected:
Flash Player Microphone confirmation dialog box

Of course this panel is never invoked if the user has the settings set to always allow or always deny, but very few do.

When this sucker never presented itself, I naturally thought that I was doing something wrong. Let’s face it, that’s the most probable cause. But after a while I noticed that the problem was specific to Firefox on the Mac. Knowing that SWFObject has had it’s issues with FIrefox in the past, I tried swapping it out for the jQueryFlash plugin, and voilà! How the JavaScript insertion method of the flash content could possibly cause it is beyond me. Honestly I don’t have the JS knowledge or interest to investigate either, seeing as I had a solution.

With SWFObject 1.5 there was a problem causing the stageWidth and stageHeight to be 0 for a certain time after the movie was loaded. That might be relevant in this case as well, but the microphone dialog was supposed to open long after the movie was fully loaded. That kinda rules it out.

So now you know. Don’t spend an entire night on this, like I did.

Get the Flash plugin for jQuery here:
http://jquery.lukelutman.com/plugins/flash/

SlowLoader – Easy bandwidth simulation util for Flash

Posted in Freebies, General thoughts on January 6th, 2010 by Øyvind – Be the first to comment

Today I was working on a project with real strange issues related to the duration of load operations. I decided to throw together a class that would enable me to throttle the download speed of the Loader class when used locally. Simply strangle the bandwidth by entering the desired speed in the load method and you’re good to go.


Download SlowLoader.as

It works very much the same way as the Loader class with the only difference being that you add your event listeners directly to the SlowLoader instance instead of the contentLoaderInfo instance of the Loader instance. Other than that it dispatches the same events as the Loader class does so it should be fairly simple to swap it for a regular Loader when you’re done. I’ve also included and example class. Here’s an excerpt of it:

?View Code ACTIONSCRIPT3
1
2
3
4
var l:SlowLoader = new SlowLoader();
l.addEventListener(ProgressEvent.PROGRESS, _updateProgress);
l.addEventListener(Event.INIT, _showImage);
l.load(new URLRequest("file.jpg"), 512, 0.9);

NOTE: SlowLoader was developed for my own use, which means that it dispatches AILoggerEvents for printing log messages from it. AILogger is also included in the ZIP file and you can read more about it here. If you do not wish to use it, feel free to strip these lines out of the class.

AILogger 1.1.2 – bugfix

Posted in AILogger, Adobe Flash on June 11th, 2009 by Øyvind – Be the first to comment

AILogger har been updated to version 1.1.2. This fixes a bug when logging the same item 3 times or more.