Re: [Flashcoders] No variables in Interfaces?
Excellent news... On 2/13/06, Johannes Nel <[EMAIL PROTECTED]> wrote: > > getters and setters are allowed in AS3! > > On 2/13/06, David Rorex <[EMAIL PROTECTED]> wrote: > > > > Hadn't thought of that, I guess that would work. > > > > Thanks > > > > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] No variables in Interfaces?
getters and setters are allowed in AS3! On 2/13/06, David Rorex <[EMAIL PROTECTED]> wrote: > > Hadn't thought of that, I guess that would work. > > Thanks > > On 2/13/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > > > No, there isn't. > > > > Is there a reason why you can't roll your own accessor functions? > > > > e.g. > > > > getValue() > > > > setValue() > > > > ? > > > > Cheers, > > Ian > > > > On 2/13/06, David Rorex <[EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > > > > Is there NO way to use variables in an interface? > > > > > > Code: > > > > > > var obj:ICanvas = new ClassThatImplementsICanvas(); > > > trace(obj.value); // Error: Line 342: There is no property with the > name > > > 'value'. > > > > > > > > > So, then I add this line to ICanvas.as > > > > > > var value:Number; > > > > > > Recompile: > > > > > > Error: ICanvas.as: Line 41: Variable declarations are not permitted in > > > interfaces. > > > > > > --- > > > > > > What is the solution? Is there any type-safe way of doing this? Or do > I > > > have > > > to do: > > > > > > var obj:ICanvas = new ClassThatImplementsICanvas(); > > > var obj2 = obj; > > > trace(obj2.value); // Compiles and works, but lose type checking. > > > > > > > > > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > -- j:pn ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] No variables in Interfaces?
Hadn't thought of that, I guess that would work. Thanks On 2/13/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > No, there isn't. > > Is there a reason why you can't roll your own accessor functions? > > e.g. > > getValue() > > setValue() > > ? > > Cheers, > Ian > > On 2/13/06, David Rorex <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Is there NO way to use variables in an interface? > > > > Code: > > > > var obj:ICanvas = new ClassThatImplementsICanvas(); > > trace(obj.value); // Error: Line 342: There is no property with the name > > 'value'. > > > > > > So, then I add this line to ICanvas.as > > > > var value:Number; > > > > Recompile: > > > > Error: ICanvas.as: Line 41: Variable declarations are not permitted in > > interfaces. > > > > --- > > > > What is the solution? Is there any type-safe way of doing this? Or do I > > have > > to do: > > > > var obj:ICanvas = new ClassThatImplementsICanvas(); > > var obj2 = obj; > > trace(obj2.value); // Compiles and works, but lose type checking. > > > > > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] No variables in Interfaces?
No, there isn't. Is there a reason why you can't roll your own accessor functions? e.g. getValue() setValue() ? Cheers, Ian On 2/13/06, David Rorex <[EMAIL PROTECTED]> wrote: > > Hi, > > Is there NO way to use variables in an interface? > > Code: > > var obj:ICanvas = new ClassThatImplementsICanvas(); > trace(obj.value); // Error: Line 342: There is no property with the name > 'value'. > > > So, then I add this line to ICanvas.as > > var value:Number; > > Recompile: > > Error: ICanvas.as: Line 41: Variable declarations are not permitted in > interfaces. > > --- > > What is the solution? Is there any type-safe way of doing this? Or do I > have > to do: > > var obj:ICanvas = new ClassThatImplementsICanvas(); > var obj2 = obj; > trace(obj2.value); // Compiles and works, but lose type checking. > > > thanks, > David R > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] No variables in Interfaces?
Hi, Is there NO way to use variables in an interface? Code: var obj:ICanvas = new ClassThatImplementsICanvas(); trace(obj.value); // Error: Line 342: There is no property with the name 'value'. So, then I add this line to ICanvas.as var value:Number; Recompile: Error: ICanvas.as: Line 41: Variable declarations are not permitted in interfaces. --- What is the solution? Is there any type-safe way of doing this? Or do I have to do: var obj:ICanvas = new ClassThatImplementsICanvas(); var obj2 = obj; trace(obj2.value); // Compiles and works, but lose type checking. thanks, David R ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com