Re: [Flashcoders] No variables in Interfaces?

2006-02-13 Thread Ian Thomas
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?

2006-02-13 Thread Johannes Nel
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?

2006-02-13 Thread David Rorex
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?

2006-02-13 Thread Ian Thomas
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?

2006-02-13 Thread David Rorex
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