Author Topic: FlashDevelop Tricks/Shortcuts.  (Read 7713 times)

Titch

  • Contributor
  • ****
  • Posts: 270
  • Karma: +0/-0
  • Thing with the guy in the place.
    • View Profile
FlashDevelop Tricks/Shortcuts.
« on: Mon, Nov 23, 2009 »
I've discovered quite a few handy shortcuts/tricks using FlashDevelop the cut time and effort when coding, since the documentation for it sucks, I thought I would share some of them here. Feel free to add any of your own, if you have any.

These hints are true of version 3.0.6 RTM, I can't speak for any past of future versions with certainty.

Write overrides faster
When typing out an override if you just type
Code: [Select]
override functionNameAnd then hit space, it generates the override function for you. So simply by typing
Code: [Select]
override update()You get
Code: [Select]
override public function update():void
{
super.update();
}
This is especially useful for overriding functions that take a lot of parameters.

Faster import commands
If you find a file in the project menu and right click and select 'Add to Document' FlashDevelop generates the Embed tag for you. Be warned that this doesn't seem to work for XML files yet.

Abusing Global Classpaths
If you are tired of copying Flixel into every single folder, you can add it to your global classpaths and then access it from any project in FlashDevelop. I don't personally do this because I tend to modify the Flixel source on a per project basis, but if you are confident in your changes it would probably help streamline things a little.

Insert Colour
Very handy menu option listed in the Insert menu. Basically generated a hexadecimal code for any RGB colour in the format 0xRRGGBB, sure you have to put in the AA yourself, but it still can save some time for odd colours.

Useful Keyboard Shortcuts
Cntrl + Enter - Compiles and runs the project.
Cntrl + B - Insert Snippet. Code snippets can save a TON of pointless typing if you take the time to learn them.
F4 - go to declaration of element at cursor location.
Shift + F4 - Go back after jumping to an element
Free cake whippings every day at #flixel on irc.freenode.net.

knivel

  • Member
  • **
  • Posts: 75
  • Karma: +0/-0
    • View Profile
Re: FlashDevelop Tricks/Shortcuts.
« Reply #1 on: Mon, Nov 23, 2009 »
Wow, those are super helpful. Especially the color one. Thanks Titch!

fefranca

  • Guest
Re: FlashDevelop Tricks/Shortcuts.
« Reply #2 on: Mon, Nov 23, 2009 »
Wow thanks Titch I didn't know about embeds and colors, kinda makes me feel ashamed for having used FlashDevelop for so long and never noticing those changes :) I still wish it had organize imports like Eclipse / Flex IDE (maybe it does now and I haven't seen it). About the global classpaths, for a long time I kept my libraries in a global classpath but nowadays like you I would recommend everyone to keep libraries inside the project, things tend to break up with time after libraries change.

Hideous

  • Guest
Re: FlashDevelop Tricks/Shortcuts.
« Reply #3 on: Mon, Nov 23, 2009 »
Also of note is ctrl+shift+1. It's magical! Let's you do loads of things, but right now I can only remember this:

If you enter this (without creating the function first)
Code: [Select]
badassFunction();

and then press ctrl+shift+1 on it, FD gives you the option to generate this

Code: [Select]
public function badassFunction():void
{
}

L_O_J

  • Member
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: FlashDevelop Tricks/Shortcuts.
« Reply #4 on: Mon, Nov 23, 2009 »
Wow thanks Titch I didn't know about embeds and colors, kinda makes me feel ashamed for having used FlashDevelop for so long and never noticing those changes :) I still wish it had organize imports like Eclipse / Flex IDE (maybe it does now and I haven't seen it). About the global classpaths, for a long time I kept my libraries in a global classpath but nowadays like you I would recommend everyone to keep libraries inside the project, things tend to break up with time after libraries change.

You might interested in these plugin(s):

Refactor (should be included in the latest FlashDevelop, just right click on the editor)
AutoFormat Include the handy Alt+Shift+F to remove unused import(s), still dumb sometimes, but most of the time, it gets it right.
Open The Doc not directly related to your problem, but I find this plugin VERY helpfull

nitram_cero (2bam)

  • Contributor
  • ****
  • Posts: 484
  • Karma: +0/-0
    • View Profile
    • 2BAM
Re: FlashDevelop Tricks/Shortcuts.
« Reply #5 on: Mon, Nov 23, 2009 »
Nice and interesting :)
Some I knew (found out by mistake about the override the other day  :))

I shall use global classpaths from now on, and check out the ctrl+shift+1 thing.

Thanks!

jeanpier

  • Guest
Re: FlashDevelop Tricks/Shortcuts.
« Reply #6 on: Mon, Nov 23, 2009 »
Very useful tips!

One more think about the "magical ctrl+hift+f1"

It's works not only with functions also with variables, so if you type some word inside your code you can add that word automatically in a private var.
Example:
...
lives +=1;

ctrl + shift + 1 on lives will show this:

- Declare variable
- Generate function

and add this to the top of the class and positioning the cursor there:

private var lives;

nice... I discovered some time ago and I can't live without it ;)

fefranca

  • Guest
Re: FlashDevelop Tricks/Shortcuts.
« Reply #7 on: Tue, Nov 24, 2009 »
Thanks for the plug-ins, very handy!

It would be good to put this discussion on the Wiki for the future generations / post-apocalyptic survivors...