We present a comprehensive flux-resolved spectral analysis of the bright narrow-line Seyfert 1 AGNs, Mrk 335 and Ark 564 using observations by XMM-Newton satellite. The mean and the flux-resolved spectra are fitted by an empirical model consisting of two Comptonization components, one for the low-energy soft excess and the other for the high-energy power law. A broad iron line and a couple of low-energy edges are required to explain the spectra. For Mrk 335, the 0.3-10 keV luminosity relative to the Eddington value, L_X_/L_Edd_, varied from 0.002 to 0.06. The index variation can be empirically described as {Gamma}=0.6log_10_L_X_/L_Edd_+3.0 for 0.005<L_X_/L_Edd_<0.04. At L_X_/L_Edd_~0.04 the spectral index changes and then continues to follow {Gamma}=0.6log_10_L_X_/L_Edd_+2.7, i.e. on a parallel track. We confirm that the result is independent of the specific spectral model used by fitting the data in the 3-10 keV band by only a power law and an iron line. For Ark 564, the index variation can be empirically described as {Gamma}=0.2log_10_L_X_/L_Edd_+2.7 with a significantly large scatter as compared to Mrk 335. Our results indicate that for Mrk 335, there may be accretion disc geometry changes which lead to different parallel tracks. These changes could be related to structural changes in the corona or enhanced reflection at high flux levels. There does not seem to be any homogeneous or universal relationship for the X-ray index and luminosity for different AGNs or even for the same AGN.