List Info

Thread: - wrong comportement




- wrong comportement
country flaguser name
Belgium
2007-04-19 01:21:11
Hi,

I have suspect behavior between CommandMS and CommandFPS.


> public function start( Void ) : Void
> {
> 	Debug.INFO(this+"start !");
> 	_nTime = getTimer();
> 	_cAcceleration.delay(new Delegate(this,
_refreshAcceleration),  
> _nStandardTime);
> }
>


> private function _refreshAcceleration( Void ) : Void
> {
> 	_cAcceleration.removeAll();
> 	var nAcceleration:Number =
_nStandardTime/(getTimer()-_nTime);
> 	_setAcceleration(nAcceleration);
> 	_nTime = getTimer();
> 	_cAcceleration.delay(new Delegate(this,
_refreshAcceleration),  
> _nStandardTime);
> }
>

if _cAcceleration == new CommandFPS();
_refreshAcceleration is execute all the time.

else if _cAcceleration == new CommandMS();
_refreshAcceleration is execute only once, the delay into
start.
as if it were not able at redefine a delay after a
removeAll();

cheers,
Laurent


_______________________________________________
Pixlib mailing list
Pixlibosflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org


Re: - wrong comportement
country flaguser name
Belgium
2007-04-19 03:14:50
Solution, not use CommandMS :p
> private function _refreshAcceleration( Void ) : Void
> {
> 	clearInterval(_nID);
> 	var nAcceleration:Number =
_nStandardTime/(getTimer()-_nTime);
> 	_setAcceleration(nAcceleration);
> 	_nTime = getTimer();
> 	_nID = setInterval(Delegate.create(this,
_refreshAcceleration),  
> _nStandardTime);
> }


Le 19-avr.-07 à 08:21, ali_o_kan a écrit :

> Hi,
>
> I have suspect behavior between CommandMS and
CommandFPS.
>
>
>> public function start( Void ) : Void
>> {
>> 	Debug.INFO(this+"start !");
>> 	_nTime = getTimer();
>> 	_cAcceleration.delay(new Delegate(this,
_refreshAcceleration),
>> _nStandardTime);
>> }
>>
>
>
>> private function _refreshAcceleration( Void ) :
Void
>> {
>> 	_cAcceleration.removeAll();
>> 	var nAcceleration:Number =
_nStandardTime/(getTimer()-_nTime);
>> 	_setAcceleration(nAcceleration);
>> 	_nTime = getTimer();
>> 	_cAcceleration.delay(new Delegate(this,
_refreshAcceleration),
>> _nStandardTime);
>> }
>>
>
> if _cAcceleration == new CommandFPS();
> _refreshAcceleration is execute all the time.
>
> else if _cAcceleration == new CommandMS();
> _refreshAcceleration is execute only once, the delay
into start.
> as if it were not able at redefine a delay after a
removeAll();
>
> cheers,
> Laurent
>
>
> _______________________________________________
> Pixlib mailing list
> Pixlibosflash.org
> http://osflash.org/mailman/listinfo/pixlib_osflash.org



_______________________________________________
Pixlib mailing list
Pixlibosflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )