[flexcoders] More than one class in the same file

2006-06-21 Thread alglx
Well, i've read that it is possible to place more than one class in
the same as file and also within the body of a package, like for example

package tutorial{
  class Sample1 {}
  class Sample2 {}
  class Sample3 {}
}

but everytime i try to do that, Flex gives me an error saying...

A file found in an source-path can not have more than one externally
visible definition.

... ok, i understand that if we have more than one class in a file
just one of them can be public and the file's name must be the same as
the public class. But i don't know why i have that error.






 Yahoo! Groups Sponsor ~-- 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] More than one class in the same file

2006-06-21 Thread Michael Schmalle



There can only be one public class in a package

package
{
 public function MyPublicClass()
 {
 }
}
// you need to import here again for the classes below
// you can also have functions here

function somePackageFunction(arg:Number):void
{
}

MyInternalClass
{
 public function MyInternalClass()
 {
 }
}


Peace Mike
On 6/21/06, alglx [EMAIL PROTECTED] wrote:









  



Well, i've read that it is possible to place more than one class in
the same as file and also within the body of a package, like for example

package tutorial{
  class Sample1 {}
  class Sample2 {}
  class Sample3 {}
}

but everytime i try to do that, Flex gives me an error saying...

A file found in an source-path can not have more than one externally
visible definition.

... ok, i understand that if we have more than one class in a file
just one of them can be public and the file's name must be the same as
the public class. But i don't know why i have that error.


  













-- What goes up, does come down.

__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___