Archive

scrollPane background customization – as3

I was trying to customize a scrollPane component (as3) and ran into some difficulties, I wanted to change the background of the panned area. The default background is kinda gray with rounded corners, I wanted it dark and strait corners.

scrollPane default backround

After far too much time searching Adobe’s Livedoc (what a shame, didn’t find the answer there), and reading countless posts, I eventually found the answer via Flash Help Panel.

scrollPane customized backround

Apparently the only way is to change the default skin of the component, to do that you simply prepare a MovieClip to serve as skin and give it linkage name, then set the component instance style to use the skin you prepared, like this:

aSp.setStyle( "upSkin", newSkinClip );

upSkin is the default skin class, and I’m setting it to use the skin I made.

Adobe really should find a way to make those livedoc easier for use and orientation, it takes too long for pages to load, and I keep finding my self clicking in loops..

window.onblur – strange behavior on browsers

About a year ago I posted an example for using externalInterface to start and stop sound inside flash, based on focus and blur events in the window. After recently receiving several comments and questions about strange behavior on different browsers, I decided to test the script on the browsers I have on my Mac and PC.

Originally I was using the onFocus & onBlur events, attached to the window object, I found out that each browser can deal with these event when attached to a different object, I started testing which object works for each browser, and added browser sniffer for the listener definition, these are the objects for each browser:

Browser Object
Safari, Opera, Omniweb window
Firefox window.document
IE7 document.body (* partially working)

And here are the results:

Mac OS X 10.5.2 Leopard
Safari All working fine.
Firefox onblur is only fired when loosing focus to another Firefox window, not to another app.
Opera All working fine.
Omniweb All working fine.

Windows XP
IE7
  1. With Tabbing enabled: onblur is fired upon focus event, no event corresponds with blur.
  2. With Tabbing disabled: onblur fires properly if clicked on title area, once clicked on body (content of page) behaves the same as with Tabbing enabled..
Firefox onfocus is fired twice when clicked on body, once when clicked on browser title.

The situation on Mac seems to be much better than on Windows XP (sorry, I did not test Vista, so if someone can try this on Vista and send me the results – it would be great), currently both IE7 and Firefox on XP have strange behavior.
With IE7 it gets even weirder, when IE7 has Tabbing enabled, it can’t handle onblur event for body object, while without tabbing, onblur works if clicked on the browser title area, once clicked inside the window (Html body) “something” goes crazy and both onfocus and onblur are fired together upon focus event.

Here is the test page, you will find the events I tested for IE7 commented in the page source.

Does anyone know a way around this strange behavior on IE7 and Firefox?
any way to make this listener compatible with all browsers?

New year upgrades

After many troubles with my (old) hosting provider, along with the new year I finally moved to a new one, hopefully no more down times and mail issues..I grabbed the opportunity and also upgraded the blog’s Wordpress to the latest version, and customized a K2 theme to fit my orange look (this is really simple, K2 supports customized style sheets on top of the standard css, so you do not have to deal with many definitions – change only what you want).I will probably fine-tune the theme during the next couple of weeks, and when I’m done – I will probably change it completely : )

Wordpress blog in flash – in SWX contest

I was going through the SWX PHP contest entries, and was so happy to find an entry under the API category for the Wordpress platform by Benjamin Wiederkehr, it is something I was considering to do my self ; ), and can be really handy for small personal sites or blogs that prefer a customized experience over the standard Html themes – portfolios, galleries, open for commenting – you see the potential..These APIs are best demonstrating the power of SWX, allowing us – flash programers to expand our possibilities and offering without messing with server-side too much – just what Aral was talking about.cool.

Hunting swf memory issues – take ‘em down!

In one of my current projects I’m experiencing a ‘memory waste’ issue, after a basic efficiency re-writing did not solve the problem, I began reading about how flash handles scope chains and memory, and found this very interesting article ‘Scope Chain and Memory waste in Flash MX‘ by Timothée Groleau.Now I am going to re-attack the issue with better understanding of what to look for. thanks Timothée.Another good resource to refine your coding practice is Adobe’s AS2 best practice article.Be ware, avoid driving after reading these two : )

Cool recycled MacbookPro stand, do it your self!

Few days ago my good old 17″ Studio Display monitor died after almost 9 years of devoted service. It’s been about two years that my main computer is a MacBookPro, and the old G4 is nothing more than a file server & itunes jukebox.One thing that I wanted to change for a long time is the angle of the display when I am working with my portable Mac on a table. There are few professional solutions out there, mostly by Griffin, but I wanted something more practical, and yes, cheeper..Here I saw an opportunity – the cool stand from the CRT display, that was never equaled in any model by any brand (at least that I saw) can serve just this purpose, lifting the portable and making air flow easy for cooling the burning machine, tilt-able and even aesthetic.macbookpro_stand_1.jpgmacbookpro_stand_3.jpg
If you want to try this at home, here’s a little tip: after disassembling the stand from the old monitor, you should change the spring direction, to support the portable weight which has the opposite direction from the CRT. to do that, remove the center screw, and the screw that holds the spring, remove the white anchor, and rotate the top of the stand, front to back.Put the white anchor back, and now the string will be facing the other side of the stand.macbookpro_stand_4.jpg
Now hook the spring on the plastic handle. that’s it – you’re done.

Flash 10 Sneak Peek looks promising

I just had the time to watch what was presented in the MX Chicago 2007, apparently much.. hmm, Adobe’s 3D api looks attractive, I guess using intrinsic classes is shorter (20 lines?!) and easier to migrate than the current 3rd party packages, and according to this vid, the performance will be great.Next-sneak-peek.jpg
I am also exited about the Advanced Text Layout Support coming in version 10, take a look at this vid, thanks again Aral. After years of neglecting RTL languages (that is Right To Left writing direction – Hebrew and Arabic), and countless crippled hacks that never really worked – finally a solution seems to work good.RTL-flash.jpg
And this makes me very happy.
3D-transform-flash.jpg

Sony Bravia has a great 3D interface in flash

Sony Bravia new site (http://bravia.sony.eu/bravia.html) is a great example of 3D navigation system in flash, bringing a new and fresh feel to site navigation, worth the long loading.
sony_bravia_3D_03.jpgsony_bravia_3D_02.jpg
Using keyboard arrows is so easy and intuitive for controlling the 3D menu, it’s a shame the actual sections content is not arranged for keyboard control and requires “traditional” mouse interaction. But it is very cool eventhough.

SWX PHP – takes only 3 minutes to set up

I am working on a new project that requires serverside development, using Apache, MySQL and PHP. However I didn’t want to change my current personal webserver configuration – the one that comes with OS X, and I remembered my friend Eran’s tip about MAMP – an independent standalone webserver, but never got to download it.Then, few days later, Aral released SWX PHP 1.0 (remember SWX?), and offers a very convenient way to start playing with SWX in minutes, using no other that a MAMP bundle, already configured with a useful Start Page linking to the SWX Service Explorer & Data Analyzer , can’t be simpler than that.. try it out!Great work Aral! I liked the Screencast explaining how to set it up, Aral simply explode you with knowledge : )
swx.jpg
I also find the SWX icon very amusing in my dock..

FIVe3D – a new Flash ActionScript 3D package

five3d.jpg
A new open source vector based 3D animation engine for ActionScript called FIVe3D has recently been shared by Mathieu Badimon. Thanks Mathieu!It is a ActionScript 2 classes package, enabling 3D rotation and position control over objects such as movieclips and text fields.For setting up a simple 3D environment, with simple objects and basic interactivity it is indeed fast and pretty simple, as described by the author. I am sure in few months it will pick up some more advanced functionalities, we should be proud that such exiting initiatives are emerging in the open source sphere.I was impressed by the thorough (and beautiful..) documentation he provides with the source code, neatly packed in a pdf file. that’s the way!