Re: [Flashcoders] wait or sleep

2006-03-21 Thread Danny Kodicek

Hello,

is possible to make a wait or sleep (like java) to stop a code 
execution and after n seconds  return to execute?


Not directly, but you can create the same functionality with setInterval()

Danny
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread iashido

http://proto.layer51.com/d.aspx?f=454


On Mar 21, 2006, at 4:13 PM, Danny Kodicek wrote:




Using setInterval, I can only call a method (or funciton) same time
later. I can't continue to run from the same point, at same function.
Exist another solution for this?


Yes, put your remaining code into a separate function:

id=setInterval(function(){myRemainingCode},2000)

You can comfortably (well, messily) create a whole set of commands  
that run at intervals. The only problem is that you might want to  
avoid any other functions running in the intervening time.


Danny
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





www.itseveryday.ro
www.iashido.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread [EMAIL PROTECTED]
Using setInterval, I can only call a method (or funciton) same time 
later. I can't continue to run from the same point, at same function.

Exist another solution for this?
Schramm

Danny Kodicek wrote:


Hello,

is possible to make a wait or sleep (like java) to stop a code 
execution and after n seconds  return to execute?



Not directly, but you can create the same functionality with 
setInterval()


Danny
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread Gabriel Belvedere
you don't need a wait, the way you are doing its correct, except for the
order

mclip.onLoad()
{
   continue();
}

mclip.loadMovie();

if you end your code right after the loadmovie it will continue on the
onLoad.

cheers
GaB.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread [EMAIL PROTECTED]

If you are inside a loop, and need to wait you have a big problem!

I would like a semaphore for syncronization. :-\
The Adobe/Macromedia must put this on Flash. (AS) :'( .


Danny,  thanks for you help! ;-)
Rodrigo Schramm

Danny Kodicek wrote:




Using setInterval, I can only call a method (or funciton) same time
later. I can't continue to run from the same point, at same function.
Exist another solution for this?



Yes, put your remaining code into a separate function:

id=setInterval(function(){myRemainingCode},2000)

You can comfortably (well, messily) create a whole set of commands 
that run at intervals. The only problem is that you might want to 
avoid any other functions running in the intervening time.


Danny
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread elibol
I believe the effect of a wait() function in Flash would cause an
application to freeze/hang. Actionscript is a single threaded language, I
don't even think a wait() type function could be implemented with sufficient
practicality. Wouldn't it just stop the entire thread from executing any
further, then resume it, leaving the state of the application identical to
the state it was in prior to calling the wait() function? Is Java not multi
threaded? Am I wrong?

M.

On 3/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 If you are inside a loop, and need to wait you have a big problem!

 I would like a semaphore for syncronization. :-\
 The Adobe/Macromedia must put this on Flash. (AS) :'( .


 Danny,  thanks for you help! ;-)
 Rodrigo Schramm

 Danny Kodicek wrote:

 
  Using setInterval, I can only call a method (or funciton) same time
  later. I can't continue to run from the same point, at same function.
  Exist another solution for this?
 
 
  Yes, put your remaining code into a separate function:
 
  id=setInterval(function(){myRemainingCode},2000)
 
  You can comfortably (well, messily) create a whole set of commands
  that run at intervals. The only problem is that you might want to
  avoid any other functions running in the intervening time.
 
  Danny
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 
 

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread Danny Kodicek



Using setInterval, I can only call a method (or funciton) same time
later. I can't continue to run from the same point, at same function.
Exist another solution for this?


Yes, put your remaining code into a separate function:

id=setInterval(function(){myRemainingCode},2000)

You can comfortably (well, messily) create a whole set of commands that run 
at intervals. The only problem is that you might want to avoid any other 
functions running in the intervening time.


Danny 


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] wait or sleep

2006-03-21 Thread Mike Mountain
 Wouldn't it just stop the entire thread from executing any further, 
 then resume it, leaving the state of the application 
 identical to the state it was in prior to calling the wait() 
 function? 

Yes, but this would be very handy to free up CPU cycles to allow other
processes to execute. I'm sick and tired of my C++ co workers accusing
Flash of being CPU hungry.

M
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread eric dolecki
F8 has addressed some of those concerns - and AS3/FP8.5 looks to make major
improvements. Your C++ co-workers are just jealous that you're having fun :)

On 3/21/06, Mike Mountain [EMAIL PROTECTED] wrote:

  Wouldn't it just stop the entire thread from executing any further,
  then resume it, leaving the state of the application
  identical to the state it was in prior to calling the wait()
  function?

 Yes, but this would be very handy to free up CPU cycles to allow other
 processes to execute. I'm sick and tired of my C++ co workers accusing
 Flash of being CPU hungry.

 M
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] wait or sleep

2006-03-21 Thread elibol
yes, we did a recent benchmark for a client that requires some real power,

running the same set of arithmetic calculations this is what we discovered:

