1

Is there any way to create foldable regions of code in ActionScript 3 (read this as Adobe Flash CS3 built-in editor). I'm looking for something like in MS Visual studio so that I can do:

#region "Event handlers"

... big list with methods here

#end region

Any ideas?

Jacob Poul Richardt
  • 3,145
  • 1
  • 26
  • 29
Perica Zivkovic
  • 2,610
  • 24
  • 32

6 Answers6

4

In the Flash IDE, select the code to fold and right click. A menu will appear with the following options: Collapse Between Braces | Collapse Selection | Collapse Outside Selection | Expand Selection | Expand All.

With that said, you should seriously consider a 3rd party ActionScript development environment, such as FlashDevelop, a very well thought out alternative. It's a massive pain developing in the Flash IDE.

http://www.flashdevelop.org/community/viewtopic.php?t=202

Community
  • 1
  • 1
spender
  • 117,338
  • 33
  • 229
  • 351
  • yeah ... flashdevelop rocks ... it will make you rich, beautiful and happy ... well, at least happy ... :) – back2dos Jul 23 '09 at 11:49
  • FlashDevelop is really good. Even if you need to use the Flash CS3 IDE (e.g. you're working with FLA files produced by artists), you can set things up so you edit the .as files FlashDevelop and compile using Flash CS3. – Selene Aug 13 '09 at 19:57
1

In the Flash CS5 IDE, select the code to fold and right click. A menu will appear with the following options: Collapse Between Braces | Collapse Selection | Collapse Outside Selection | Expand Selection | Expand All.

In Flash CS3, there was not really anything like that. CS4 introduced conditional compiling, not really what you are looking for; but it does not get any closer.

Like already suggested, I would suggest using FlashDevelop. It has some folding options, but event more importently it has intellisense and automatic code generations. And it is free.

Community
  • 1
  • 1
Jacob Poul Richardt
  • 3,145
  • 1
  • 26
  • 29
1

Flash CS4 has a code folding feature. Just select/highlight a few lines of code and click the - icon on the left.

Jeremy White
  • 2,818
  • 6
  • 38
  • 74
1

Flash CS3 calls it "Code Collapse".

On the editor toolbar:

Flash CS3 toolbar in editing mode http://img19.imageshack.us/img19/4558/picture23s.png

The buttons with facing arrows will collapse code between braces or the current selection. The button with arrows going out will expand code.

You can also find the commands in Edit->Code Collapse, which shows the keyboard shortcuts. Or you can right-click on the code you wish to collapse to get a menu of various actions, among them, collapse options.

Community
  • 1
  • 1
Selene
  • 1,917
  • 2
  • 13
  • 17
1

If you are using FlashDevelop it has a terrific solution. You can create regions to conclude your code like this:

[-]  //{ start region
          your code here...
     //} end region

and expand like methods
[+]  //{ region Public methods
Tokar
  • 649
  • 8
  • 11
0

sth. like #region would in CS5 be:

//Controlls
{
      public var IWaffe:MovieClip;
      public var IWaffeD:MovieClip;
      public var ICursor:MovieClip;
      public var IFeuer:MovieClip;
}

and then you can use the collapse brackets button.

Vinz
  • 1