This works fine for me.

Peter



package com.peterjoel
{
    public class Blah
    {
        public function Blah(){
            new Foo().bar();
        }
    }
}


class Foo{

    public function bar():void{
        trace("wibble");

    }
}

On 7/17/06, Andy McIntosh < [EMAIL PROTECTED]> wrote:
Same error.  This is how I originally tried it and it's how the DragManager and DragProxy work in Beta 2/3.  Sorry for not making that clear in the original post.

Are you using the production release of Flex 2?

Thanks, Andy

On Jul 16, 2006, at 5:01 PM, Michael Schmalle wrote:

Ah,

bad example

take the internal off.

just use class

I use this all the time, I don't know why I put internal class.

Peace, Mike

On 7/16/06, Andy McIntosh < [EMAIL PROTECTED]> wrote:

Mike,


I get the same error ( A file found in a source-path can not have more than one externally visible definition) when specify internal as i do when i say public.


On Jul 16, 2006, at 4:15 PM, Michael Schmalle wrote:

Yeah you can;

package com.package
{
   public class MyClass()
   {
   }
}

internal class Utility
{
   public function Utility()
   {
   }
}

It's good for structs and utility classes. You can also declare package functions to.

function myTrace()
{
}

Then you wouldn't have to create the class just to use the function.

Peace, Mike


On 7/16/06, Andy McIntosh < [EMAIL PROTECTED] > wrote:

In beta 2, the DragManager.as file contained 2 classes: DragManager and DragProxy.  In the production release, DragProxy is in it's own .as file and lives in a dragClasses package.  What's the advantage of breaking it out into another .as file?  Exposing it so it can be extended?  Is it still possible to have internal classes?  In the source from Beta 2, the DragManager class in DragManager.as was declared as public and DragProxy wasn't declared public or private.  I'm trying to do something similar with the production release and it's complaining about "A file found in a source-path can not have more than one externally visible definition."  Declaring the internal class as private causes flex to complain, "The private attribute may be used only on class property definitions."


The entire concept of multiple classes per .as file seemed really bizarre to me at first, but I sort of understand the appeal now. I don't *need* to have an internal class, but I thought I'd give it a shot to keep the file structure a bit tighter.  

Andy                         


me Andy McIntosh: Senior Engineer
[EMAIL PROTECTED] | 303.956.2123 | aim - ameui





--
What goes up, does come down.



me Andy McIntosh: Senior Usability Engineer
[EMAIL PROTECTED] | 303.956.2123 | aim - am_eui




--
What goes up, does come down.


me Andy McIntosh: Senior Usability Engineer
[EMAIL PROTECTED] | 303.956.2123 | aim - am_eui


__._,_.___


SPONSORED LINKS
Custom software development Database development software Embedded software development
Offshore software development Software development Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to