NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Information about this web site => Question related to Physics or physics related simulation => Topic started by: ahmedibrahim on July 16, 2010, 08:17:54 pm



Title: How make applet run one time only/board:23-100-
Post by: ahmedibrahim on July 16, 2010, 08:17:54 pm
Hello prof
Is me Ahmed I'm use this account still you solve problem in my account
I want ask how to make applet airdrag run one time only.
I see run two times one by myself and number 2 automatic i search in code
But no find what make applet run two time,, or may I'm not notice however.
How i make applet run one time only i will attach jar file because i see by this account i use i cant upload jar file.
Thanks
This is code fixed page:

Code:
if(_isPlaying() && x>xmax+size && y<ymin+size ){
_initialize();
playpause();
}
if(x>xmax*scale || y>ymax*scale){
 scale=scale*1.2;
}



Title: Re: How make applet run one time only/board:23-100-
Post by: Fu-Kwun Hwang on July 16, 2010, 09:04:47 pm
I do not fully understand what do you mean by run one time only?

Do you mean when it reach the ground again , the program stop and user can not change it any more?
It can be done, but why you want to do this?

Your original account is back to normal now. It seems that the server detect you were doing something un-normal (like a spam), so the server block your account.


Title: Re: How make applet run one time only/board:23-100-
Post by: ahmedelshfie on July 16, 2010, 10:25:45 pm
I add graphic to X and Y so when i run simulation mass begin move by value that i set
And when touch ground return again by the same trace for second time so in graphic line become more Strong
So i think may this mix students when watch graphic work again by the same way without change value so this make me ask
To make applet work just one time only.

About  mu account i don't know really what happen i was check site normally yesterday
And 10 Minuet's before finish time my work find it in my account  so i Email you direct.
Thank you so much.  


Title: Re: How make applet run one time only/board:23-100-
Post by: lookang on July 17, 2010, 12:12:46 am
Code:
if(_isPlaying() && x>xmax+size && y_initialize();
playpause();
}
if(x>xmax*scale || y>ymax*scale){
 scale=scale*1.2;
}

fixed by commenting this
if(_isPlaying() && x > xmax+size && y < ymin+size ){
//_initialize(); //commented by lookang to stop looping
playpause(); //commented by lookang to stop only once
}


Title: Re: How make applet run one time only/board:23-100-
Post by: ahmedelshfie on July 17, 2010, 12:35:45 am
Now is finish ,,  // _initialize(); by lookang  work very well
Thanks prof
You van check too on Airdrag (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1832.msg6919;topicseen#msg6919)