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â„¢ Script: Dynamic Javaâ„¢ Scripting for Rich Internet/Client-Side Applications) it's said that everything should ok with for statement. What is the problem.
And also i have another kind of problem.
In NetBeans 6.1 when trying example(
Everythind seems to be ok, but while compilling there is problem:
Created dir: C:\Documents and Settings\s.protchenko\My Documents\NetBeansProjects\bugagaga\build\classes
Copied 1 empty directory to 1 empty directory under C:\Documents and Settings\s.protchenko\My Documents\NetBeansProjects\bugagaga\build\classes
Compiling 1 source file to C:\Documents and Settings\s.protchenko\My Documents\NetBeansProjects\bugagaga\build\classes
Created dir: C:\Documents and Settings\s.protchenko\My Documents\NetBeansProjects\bugagaga\dist
Building jar: C:\Documents and Settings\s.protchenko\My Documents\NetBeansProjects\bugagaga\dist\bugagaga.jar
Copy libraries to C:\Documents and Settings\s.protchenko\My Documents\NetBeansProjects\bugagaga\dist\lib.
To run this application from the command line without Ant, try:
java -jar "C:\Documents and Settings\s.protchenko\My Documents\NetBeansProjects\bugagaga\dist\bugagaga.jar"
java.lang.NoClassDefFoundError: bugagaga/Main
Caused by: java.lang.ClassNotFoundException: bugagaga.Main
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
Exception in thread "main"
BUILD FAILED (total time: 1 second)
Can anybode explain me why it is so?

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.