  Aims: We characterize individual and ensemble properties of X-ray flares fromstars in the CygOB2 and ONC star-forming regions. Method: We analyzed X-raylightcurves of 1003 CygOB2 sources observed with Chandra for 100 ksec and of1616 ONC sources detected in the ``Chandra Orion Ultra-deep Project'' 850 ksecobservation. We employed a binning-free maximum likelihood method to segmentthe light-curves into intervals of constants signal and identified flares onthe basis of both the amplitude and the time-derivative of the sourceluminosity. We then derived and compared the flare frequency and energydistribution of CygOB2 and ONC sources. The effect of the length of theobservation on these results was investigated by repeating the statisticalanalysis on five 100 ksec-long segments extracted from the ONC data. Results:We detected 147 and 954 flares from the CygOB2 and ONC sources, respectively.The flares in CygOB2 have decay times ranging from ~0.5 to about 10 hours. Theflare energy distributions of all considered flare samples are described athigh energies well by a power law with index alpha=-(2.1+-0.1). At lowenergies, the distributions flatten, probably because of detectionincompleteness. We derived average flare frequencies as a function of flareenergy. The flare frequency is seen to depend on the source's intrinsic X-rayluminosity, but its determination is affected by the length of the observation.The slope of the high-energy tail of the energy distribution is, however,affected little. A comparison of CygOB2 and ONC sources, accounting forobservational biases, shows that the two populations, known to have similarX-ray emission levels, have very similar flare activity.
We employed a binning-free maximum likelihood method to segment the light-curves into intervals of constants signal and identified flares on the basis of both the amplitude and the time-derivative of the source luminosity. We then derived and compared the flare frequency and energy distribution of CygOB2 and ONC sources. The effect of the length of the observation on these results was investigated by repeating the statistical analysis on five 100 ksec-long segments extracted from the ONC data.