Scrollbars to full page flash

Sometimes you simply want to summon browser’s scrollbars to scroll your full page, in case of a too low resolution for example.

This great plugin for jquery from think2loud.com handles the problem.

It suggest to use the JQuery Flash Plugin to embed the swf movie, but works perfectly also with the flexbuilder default html template.

Also, I suggest to include jQuery api from a Content Delivery Network, to provide faster access worldwide, like the Google AJAX api library or the Yahoo one.

FLVPlayback finally in Flex

Finally Adobe has published a version of the beloved FLVPlayback that works either in Flash 10 and Flex 3. No more crappy NetStream in Flex! :-)

You have to login with your AdobeID and Agree to some blahblah ;-)

Download here the component - there are also documentation && examples.

 

Have fun

Easy recursion: determine if a component is showing

A good and easy example of a recursive function has come to my mind while replying to this question on stackoverflow.

The problem was how to know is a component (mx:UIComponent) was visible or not, just like Component.isShowing() works in Java. You canno’t rely on the visible property of the UIComponent, you have to check every parent to see if it too is visible.

First step in recursion is to block the basic level. If the component reference is null, it is not visible; if the component we are checking is an Application, it should be visible, according to his visible property (it doesn’t have a parent).

All the other cases should check the property, AND the parent’s property. (If a component isn’t on the DisplayList, his parent will be null, and it will not be visible,  and so for all of his children).


GeSHi Error: GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)

Requesting Webservices in Flex 3

Follows Webservices, simple introduction.

In Flex 3 requesting data is really simple, since you really have to load a well know url which prints out XML (or JSON or whatever).

I assume you have read the introduction, here we are with a url that prints out informations about Cher’s top fans:

http://ws.audioscrobbler.com/2.0/?method=artist.gettopfans&artist=cher&api_key=xxxxxxxxxxxx

What we have to do is load that url with a mx:HTTPService Object and parse the result as XML. Simple, it isn’t?

First: create the HTTPService object:


GeSHi Error: GeSHi could not find the language mxml (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)

and the handlers


GeSHi Error: GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)

GeSHi Error: GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)

And oplà, in the data field you will have the returned xml, ready to be shown in your preferred component!

Tools: Arthropod for debugging

Better than trace or alert, I suggest anyone Arthropod for tracing out debugging information.

It consist in one class to include in your project, and a small AIR app wich contains the console and some easy configuration.

import com.carlcalderon.arthropod.Debug;
Debug.log("My log message");

Supports logging of a lot of types of data: text messages, objects, bitmaps.

Rating: 10 ;-)