I've ran into this before.  I think that you just want to declare your
class as dynamic.

-Dale

--- In [email protected], "Nate Beck" <n...@...> wrote:
>
> So this is kind of annoying, I have a proxy Class that I am working
with...
> here is a trimmed down version of it.
> 
> -- DateTime.as (Trimmed version) --
> 
> package net.natebeck.core
> {
> import com.flexoop.utilities.dateutils.DaylightSavingTimeUS;
>  import flash.utils.Proxy;
> import flash.utils.flash_proxy;
>  public class DateTime extends Proxy
> {
> // Instance Variables
> protected var _date:Date;
> protected var _timezone:Timezone;
> 
> public function DateTime(... args)
> {
> super();
>                        _date = new Date(args[0]);
>        if(args[0] is String)
>             setTimezone(parseTimezone(args[0]));
> }
>  public function setTimezone(value:Timezone):void
> {
> trace("Setting Timezone: "+value);
> _timezone = value;
> }
>  public function getTimezone():Timezone
> {
> trace("Getting Timezone: "+_timezone);
> return _timezone;
> }
>  public function getTimezoneOffset():Number
> {
> return _timezone.offset;
> }
>  override flash_proxy function callProperty(methodName:*, ... args):*
> {
> var res:*;
>         switch (methodName.toString())
>         {
>             case 'toString':
>              res = "foobar";
>              break;
>             default:
>                 res = _date[methodName].apply(_date, args);
>                 break;
>         }
>         return res;
> }
>  override flash_proxy function getProperty(name:*):* {
> trace("getting property: "+name);
>         return _date[name];
>     }
>     override flash_proxy function setProperty(name:*, value:*):void {
>         _date[name] = value;
>     }
>  }
> }
> 
> I've written a simple test application to test my DateTime Proxy
class while
> I'm developing.
> 
> -- TestDateTime.as --
> 
> package
> {
> import flash.display.Sprite;
>  import net.natebeck.core.DateTime;
> import net.natebeck.core.Timezone;
>  public class TestDateTime extends Sprite
> {
> public function TestDateTime()
> {
> var create:Object = "Jun 17 12:00:00 GMT-0500 2009";
>  var oldDate:Date = new Date(create);
> var strDate:DateTime = new DateTime(create);
>  trace("old: "+oldDate);
> trace("new: "+strDate);
> 
> strDate.getTimezone();
> strDate.setTimezone(Timezone.PST);
> strDate.getTimezone();
>  trace(strDate.toString());
>  }
>  }
> }
> 
> When trying to compile using FlexBuilder I get this error.
> 
> 1061: Call to a possibly undefined method toString through a
reference with
> static type net.natebeck.core:DateTime.
> 
> Well that's dumb... the whole reason I'm using the Proxy class is so
I don't
> have to re-write every method within my class.
> 
> Am I missing something?
> 
> -- 
> 
> Cheers,
> Nate
> ----------------------------------------
> http://blog.natebeck.net
>


Reply via email to