开发者

Can't use static const as param in function call within binding tags in Flex 3

开发者 https://www.devze.com 2022-12-27 19:00 出处:网络
I\'m having a problem in flex 3 where if a static const I have defined is used as the parameter to a function call within binding tags I get a \"1120: Access of undefined property NodePropertyMatrix\"

I'm having a problem in flex 3 where if a static const I have defined is used as the parameter to a function call within binding tags I get a "1120: Access of undefined property NodePropertyMatrix". _propMtx is a ArrayCollection.

<mx:HBox visible="{_propMtx.getItemAt(NodePropertyMatrix.srcParent)}">

Above code throws the error, but the following code does not

<mx:HBox visible="{NodePropertyMatrix.srcParent}">

NodePropertyMatrix is an AS class as follows:

package model.constants
{
import mx.collections.ArrayCollection;

public class NodePropertyMatrix
{
    public static const srcParent:Number = 0;
}
}

An开发者_如何学Pythonyone know what is wrong here?


Found the problem.

In the mxml file where I was importing the NodePropertyMatrix is was doing this:

import Constants.*;

Instead of this:

import Constants.NodePropertyMatrix;

For some reason it doesn't work in this instance without explicity importing that class. Wildcard didn't do the trick....not sure why, but ignorance is bliss.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号