When should I override 1 of the lifecycle methods?

I read in the Flex Developer's Guide that you sometimes need to override one lifecycle method: commitProperties and updateDisplayList but I wrote several flexible applications without requiring their implementation. when do i need to override them?

+3
source share
2 answers

Firstly, I 100% recommend exploring this EffectiveUI presentation :

and this is Michael Labriola from Digital Primates :

, , Flex.

, , , - . .

  • - , , /.
  • - , , , (LoginScreen, ContactForm ..).

, , (Canvas, Group, Container, VBox, List ..). , View/Application, , "dataProvider" itemRenderers, .

- . , , , Flex : . , , , , , . :

createChildren()

  • . , Panel createChildren, createChildren addChild , initialize, createChildren.

, , StarRatingComponent, 5 , . , createChildren(), , . Container Flex SDK ( -), , MXML- - --.

3 1 .

()

  • ( ), . ( , ).
  • , .

measure, :

  • measuredWidth measuredHeight . , CoverFlowContainer measuredWidth/measuredHeight ( measure ), , CoverFlowContainer, 0 width 0 height. measure measuredWidth radius * 2 - , !
  • , . .

commitProperties

  • measure.
  • ( ) ( ).
  • .

, . CoverFlowContainer, , distance, gap, selectedItem tilt. , . Flex commitProperties. commitProperties layout.updateEverything(selectedItem, distance, gap, tilt); . , , , .

updateDisplayList

  • commitProperties
  • .

, , setActualSize, graphics .. (- `commitProperties) , , .

, , , :

  • TitleWindow ( )
  • View3D ( Away3D/Papervision)
  • Flex 4
  • TextArea ( , ..).
  • ToolTip ( )

, . Flex 4 , . Openflux ( , Flex Framework. , , ).

, AdvertismentView, MenuView LoginView, , , , (ViewStack, Group, List, ..). , commitProperties.

, , , . , RichTextEditor, showFontControls showStylePanel. , , , , : accessor , , commitProperties updateDisplayList, . , , , โ€‹โ€‹ , . visible. ....

, Flex SDK Source , .

, .

+8

Source: https://habr.com/ru/post/1732925/


All Articles