flash - Flex warning Data binding will not be able to detect assignments to "layout" -


i got code:

... <fx:declarations> <s:animate id="toright"   target="{cp.layout}"> <s:simplemotionpath property="horizontalscrollposition"                                     valuefrom="{cp.layout.horizontalscrollposition}" valueto="{cp.layout.horizontalscrollposition+42}"/>             </s:animate> </fx:declarations> .... .... <s:list id="cp" horizontalscrollpolicy="off"  itemrenderer="com.mrenderer" horizontalcenter="1" verticalcenter="1" change="changeevt(event)" borderalpha="0"  width="458" height="65"   initialize="initlist();"  > 

.....

i use animation smoothing move arrows in list.

but got warnings:

data binding not able detect assignments "layout".

i know layout not bindable in list. not custom class. how can prevent that?

so you're using animate effect animate horizontalscrollposition of layout object? , assume working correctly.

the warning triggered curly brace binding expression: target="{cp.layout}". warning telling list control not dispatch binding events if it's layout property changes. if in app changes list's layout, animation effect stop working.

that's warning, , long don't expect change layout, code should work fine.

if you'd make warning disappear, have 3 options:

  • update compiler settings warning not generated (bad idea)
  • instead of using property not bindable in curly brace expression, use function call returns non-bindable property.
  • use "creationcomplete" event handler assign target property of animation

example of using function in binding expression:

<s:animate target="{getanimationtarget()}" />  private function getanimationtarget():object {     return cp.layout; } 

while same problem can occur (if list's layout changes, no event dispatched list update binding), above syntax should prevent warning being generated. flex compiler doesn't generate warning, design, when curly brace expression includes function call.

example of using "creationcomplete" event of list:

<s: list creationcomplete="myfunction() />  private myfunction() {     toright.target = cp.layout; } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -