Quick fix (CTRL+1) in Flash Builder 4 - apache-flex

What is the purpose of quick fix in Flash Builder 4? I have tried using it to auto create event listener functions, class methods or properties, local variables etc but none of these work. Does this functionality only exist in FDT? If so what does quick fix do in FB4?
For example:
myEventDispatcher.addEventListener(SomeEvent.EVENT_TYPE, myEventHandlerFunction);
Using FDT, I would highlight "myEventHandlerFunction", press CTRL+1 and a menu appears with several fix options, the first being create event listener "myEventHandlerFunction" in class "MyClass"
However in FB4 pressing CTRL+1 or even selecting quick fix from the right click menu doesn't do anything.

Yes, this is an FDT only Feature!
It's one of the biggest reasons for me to use FDT over any other tool. Quick Fixes rock!!

Related

Debug JavaFx with a tool like FireBug

Is there a tool like FireBug (hover and get information about HTML and CSS) to see what is active in a JavaFX scene?
Try Scenic View – James_D
Scenic View is a JavaFX application designed to make it simple to
understand the current state of your application scenegraph, and to
also easily manipulate properties of the scenegraph without having to
keep editing your code. This lets you find bugs, and get things pixel
perfect without having to do the compile-check-compile dance.

Displaying Actionscript Documentation in Eclipse

This is probably a very basic question, but how does one enable the actionscript documentation to appear properly in Eclipse? For example, if you hover over addChild, the ASDoc view brings up the class hierarchy with flash.display.DisplayObjectContainer.addChild(child:DisplayObject):DisplayObject, but does not give any of the details, descriptive text, parameters, etc. If I write my own documentation using the /** */ format, it does appear in there. What have I done wrong? :P
I'm using the Helios version of Eclipse with Flash Builder 4. Thanks!
If you are talking about something like following:
then, it is available in Flash Builder. You might want to try it.

Change icon of Alert buttons

How do I change the icons to Alert buttons like OK, CANCEL etc?
If you look at the source code for Alert there really isn't a lot there once you get past the comments and properties. What I've done in the past is to just copy the Alert class and modify my custom version however I see fit. That way you don't have to deal with the mx_internal stuff. If you are using Flex 4, there is no spark version of Alert, so another thing you can do is create your own spark version, which will give you even more control over skinning your alerts using skins etc. Sounds like a big deal, but it's actually much easier than you'd think (speaking from experience here.)
Just specify the iconClass paremeter of the Alert class. A detailed example can be found here.
You can find a complete source code and application example here

How do I display content assist in flex builder for all classes?

I have a components and classes project library. Within the library, flex builder only seems to display content/code assist options for top level classes (e.g. arguments, Array) but not other classes such as VBox. Also, within the non top level classes, class properties are not provided by content assist.
In my other flex projects in the workspace, content assist works fine.
Any help would be greatly appreciated!
Flex / Flash Builder is often inconsistent in stuff like this; but I have never seen the exact situation you describe.
Have you tried closing down and relaunching Flex Builder?
Have you tried launching Flex Builder with the '-clean' attribute?
Have you tried cleaning your workspace?
Are you sure you do not have a syntax error somewhere causing issues? Are all the classes in the library included in your library class? Sometimes error don't show up if the class is not used, and therefore not compiled into the file SWC.
Did you save your source files? I don't think Eclipse updates its index until you save - so, if you just wrote class X with function Y, but didn't save X.as, then Eclipse won't know what to do with X.Y(...
Sometimes when I've run into the problem you're describing, it's been because FB wasn't able to determine what type of object I was using (for example, obj["toto"] = ?).
Another idea may be to update your version of eclipse ("Software Updates" or something like that under the Help menu).
Finally, there's an annoying issue that happens to me sometimes where the content assist will appear for about half a second, then disappear like the window tried to scroll and lost the pop-up. Do you get anything when you press Ctrl-Space?

How do I set Hotkeys in Flex?

I'm new to Flex and i want to bind STRG+I to trigger a function.
How do i do that ?
Well, there's different things. I haven't personally done it yet, so after checking some Adobe documentation here what I found.
One can use flash.ui.Keyboard class in order to have a full keyboard control for your application. That would mostly require AIR tho, since the hotkeys are quite limited inside a browser.
In the case you're not in AIR, but in the flash player sitting in the browser, you can do it using simple event handling. Here's some nice tutorial how to do it:
http://tutorials.flashmymind.com/2009/02/actionscript-3-keyboard-events/
Hope it helps!

Resources