Category Archives: Flex 3

Exotic Flash Builder 4 Tips and Tricks

The Flash Builder is built on Eclipse, you know, hence many of Eclipse stuff will naturally comply, also, these tips will mostly work the same in Flex Builder 3 and Eclipse.

-> Browse to any file or directory

It’s essential to be able to easily browse to the resource you’re currently looking at. There should have been a built in way to do this.

1. Click on, Run –> External Tools -> External Tools Configuration (Alternatively, click on the Favorites icon and select "External Tools Configuration")

image

2. Inside the "External Tools Dialog" -> Select "Program" -> click on the "New Launch Configuration" icon.

image

3. Inside the "Main" tab (Default) set:

  • Name: Explorer
  • Location: c:windowsexplorer.exe
  • Working Directory: c:windows
  • Arguments: /select,"${resource_loc}"

image

4. Go to the "Build" tab and uncheck "Build before launch"

image

5. Go to the "Common" tab, look for "Display in favorites menu" and check "External Tools"

image

You can now select any file or directory from the “Package Explorer” and browse straight to it’s location in windows explorer.

image

-> Extending with batch files – kill all IE processes

Flash Builder 4 can be extended using batch files (Shell Scripts on the Mac). This example uses a batch file to kill all opened IE processes before launching a new debug session.

There are a few reasons to debug a Flex app in IE. Firstly, some users still use it, and secondly I don’t want the precious tabs that are opened on my other useful browsers to be bothered. Occasionally, IE processes are left running in the background even though debug session was ended. Sometimes I simply didn’t closed the browser before running a new session. Both of these cases lead to the consuming of needed memory and slows down the system.

