Sorry man I didn't read the original post :S ...
main_site is loaded into gallery, and main_site has some buttons that when
you press them, they should trigger handlers in gallery.
I think it goes like this - add this code to your loader complete function
in gallery:
//where target is Loader
var main_site_instance:Sprite = ev.target.content as Sprite;
main_site_instance.addEventListener("bk2globe", bk2globeListener);
main_site_instance.addEventListener("randomImg", randomImgListener);
main_site should dispatch these events when you interact with it. This needs
to happen on the document class level...
H
On Thu, Aug 14, 2008 at 8:55 AM, SJM - Flash <[EMAIL PROTECTED]> wrote:
> Again another solution i tried but this too does not work!
>
> Thanks
> SJM
> ----- Original Message -----
> From: Kenneth Kawamoto
> To: Flash Coders List
> Sent: Thursday, August 14, 2008 1:36 PM
> Subject: Re: [Flashcoders] AS3 accessing functions from other classes
>
>
> You should be able to do access the parent by using, "parent".
>
> Kenneth Kawamoto
> http://www.materiaprima.co.uk/
>
> SJM - Flash wrote:
> > Hi guys, im having some trouble accessing a function from another class
> and I would like to know how its done.
> >
> > In my project i have 2 FLAs 'gallery.fla' and 'main_site.fla', each of
> the FLAs has its own document class 'gallery.as' and 'main_site.as'. When
> compiled the second SWF(main_site) is loaded into the first SWF(gallery).
> >
> > In the same class that loads the SWF there is a number of other
> functions i want to access from buttons located within the loaded SWF
> (main_site).
> >
> > The SWF is loaded using this code...
> >
> > // CODE from within FUNCTION
> > var swfLoader:Loader = new Loader();
> > var swfURL:URLRequest = new URLRequest(filename);
> > swfLoader.load (swfURL);
> > swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
> swfLoadComplete);
> >
> > // CODE from within 'swfLoadComplete' FUNCTION
> > addChild(ev.target.content);
> > var loader:LoaderInfo = LoaderInfo(ev.target);
> > loader.content.x = 0;
> > loader.content.y = 0;
> >
> > SJM
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders