Focus on key listeners

Posted on August 31st, 2009 by Knut – Be the first to comment

Being a master at getting odd bugs that nobody else gets I just discovered a little issue with adding and removing KeyboardEvents to an application.

My app has a series of forms arranged in steps. The design of one of the forms required keyboard input to be useful. Every form section is added to stage, showed, verified submitted, hidden and then removed from stage before the next one is displayed.

Two steps into this sequence I required key input and could not get it to work without clicking somewhere first. I first thought it was the old focus security fix that was playing up but since I had already clicked a button to show the form I knew the app had focus.

I found that the stage.focus property was set to the last button clicked. This button was the “next” button in the previous form. Since this button no longer was on stage its button events obviously could not bubble to stage.  Doh! So when setting key listeners: always set focus to the item you want to listen to. Or at least something that’s on stage.

stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
stage.focus = stage;

Nature is math.

Posted on August 27th, 2009 by hp. – 1 Comment

And a great reference when you want to create natural curves.
Found Functions

How about a bell-curve?

How about a bell-curve?

How Google can save your ass!

Posted on August 26th, 2009 by Knut – Be the first to comment

analytics

On a recent project we were having server performance issues when the load was high. The server usually performed well, but occasionally the server did not respond as fast as we wanted. Locating the culprit was hard since it was fairly sporadic.

To try and locate the issue we added event tracking using Google analytics to every remoting call. One just before the call, one just after the call completed as well as tracking any errors that might occur. The event tracking at the end of the remoting call included the time the remoting call had taken in milliseconds. Voila! A few hours later and Google Analytics located the bugger for us. Google’s event tracking displays the average time for the call to complete. One of the calls took a lot longer than all the others and was quickly blamed.

ExternalInterface.call("pageTracker._trackEvent", "Remoting", "remotingCallName", "complete", time);

Google Analytics is the dog’s bollocks!

How to load a map form Google’s online service “My maps” with Google map API JavaScript.

Posted on August 20th, 2009 by Thomas – Be the first to comment

Google has a fine user interface for adding pointers to their map in their service “My maps”. But how do you load this into your website?
read more »

Flexible HTML layout with footer positioned at bottom.

Posted on August 18th, 2009 by Thomas – Be the first to comment

This html and css will produce a grid where the footer is positioned at the bottom of the viewport until page content extends the viewport. The footer will then follow after the content end.
read more »

TortoiseSVN - Ignore files which are already versioned

Posted on August 18th, 2009 by Thomas – Be the first to comment

If you accidentally added some files which should have been ignored, how do you get them out of version control without losing them?

read more »

Tweaking an FDT configuration

Posted on August 14th, 2009 by Simen – Be the first to comment

Since FDT has almost all the features of Flash Builder and Adobe really only added new features for people using their horrible Flex framework, most of the guys here at Apt are back with our old friend FDT. The stand-alone install includes all the basic plug-ins (Ant, Subversive etc.) so you’re pretty much good to go.

However even with good defaults, there are still some optimizations that can be done to make FDT even better, Riccardo Bartoli has posted a detailed article on how to configure Eclipse for optimal coding comfort, most of his tips can also be adapted to Flash Builder.

Experiences with flash on HTC Hero

Posted on August 6th, 2009 by Pål – Be the first to comment

Engadget has posted a review of the new Google Android phone, HTC Hero. Seems like a great phone, but the browsing experience with Flash is apperantly not so smooth. Maybie we will need to go back to “Click to activate” (aka. after the Eolas patent) :-)

Read more here:
http://www.engadget.com/2009/07/23/htc-hero-review/

Flash player updated to 10.0.32, with release notes

Posted on July 31st, 2009 by Alexander – Be the first to comment

In response to a very serious security threat, Adobe released a player update yesterday. There were also additional bug fixes, and I’m including the release notes here because they are kind of hard to find, buried in a large PDF file (apologies to Adobe’s legal team if this violates some sort of obscure terms of use):

  • A new read only property Stage.wmodeGPU has been added to the Stage package, which enables content to determine if the user’s environment supports GPU acceleration. When WMODE is set to “gpu” in the HTML for GPU compositing mode, it is not always available; the graphics hardware may not be suitable, or the user may have disabled hardware acceleration. Stage.wmode=GPU will indicate “true” or “false” to indicate the state of mode on the users machine.

The following fixes have been made in this version:

  • The NetStreamInfo.playbackBytesPerSecond API, reports inaccurate values for an H.264 stream. (2261844)
  • Flash Player 10 incorrectly truncates large local shared objects (over 64k). Works correctly in Flash Player 9 (FP-1258/2264159)
  • If an FLV is not cached on disk and the video playhead tries to read from the end of the FLV file, a conflict can happen because the player tries to read data from a wrong location on the FLV file. (2264925)
  • Audio loss rate reported incorrectly in NetStreamInfo for sending and receiving streams. (2283204)
  • When using live Nellymoser audio, audio may not be heard after an hour or so, resulting in a tic-tic-tic from certain users. (2320693)
  • When running uninstall_flash_player.exe on Windows 2000, it fails with error message “The procedure entry point GetSystemWow64DirectoryA could not be located in the dynamic link library Kernel32.dll”. (2322910)
  • FMS 3.5.2 introduced control messages  wrapped around live content messages.  The control messages are getting out of sync in Flash Player and occasionally producing erroneous values from NetStream.info.maxBytesPerSecond such as zero and very below average values. (2323914)
  • Large numbers of dynamically created display objects causes performance issues at shutdown. (2200134)
  • Pasting multiline text into a textfield removes returns from pasted string. (FP-780, FP-932, 2216955)
  • Progressive download video performance issues on machines with 5400rpm hard drives and high density content. Stuttering during each cache write. (2291145)
  • Currently a connection through the TURN server has several initial delays that cause unacceptable application performance. The delays were set to allow time for internal P2P connections to be made before attempting a connection through the TURN server. This was creating unacceptable and unnecessary delays when connecting to external servers. This will remove that delay and make RTMFP applications much more responsive. (2296569)
  • On Google Chrome, enhance plugin installer to support installation without having to close the browser. (2310185)
  • MP4A files streamed using the ‘chunked’ compression format incorrectly throws a NetStream.Play.FileStructureInvalid error (1931663)
  • Progressive download has video performance issues on machines with 5400rpm hard drives and high density content. (2291145)
  • On Vista, FileReference.save can only write files to the Desktop. Now the file chooser is made available to the user for saving to chosen location. (2200900)
  • Loading an abc in two different domains with a vector of the same class causes a TypeError (496633/2352344)
  • Flash Player fails on Mac connecting to FMS 3.X when using RTMPT through NAT router or LoadBalancer. (2344866)
  • System.capabilities.OS returns ‘Windows’  instead of ‘Windows 7′ on Windows 7. (2308938)
  • Active Directory is causing Local Shared Objects to fail when the information is saved on the network location even if the user has “full control” rights. (FP-1050, FP-1358, 2300738)
  • Flash Player MSI fails to install on Vista Admin accounts with 1721 error (2297046)
  • Sometimes Live Instant On fails when subscribing to a live stream. (2295382)
  • On Windows, debugging sometimes fails due to corrupt data passed from AIR to Flex Builder over socket. (FB-16153, 2292083)
  • RTMFP onPeerConnect called on publish for a P2P publisher while there is no subscriber connected. (2283866)
  • For subscriber P2P stream the values for event.info.code and event.info.level are switched when netStream.pause() api is used. (2282158)
  • The time property on the subscriber stream for a P2P connection can become incorrect.(2282098)
  • P2P subscriber stream restarts automatically with publisher when play(false) used. (2282066)
  • Audio and Video playback stops when failed-to-load Sound is played. (2216959)
  • Logitech QuickCam Pro 5000 causes Flash to crash when the webcam is plugged into USB port,  but not active, while browsing a site with Flash. (2357332)
  • Flash Player Crashes when Running a ShaderJob on a Large Image (FP-1845, 2313191)
  • Cannot write log file or mdmp crash log in mapped Active Directory environment. (FP-1050, 2310938).

Stupefyingly inadequate

Posted on July 28th, 2009 by Knut – Be the first to comment

I’m not a fan of the flash IDE or the way its extensions is handled. But here is an extension nobody should need, but you do: Text Case. (Especially if your designer has found the All Caps button in Photoshop) In my humble opinion this extensions functionality should be standard any application that handles text. Thanks Adobe for the stupefyingly inadequate IDE.