as2 finished executing the code in approximately 20 seconds

Java finished executing the code, in 3 renditions, 1422/ 1402/ 1438
milliseconds

as3 finished executing the code, in 3 renditions, 1402/ 1438/ 1402
milliseconds

These approximations would fluctuate between as3 and Java, but the bottom
line is that as3 is just as powerful as Java in processing power.

On 3/21/06, eric dolecki [EMAIL PROTECTED] wrote:

 F8 has addressed some of those concerns - and AS3/FP8.5 looks to make
 major
 improvements. Your C++ co-workers are just jealous that you're having fun
 :)

 On 3/21/06, Mike Mountain [EMAIL PROTECTED] wrote:
 
   Wouldn't it just stop the entire thread from executing any further,
   then resume it, leaving the state of the application
   identical to the state it was in prior to calling the wait()
   function?
 
  Yes, but this would be very handy to free up CPU cycles to allow other
  processes to execute. I'm sick and tired of my C++ co workers accusing
  Flash of being CPU hungry.
 
  M
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] wait or sleep

2006-03-21 Thread Ryan Potter
Here is another way that might help.  You can use Fuse to sequence and wait.
Code Post:
http://thoughtwillrise.com/
 
Fuse:
http://mosessupposes.com/Fuse/index.html
 
 

-Original Message- 
From: [EMAIL PROTECTED] on behalf of iashido 
Sent: Tue 3/21/2006 7:16 AM 
To: Flashcoders mailing list 
Cc: 
Subject: Re: [Flashcoders] wait or sleep



http://proto.layer51.com/d.aspx?f=454


On Mar 21, 2006, at 4:13 PM, Danny Kodicek wrote:


 Using setInterval, I can only call a method (or funciton) same time
 later. I can't continue to run from the same point, at same function.
 Exist another solution for this?

 Yes, put your remaining code into a separate function:

 id=setInterval(function(){myRemainingCode},2000)

 You can comfortably (well, messily) create a whole set of commands 
 that run at intervals. The only problem is that you might want to 
 avoid any other functions running in the intervening time.

 Danny
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




www.itseveryday.ro
www.iashido.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Re: [Flashcoders] wait or sleep

2006-03-21 Thread [EMAIL PROTECTED]




Ryan Potter wrote:


Here is another way that might help.  You can use Fuse to sequence and wait.
Code Post:
http://thoughtwillrise.com/

Fuse:
http://mosessupposes.com/Fuse/index.html
 





Very cool! :-)

But, if I put same code after line 15 in exemple below??? :-(

Rodrigo Schramm


Actionscript:

  1.
 function drawLoadManager(){
  2.
  trace(Draw Load Manager Called);
  3.
  var lm = this.loadManager = new Fuse();
  4.
  lm.push({ func:myMethodOne, scope:this, command:pause});
  5.
  lm.push({ func:loadData, scope:this, command:pause});
  6.
  lm.push({ func:loadMyClip, scope:this, command:pause});
  7.
  lm.start();
  8.
 }
  9.
  
 10.

 function myMethodOne(){
 11.
  
 12.

  do some code...
 13.
  
 14.

  // resume the load manager to load the next item
 15.
  this.loadManager.resume();
 16.
 }
 17.
 function loadData(){
 18.
  this.xml = new XML();
 19.
  this.xml.ignoreWhite = true;
 20.
  // CREATE A REFERENCE TO THE CURRENT TIMELINE
 21.
  this.xml._parent = this;
 22.
  this.xml.onLoad = function () {
 23.
   // resume the load manager to load the next item
 24.
   this._parent.loadManager.resume();
 25.
  }
 26.
  this.xml.load(this.datafile);
 27.
 }
 28.
 function loadMyClip(){
 29.
  this.myClip.loadMovie(load something);
 30.
  // create some sort of load handler
 31.
  this.myClip.onLoad(){
 32.
   // resume the load manager to load the next item
 33.
   this._parent.loadManager.resume();
 34.
  }
 35.
 }







	-Original Message- 
	From: [EMAIL PROTECTED] on behalf of iashido 
	Sent: Tue 3/21/2006 7:16 AM 
	To: Flashcoders mailing list 
	Cc: 
	Subject: Re: [Flashcoders] wait or sleep




http://proto.layer51.com/d.aspx?f=454


On Mar 21, 2006, at 4:13 PM, Danny Kodicek wrote:


 Using setInterval, I can only call a method (or funciton) same time
 later. I can't continue to run from the same point, at same function.
 Exist another solution for this?

 Yes, put your remaining code into a separate function:

 id=setInterval(function(){myRemainingCode},2000)

	 You can comfortably (well, messily) create a whole set of commands 
	 that run at intervals. The only problem is that you might want to 
	 avoid any other functions running in the intervening time.


 Danny
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




www.itseveryday.ro
www.iashido.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com