mx.managers.PopUpManager stories

I ran into an interesting issue with the mx.managers.PopUpManager the other day, so I thought it would be a good reason to post it here.

I was creating a video player, that displays a video of a screen recording and a video of a webcam recording on the stage, so I thought I’d use the PopUpManager to “show” the component displaying the webcam video … Everything seemed to work fine, except that the video of the webcam recording was “flipped”/mirrored …
Using the normal addChild/addElement methods in my app, fixed the issue straight away.

So if you’re on the Flex SDK team, you might have a look at this

Cheers
This was posted 1 month ago. It has 0 notes.

Parsing your flashVars

It’s been a long long time since I haven’t posted anything on my tumblr, and you’ll probably also notice that most of the links to the demos or source code I posted previously don’t work. I’ll try to fix that as soon as I can. I’ve been quite busy with my new job, which is really interesting and I’ve also been without internet at home for quite a while, but hopefully that should be solved soon.

Anyway, before I slip off topic, I wanted to post this, because this is something I often forget.

When using flashVars in your Flash/Flex applications, you’ll probably end up using different data types : string, number, boolean and so on… just remember that all of these are actually plain “strings”.
Take the following example:

param name="flashVars" value="myString=foo&myNumber=404&myBoolean=true"


In your code, to retreive those values, you’d actually do this (considering this is Flex) :

var parameters:Object = (FlexGlobals.topLevelApplication as Application).parameters;
// In a pure ActionScript 3 application this would be
//
// var parameters:Object = root.loaderInfo.parameters;

// Parsing strings is really easy and works all the time
if(parameters.hasOwnProperty("myString")) 
    var myString:String = parameters.myString;

// Parsing numbers is just the same 
// and even though, the value comes as a string, it will
// be cast to a number without any effort
if(parameters.hasOwnProperty("myNumber")) 
    var myNumber:Number = parameters.myNumber;

// But when it comes to booleans, 
// you'll need to check the value if it was a string

var myBoolean:Boolean;
if(parameters.hasOwnProperty("myBoolean")) {
    if(parameters.myBoolean == "false") {
        myBoolean = false;
    } else if(parameters.myBoolean == "true")  {
        myBoolean = true;
    } 
}

This is not rocket science, but it’s something I always seem to forget,

Cheers.
This was posted 1 month ago. It has 0 notes.

Animated text scrolling in gumbo

Based on this flex example that shows how to set the VerticalScrollPosition of a RichEditableText, I made some tiny changes and I came up with an “animated version” I wanted to share.

The demo is visible here and the source code can be found there

Cheers

This was posted 11 months ago. It has 0 notes.

AFCS Shared Ball

If you want to develop multi user applications, there are a number of technologies available out there, I’m not going to list them all, but recently, I worked with The Union Platform, Red5, and I also had a look at Stratus and AFCS.

AFCS is quite interesting because it provides loads of features “out of the box”, and if I had to develop a “professional” / commercial application, this is probably the solution I would choose.

Anyway, I made a simple “shared ball” application (just like the one that comes with the Red5 samples) and I wanted to share it with you …

Shared ball demo | Shared ball source code

This was posted 1 year ago. It has 0 notes.

enabling the flashplayer plugin on chromium-browser

chromium-browser is the open source project behind Google Chrome (not the OS, but the browser), it’s quite nice but the annoying things about it are :

  • It’s not stable yet, (but it’s getting there)
  • By default, when you launch it all plugins are disabled
Anyway, since I’m always interested in testing/tweaking the stuff I use, I decided, I’d try to get Flash Player working in this new browser, and it turns out to be quite easy :

First, make sure you have Flash Player installed
Next, make a simlink in chromium’s plugin directory :
sudo ln -s /usr/lib/chromiun-browser/plugins/libflashplayer.so ~/.mozilla/plugins/libflashplayer.so
Last thing to make it work, lauch chromium-browser with the —enable-plugins switch (in a terminal or launcher)
chromium-browser --enable-plugins

At this point, you can view Flash content in chromium-browser,

Cheers

This was posted 1 year ago. It has 0 notes.
AS3 only AIR application snippet

This code snippet shows that you can easily “make” a Sprite subclass the main class for an Air application.

This was posted 1 year ago. It has 0 notes.

twup - a simple desktop “app” for twitpic

Share photos on twitter with Twitpic


I made a very simple drag n drop twitpic uploader that can be downloaded here. For the moment, the source isn’t available but I’ll soon add it to my GitHub profile page.

Cheers

UPDATE : The source code is now available here

This was posted 1 year ago. It has 0 notes.

bit.ly for as3

Like everyone who uses the web, I’ve been using the bit.ly “url shortener” a few times.

I wanted to use this in an ActionScript/Flash project I’m currently working on so here it is

Cheers

This was posted 1 year ago. It has 0 notes.

want your gravatar in flash?

I just wanted to use gravatar in a flash project I’m currently working on.

Turns out, it was much easier than I thought.

Just enter the email address your gravatar is associated to (must be valid) and press “Get it”; you can also use the slider to change the size. Click here for the source.

Cheers

This was posted 1 year ago. It has 0 notes.

using gedit and need mxml support?

If you’re using gedit and you need syntax highlighting in MXML files, here’s what I came up with. Enjoy…

Oh yes, I might change the name to gedit_flash what do you think?

This was posted 1 year ago. It has 0 notes.