Understanding Flex preloader internal

July 24th, 2009

It is possible customize the default preloader of Flex. It’s also possible to load extra assets within the preloading sequence, such as external graphics, xml files or sounds. Here’s how it works.
Read the rest of this entry »

FlexBuilder neat keyboard shortcuts

March 27th, 2008

I’ve seen this post long time ago on robrusher’s blog and found it very useful.

It seems that the original post doesn’t exist anymore, so I will post it again here to keep this goodie in sight. All credits go to whoever wrote this in the first place.

It should work with both FB2 and FB3.

Copy a line:
Place the cursor on desired line or select multiple lines.
Press and hold the Ctrl + Alt keys. Use the up/down arrow keys to duplicate line(s).

Move a line:
Place the cursor on the desired line or select multiple lines.
Press and hold the Alt key. Use the up/down arrow keys to move the line(s).

Delete a line:
Place the cursor on the desired line or select multiple lines.
Press the Ctrl + D.

Indent Text:
Place the cursor on the desired line or select multiple lines.
Press the Tab key to increase the indent.
Press and hold the Shift key. Use the Tab key to decrease the indent.

Code Complete:
If you are in a tag and just want a list of it’s properties. Press the Ctrl and SpaceBar.
If you start typing, AS or MXML, and press the Ctrl and SpaceBar it will complete the property/method if there are no other possible matches otherwise you get a list.
From the list, use the up/down arrows to highlight an item and the Enter to insert the item.

Insert Comment Block:
Select text and press Ctrl + Shift + C. (good for both AS and MXML)

Insert an ASDoc Comment:
Place the cursor where you would like to place a comment and press Crtl + Shift + D.

And for those of us that are annoyed by import lists that are out of order:
Press Crtl + Shift + O to organize the imports in an AS file in case sensitive order.

Code Navigation:
Below the Navigator View on the left-hand side is the Outline View. From here you can quickly jump to tags in the current file. Type a letter and it will jump through those tags that are visible.
Double click on a component in the outline and it will open that file.
Hold the Ctrl and mouse around an AS or MXML file. Notice that many things turn into hyperlinks that will take you to the source for that item. i.e. Ctrl + click a component to open the component file, Ctrl + click a variable or a method, etc…

Switching Between Open Files:
Press and hold the Alt key while pressing the left or right arrow key.

Switching Between Views:
Press and hold the Ctrl key while pressing the F7 key.

Uppercase/Lowercase:
Converting selected text to lowercase or uppercase press Ctrl + Shift + Y or Ctrl + Shift + X respectively.

Brace Highlighting:
Place the cursor after either the open or close to see the opposite one highlighted.

Here are the “official” shortkeys found on Adobe’s own website :

Control+Left Arrow    Start of current word (Option+Left Arrow on Macintosh)
Control+D    Delete Current Line (Command+D on Macintosh)
Control+Shift+T    Open Class Browser (Command+Shift+T on Macintosh)
Control+j    Incremental search forward (Command+J on Macintosh)
Control+Shift+J    Incremental search backward (Command+Shift+J on Macintosh)
Alt+Up Arrow    Move line up (Option+Up Arrow on Macintosh)
Alt+Down Arrow    Move line down (Option+Down Arrow on Macintosh)
Control+Up Arrow    Scroll up (Command+Up Arrow on Macintosh)
Control+Down Arrow    Scroll down (Command+Down Arrow on Macintosh)
Control+f    Find (Command+f on Macintosh)
Control+Shift+Enter    Insert blank line above (Command+Shift+Enter on Macintosh)
Control+Alt+Up Arrow    Copy line up (Command+Option+Up Arrow on Macintosh)
Control+Alt+Down Arrow    Copy line down (Command+Option+Down Arrow on Macintosh)
Alt+/    Word completion (Control+. on Macintosh)
Control+Delete    Delete next word (Command+Forward Delete on Macintosh)
Control+Backspace    Delete previous word (Command+Back Delete on Macintosh)
Control+Shift+Delete    Delete to end of line (Command+Shift+Forward Delete on Macintosh)
Control+l    Go to line (Command+l on Macintosh)
Control+Shift+l    Open keyboard shortcuts (Command+Shift+l on Macintosh)

Enjoy.

La cigale et la fourmi version Québécoise

October 14th, 2007

J’ai lu ceci sur le blog de Richard Martineau, j’aimerais le partager ici… C’est une vision intéressante de la société québécoise.

La cigale et la fourmi

Je viens de recevoir cette fable par courriel…

LA CIGALE ET LA FOURMI, VERSION CLASSIQUE

La fourmi travaille dur tout l’été dans la canicule; elle construit sa maison et prépare ses provisions pour l’hiver. La cigale pense que la fourmi est stupide; elle rit, danse et joue tout l’été.

