Have you tried dispatchEvent() ?

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Omar Fouad wrote:
Yeah they all work :) thanks so much...
But I wanna ask a question. Can I dispatch Events from the swf to be
listened in the container Movie?

On Tue, Apr 8, 2008 at 9:54 PM, Bob Wohl <[EMAIL PROTECTED]> wrote:

Have you tried to do something along the lines of this:


private var myObject:DisplayObject;
public function getMap(link:String):void {
          var ldr:Loader = new Loader();
          var urlReq:URLRequest = new URLRequest("Maps/" + link);
          ldr.load(urlReq);
          Map_Container.addChild(ldr);
myObject = ldr;
           ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,
getProject);
      }
      public function getProject(e:Event):void {
          trace("Movie Loaded"); // works
          trace(ldr.B1.Pid); //undefined.
trace(myObject.B1.Pid)
       }



On Tue, Apr 8, 2008 at 12:23 PM, Omar Fouad <[EMAIL PROTECTED]>
wrote:

Hi list,

I am loading an swf that contains two MovieClips into an AS3 Project, B1
and
B2.
in the fist (and only) frame of the swf loaded I added:

B1.Pid = 1;
B2.Pid = 2;

Now I would like to access that property from the class wich loads that
SWF
here is the code I used:

public function getMap(link:String):void {
           var ldr:Loader = new Loader();
           var urlReq:URLRequest = new URLRequest("Maps/" + link);
           ldr.load(urlReq);
           Map_Container.addChild(ldr);
           ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,
getProject);
       }
       public function getProject(e:Event):void {
           trace("Movie Loaded"); // works
           trace(ldr.B1.Pid); //undefined.
       }

How can I access it? In AS2 I used to write the name of the container
like:

container.MC.property;

But how in AS3?

Thanks.

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net




_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to