Archive for August, 2010

Flex Builder Key Assist

Use following key shortcuts, as they help in faster code development
1) select the code line or lines, then Ctrl + Alt + Up Arrow Key or Ctrl + Alt + Down Arrow Key
— copy the selected line or lines of code on upside/downside of the selected line or lines

2) Ctrl + O
— opens the window with all variables , functions and controls in current .mxml or .as file

3) Ctrl + Shift +R
— opens the window with list of all files of all open projects in the workspace of Flex builder
— very useful if you remember the filename of the file which  you want to open.

4) Ctrl + Shift +F
— opens the search window and search throught files of all open projects in the workspace of Flex builder

Enjoy great coding of Flex !!I will post some more in future. You can also find key assist in Flex builder by Ctrl+Shift+L.

Advertisements

Leave a comment

Error: Constructor functions must be instance methods in Adobe Flex

Error: Constructor functions must be instance methods

One cause of the error message : ‘Error: Constructor functions must be instance methods’ in Flex can be caused when you have a component with the same ID or the variable with same name as the Application.

So if you have a file hitTestPoint1.mxml and a component <mx:Label id="hitTestPoint1" text="test" /> or  private var hitTestPoint11:Boolean = false; you might get this error.

Leave a comment

isPopUp property for PopUpManager in Adobe Flex

1) I created the popup window of  treatmentPlan :

var treatPlanPopup:treatmentPlan ;

treatPlanPopup = PopUpManager.createPopUp(Application.application as DisplayObject, treatmentPlan,true) as treatmentPlan;
treatPlanPopup.isPopUp = true;

2) isPopUp property can be used in 2 ways:

  1. Prevent creation of multiple window of treatmentPlan by PopUpManager by setting the isPopUp property to true and check the value again on next creation
  • on creation of popup window object  treatPlanPopup is created and on close it does not get null value , but isPopUp value becomes false.
  • Till window is not closed , isPopUp value remains true
  • So next time before opening the treatmentPlan window by PopUpManager, if you check the value treatmentPlan.isPopUp, it comes false
  • if(treatPlanPopup !=null && treatPlanPopup.isPopUp)
    {return}//do not open the popup window
  • *********************************************************
  • Create an undraggable TitleWindow container by setting the isPpUp property to false on the TitleWindow instance.
  • Example on http://tiny.cc/v4axc

1 Comment

Find criteria must contain at least one sort field value

1) I applied the sorting to arraycollection :

var sf:SortField = new SortField();
sf.name = “CaseID”;
var srt:Sort = new Sort()
srt.fields = [sf];
cases.sort = srt; // cases is arraycollection and storing values //from backend service
cases.refresh();

But it cause the execption stating “Find criteria must contain at least one sort field value”, on checking the dataprovider we found that field ‘CaseID’ was not present in data but ‘CaseId’ and because of that it was causing the exception.

So make sure that the sortfield should present in the data.

Leave a comment