Skip to main content

Problems with for statement

2 replies [Last post]
Joined: 2008-05-17

Hello everybody.
i'm trying to iterate using for statement(examlpe Here is the source:
var approximation= function(x:Number):Number{
var n :Number=10;

var sum = 0.0;
var sign = 1.0;
var i:Number=1;

for(i in [1..n]){
sign = -sign;
sum += ((1 - sign) * Math.sin(i * x)) / i;

return sum;

NetBeans 6.0.1 says: Encountered For.But in book(JavaFX

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-07-12

The FunctionGraph sample is written on compiler version of JavaFX Script languages.
So it does not work with NetBeans 6.0.1 that contains only interpreter version.

NetBeans 6.1 contains compiler version of JavaFX Script language. Use this one.

You need to add right package statement in the begin of your fx file to make it work:
[code]package bugagaga; [/code]

Joined: 2008-05-17

Thanks a lot for you.