Package is defined in a separate file in the same folder as
the mxml code.
Do you mean separate directory (folder) in the same folder as
MXML code? Right now I understand it to mean that you have the
class file (samples.as) by itself in the same folder as the MXML
file. If you simply have the file samples.as in the same folder as
the MXML code then your package declaration in the class is wrong.
It should be:
and the import statement in the MXML file should be:
And finally, the class file name should be changed to