tags:

views:

16

answers:

2

Hello there,

I have a class called which is called ChartInfo,and it has a getter and setter methods as:

[Bindable]
public function set isShowingPower(b:Boolean):void
{
   _isShowingPower = b;

   hasChanged();
}

public function get isShowingPower():Boolean
{
   return _isShowingPower;
}

The _isShowingPower is the property.

However,if I want to set the _isShowingPower from another class:

_chartInfo.isShowingPower(false)

It will always give error like: 1195: Attempted access of inaccessible method isShowingPower through a reference with static type components.charting:ChartInfo.

Could anyone give an idea?Thanks a lot.

+2  A: 

Setters are used like properties, so _chartInfo.isShowingPower = false;

adamcodes
+2  A: 

Hi!

to access a setter and/or getter you have to do it like a var.

in your case it should be

_chartInfo.isShowingPower = false;

HTH Gus

Gus
seconds late! hehe
Gus
+1 for acknowledging that.
adamcodes