Thanks Mike 
That sounds good but I still can't make it work
Have you done this before? (Calling screenweaver methods from within a
class)

Here is what I am trying to do:

//In Test.as
class Test{
        static public var swDebug:Object;

        static public function say(msg){
                swDebug.trace(msg);
        }       
}

//in Flash file
import Test;

Test.say("hello")

////////////////

It won't report any compiler error now but it won't work either

Thanks for your help

Sebastian



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:bounce-fugli-
> [EMAIL PROTECTED] On Behalf Of Mike Pearce
> Sent: Wednesday, 22 September 2004 5:25 PM
> To: Flash Developers List
> Subject: [fugli] Re: Referencing functions in root screen
> 
> Hey Sebastian,
> 
> Sorry to butt in Chris!
> 
> You can either evaluate the method during runtime
> eg, if the function is called methodName()
> 
> DO...
> this["methodName"](parameters)
> 
> instead of ...
> methodName():
> 
> OR  add it to your class definition eg:
> 
> class myClass(){
>     private var methodName:Function;
> 
>     //then you can call it in here without any problems
> }
> 
> OR  if they are global function sjust make sure you prefix the methods
> with
> _global
> 
> Mike =)
> 
> Mike Pearce
> [EMAIL PROTECTED]
> http://www.nectarine.com.au
> 
> ----- Original Message -----
> From: "Sebastian Porto" <[EMAIL PROTECTED]>
> To: "Flash Developers List" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 22, 2004 4:54 PM
> Subject: [fugli] Re: Referencing functions in root screen
> 
> 
> Thanks Chris
> That's a great idea but the next problem is that
> I'm using screenweaver to do a lot of stuff. When I put some
> screenweaver code in a class the compiler will tell that there is no
> method such and such (the screenweaver methods). Any ideas on how to
> deal with this?
> 
> Sebastian
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:bounce-fugli-
> > [EMAIL PROTECTED] On Behalf Of Chris Velevitch
> > Sent: Wednesday, 22 September 2004 4:40 PM
> > To: Flash Developers List
> > Subject: [fugli] Re: Referencing functions in root screen
> >
> > On Wed, 22 Sep 2004 08:57:54 +1000, "Sebastian Porto"
> > <[EMAIL PROTECTED]> wrote:
> >
> > >Hi All
> > >
> > >I am doing my first flash application based on screens. I am trying
> to
> > >put all my functions in the root of the application and the call
> those
> > >functions from within my screens.  But I can't find the way to
> reference
> > >the functions directly. Something like _parent._parent.myFunction()
> will
> > >work but it is messy.  _root or _level0 won't work.
> > >
> > >How do I go about this?:
> >
> > One idea is to put all your functions in a class in separate file,
say
> > C1.as, and then import the class and use the functions eg
> > C1.myFunction().
> >
> >
> > Chris
> >
> > ---
> > You are currently subscribed to fugli as: [EMAIL PROTECTED]
> > To unsubscribe send a blank email to
> [EMAIL PROTECTED]
> > Aussie Macromedia Developers: http://lists.daemon.com.au/
> 
> 
> 
> ---
> You are currently subscribed to fugli as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
> 
> 
> 
> ---
> You are currently subscribed to fugli as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/



---
You are currently subscribed to fugli as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to