A batch file is merely a text file with a .bat extension.

  1. Create a new text file.
  2. Edit this file with any text editor –> Copy paste this line into it: taskkill /F /IM "iexplore.exe"  -> Save this file as kill_iexplore.bat (Double clicking on this file will kill all IE processes)
  3. Click on, Run –> External Tools -> External Tools Configuration
  4. Inside the "External Tools Dialog" -> Select "Program" -> click on the "New Launch Configuration" icon.
  5. Inside the "Main" tab (Default) set:
    Name: Kill Internet Explorer
    Location: c:kill_iexplore.bat
    (depending on were the file is saved)
    • Go to the "Build" tab and uncheck "Build before launch"
    • Go to the "Common" tab, look for "Display in favorites menu" and check "External Tools"

    – In Order to kill all IE processes before launching a new debug session

    1. Right-Click on the flex project –> Select “Properties
    2. In the properties dialog select “Builders” –> Click on “Import” and select “Kill Internet Explorer” from the list.

    image

    -> Link with Editor

    This one is very helpful but easily overlooked, it’ll make the Package Explorer and the editor view synchronized.

    Click on this icon to make your life better.

    image

    -> Some Important shortcuts (For Mac CTRL == CMD, ALT == Option)

    Ctrl+Shift+T Find any class SDK included
    Ctrl+Shift+R Find any resource/file (wont find SDK classes)
    Ctrl+3 Finds everything, literally everything – files, commands, views (Amazing, try it, use it)
    Ctrl+Alt+Up/Down Duplicate a line or a block of code
    Alt+Up/Down Reorder a line or a block of code
    Ctrl+D Delete a line or a block of code
    Ctrl+Shift+L+L Open Configuration
    Ctrl+K Find next (like F3)

    Less important shortcuts

    Ctrl+O Current class outline
    Ctrl+Shift+G Finds all references in the workspace
    Ctrl+Shift+L Shows all shortcuts (key binding)
    Ctrl+M Maximize the selected view
    Ctrl+J Quick Search without the search dialog (click ESC when done)
    Ctrl+Shift+X To upper case
    Ctrl+Shift+Y To lower case
    Ctrl+I Auto indent selected code

     

    P.S. Why exotic?! It made you look didn’t it. And beside, it is somewhat exotic.

    P.S.S. At first I thought about writing a short post with only the first tip, but, thinking about it, I think I’ll make this an ever updating page. So if you have any other tip you like to share please write about it in the comments.

    HTML 5 vs Flash vs SilverLight

    This is by no mean a full technical comparison between these technologies, just a chat between 2 geeks. One is a skeptic backend dude ;) and the other one is yours truly, a GUI guy.

    It started with an email from Eli (the backend dude)  titled “the Next big thing”?

    Elihttp://www.chromeexperiments.com/ , RIP Flash. Long live HTML 5 + JavaScript.

    Guy: This is old…  Let me know when Chrome will reach 99% of desktop computers.

    Eli:  HTML 5 is old? LOL.  FYI, despite the fact that the spec is far from being finalized, browsers with sparks of HTML 5 support count among them ie8, ff3, opera and safari.

    Guy:  Old news, that is.  HTML 5 is only started to get supported.   HTML 5 + Javascript has a small subset of what Flash 10 can offer.  By the time HTML 5 will be a standard Flash 12 will reach 90%

    Eli:  Yeah, yeah, I’ve heard the same thing about java applets about a decade ago… ;)  Seems like the simplicity of markup languages makes them the long distance runners

    Guy:  Exactly, Flash has succeeded where Java failed. Flash has a lot of issues, but currently (and in the few coming years for sure) it’s the most powerful and available runtime.  HTML + Javascript is far from simple and cause huge problems for complex applications.

    Eli:  Flash is mostly used to fill gaps in HTML, not to solve the huge problems in the complex applications the web is made of, isn’t it?

    Guy:  This is what Adobe aim to solve with Flash, to be the ultimate platform for creating and running RIA (Rich Internet Applications). Still, a lot of RIAs are written in AJAX (Javascript+HTML), which, with the aid of solid and powerful frameworks like jQuery become reasonable in some cases. Lately Google, which already have a lot of RIA tools, is trying to change the game with its Chrome browser and OS. The Chrome browser is equipped with a much faster JavaScript engine that enables what we can see in chromeexperiments.com. Microsoft is also trying to be a player in this space with its new SilverLight runtime.

    Eli:  Yet, the idea of basing the web on some proprietary browser plug in is doubtable. Epic fall of java applets and endless annoying ActiveX bullshit are just a couple of examples. IMHO, the shortcoming of this approach is missing the idea that The Web is more than “screenfuls of text and graphics” ©. Layout engines, however, are here for more than a decade and markup languages – for ages, proving themselves in taking the web into the places no one was thinking then about.

    P.S. The only thing Adobe aims is profit.

    P.P.S. I love holy wars.

    Guy:  The proprietary thing is indeed an issue, it prevents Flash from being accepted in some areas of the web and by some users. E.g. the Wikipedia video project uses HTML 5 video, they can’t use anything that is closed. What prevents Flash from being open-sourced is that it contain 3rd party patent not owned by Adobe. Adobe is already trying to appeal to the open source crowed with the opening of some of its IP http://opensource.adobe.com. IMHO they might completely open the Flash runtime if and when it’ll be pushed to the wall by Microsoft and its new SilveLight (talking about proprietary ;).

    Java and Active-X are completely different stories, each had its own reason to fail. Partially and shortly, it is too difficult to create a Java applet and its far from appealing to a designer. Active-x has no sandbox, hence it has a lot of security issues, and also runs only in IE.

    HTML was created to display text and images with basic layout, Javascript was added to enable simple interactivity, no one dreamt it can be used the way it’s done today. Only with the maturity of the browsers and with specialization of web developers, these king of RIAs could have been created. Yet it still pushes the tech to it limits.

    The HTML 5 standard will be adopted relatively fast, but we’re still talking in years. Even with the Chrome JS engine (V8), Javascript can’t match the power of languages like Actionscript 3.0 and C#. Javascript 2 is somewhere in the very distant future. HTML 5 biggest improvement is the support for media (video/audio). But, it still can’t compete with Flash and SilverLight media abilities, in terms of playback and deployment.

    HTML 5 is nice but the main holy war is between the reigning RIA world champion which is Adobe Flash and the challenger which is Microsoft SilverLight. There is much to be loved about this holy war, since it pushes the technologies forward and the biggest winners are us, the developers and the users.

    (I’m talking about hard-core RIA, not some lightbox image gallery which is still preferably done in HTML)

    P.S.  Adobe isn’t a saint, but, everyone want to make some profit, even google, even us as I recall ;) If you gain it morally and also use it to make something like the web better, than it’s fine with me. 

    P.S.S aforementioned.

    The biggest terrorists in the world are… Flex bloggers

    Adrian Parr, a Flex blogger mostly known for his post listing of AS3 frameworks got hacked by some political lamers. The whole blog is replaced with common and lame hacker page. The allegedly hackers came from this Arab security forum, m4r0c-s3curity.cc.

    What is the relation of this blog to your “war on terror”?! Leave your political BS where it belongs.

    Technologies never cry

    I’ve been thinking lately, will I leave my beloved Flash and jump to the newer SilverLight?! After all that Flash did for me, made me the man I am today, got me this cool job I’m happily manage to wake up (almost) every morning to go to. Will I just leave that all behind? I know SilverLight is still underage but it might become very sexy eventually. What if it’ll become the better technology, can I just dismiss all of our past together, me and Flash, that is? I might also have an easier time pushing SilverLight then Flash, in my area. I’m defiantly gonna play with the real SilverLight (ver 2.0) when it’ll come out, that might be fun.

    I believe a lot of us Flashers share the same feeling. Lately this has been recognized even by our native Adobe branch (Israel) which was ignoring us, flashers, completely till now. They have set a Flex3 / Air conference for tomorrow (25.2.2008), which is the exact same day that Microsoft is doing her local Silverlight conference. As for myself, I’m gonna jump between conferences, have the best of both worlds, eat the cakes and have it too, they’ll probably be a lot of cakes :)

    Again, I would like to give Microsoft credit for it’s SilverLight showoffs, even though it’s funded with lots of MS money. The latest is the Microsoft Virtual Events. For me, it didn’t worked in FireFox, gave me some error. Tried in IE7, although it was a lengthy load again (more then 8 mega), the experience was not that good, with lots of too long delays and un-intuitive behaviors and eventually some Javascript errors. maybe it’s mainly a matter of design and not the technology to blame, but this is a Microsoft website, if they don’t know how to use their own technology, then who will.

    Compare it with one of the latest Flex showoff, funded with developers passion.

    What I would really don’t like to see is that MS will win this fight even though it’ll provide the inferior technology. We’ve all seen it happen in the past, but, I still believe, this time the game is different. If they can really excel Flash then they should be the winners, but, as objective as I can possibly be, I believe they’re still far from it.

    I would like to see both of these technologies nurturing each other with the competition. I’m not sure that Flash/Flex would have received such frantic amount of updates in such a short time if it wasn’t for MS upcoming competition. So, so far it’s been great and it’s gonna be even more interesting.

    P.S. Maybe this guy can already convince you to make the move to SilverLight :D