Une fois l’hiver arrivé, la fourmi est au chaud et bien nourrie. La cigale grelottante de froid n’a ni nourriture ni abri et meurt de froid.

FIN

LA CIGALE ET LA FOURMI, VERSION MODERNE QUÉBÉCOISE

La fourmi travaille dur tout l’été dans la canicule; elle construit sa maison et prépare ses provisions pour l’hiver. La cigale pense que la fourmi est stupide; elle rit, danse et joue tout l’été.

Une fois l’hiver arrivé, la fourmi est au chaud et bien nourrie. La cigale grelottante de froid organise une conférence de presse et demande pourquoi la fourmi a le droit d’être au chaud et bien nourrie tandis que les autres moins chanceux comme elle ont froid et faim.

La télévision organise des émissions en direct qui montrent la cigale grelottante de froid et passent des extraits vidéo de la fourmi bien au chaud dans sa maison confortable avec une table pleine de provisions.

Les Québécois sont frappés que dans un pays si riche, on laisse souffrir cette pauvre cigale tandis que d’autres vivent dans l’abondance.

Les associations contre la pauvreté manifestent devant la maison de la fourmi. Les journalistes organisent des interviews demandant pourquoi la fourmi est devenue riche sur le dos de la cigale et interpellent le gouvernement pour augmenter les impôts de la fourmi afin qu’elle paie “sa juste part”.

En réponse aux sondages, le gouvernement rédige une loi sur l’égalité économique et une loi (rétroactive à l’été) d’anti-discrimination.

Les impôts de la fourmi sont augmentés et la fourmi reçoit aussi une amende pour ne pas avoir embauché la cigale comme aide. La maison de la fourmi est préemptée par les autorités car la fourmi n’a pas assez d’argent pour payer son amende et ses impôts.

La fourmi quitte le Québec pour s’installer avec succès en Alberta.

La télévision fait un reportage sur la cigale maintenant engraissée.

Elle est en train de finir les dernières provisions de la fourmi bien que le printemps soit encore loin. L’ancienne maison de la fourmi devenue logement social pour la cigale se détériore car cette dernière n’a rien fait pour l’entretenir. Des reproches sont faits au gouvernement pour le manque de moyens. Une commission enquête est mise en place, ce qui coûtera 10 millions.

La cigale meurt d’une overdose; les médias commentent sur l’échec du gouvernement à redresser sérieusement le problème des inégalités sociales.

La maison est squattée par un gang de coquerelles.

Les coquerelles organisent un trafic de marijuana et terrorisent la communauté.

Flash MC’s strange behavior…

October 4th, 2007

While working with a Flash player 9 / AS3 project, I discovered some very strange behavior related to the movieclip playback.

In short, when there is a mc on the timeline and you remove this mc or change its child index, and than you move the playhead one (or any) frame back (gotoAndStop(1) if the playhead was at 2), Flash will recreate another instance of the mc.

Here’s the code:


var mc1:MovieClip = new MovieClip();
mc1.graphics.beginFill(0xff0000);
mc1.graphics.drawRect(300, 50, 50, 50);
addChild(mc1);

var mc2:MovieClip = new MovieClip();
mc2.graphics.beginFill(0xff0000);
mc2.graphics.drawRect(400, 50, 50, 50);
addChild(mc2);

mc1.addEventListener(MouseEvent.CLICK, _mc1);
mc2.addEventListener(MouseEvent.CLICK, _mc2);

function _mc1(event:MouseEvent):void
{
gotoAndStop(30);
test.x = 300;
setChildIndex(test, numChildren-1);
//removeChild(test);
}

function _mc2(event:MouseEvent):void
{
//try this
gotoAndStop(29);
//or this
//gotoAndStop(31);
}

For this to work, you need to have a mc called test place on your timeline lasting at leat 30 frames.

You can see it in action here: (click on the left red square first and than the right one, and see the green square being duplicated)

Source code is attached.

So the work around is to never use the timeline in your projects except for animation-only MCs. Pretty strange though. I wonder if changing the depth of a MC in Flash 8 does the same thing…

Source file for the strange behavior of Flash 9.

Me

October 4th, 2007

Hi people,

Few words on me.

I am a 27 years old male living in Montreal.

I made this blog to talk about things that matter for me. Sometime it will be in English, sometime en Français. By writing this blog, I am not trying to make a point. I just want to share some thoughts and technical stuff with people.

I am a Flash programmer. I started playing with Flash since version 5. In the future, I will post some Flash-related posts on my blog.

In meanwhile, enjoy.

W.

Hello world!

October 1st, 2007

Hello world, welcome to my blog.