Re: [Flashcoders] controlling an movie clipo from an external swf (SOLVED)

2009-08-25 Thread Gustavo Duenas
You were right I google my way in and I put an eventlistener  
(complete) to see when it is loaded and now it is working.

 here is the solution for those interested.

var contactLoader:Loader = new Loader();

contactLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,  
onCompleto);

function onCompleto(e:Event):void{
var utop:MovieClip = contactLoader.content as MovieClip;
utop.buttonX.buttonMode=true;
utop.buttonX.addEventListener(MouseEvent.CLICK, closeMe);
function closeMe(e:MouseEvent):void{
removeChild(contactLoader);
}
trace(completo);
}
contactLoader.load(new URLRequest(contactUs.swf));
addChild(contactLoader);
trace(contact);
}//contact Us Function



Regards,

Gus
On Aug 25, 2009, at 4:47 PM, Gregory Boland wrote:

you can't access another swf's timeline till its loaded.  Look at  
what your
writing, you have to account for the time it will take for the  
movieclip to

load in

greg

On Tue, Aug 25, 2009 at 4:24 PM, Gustavo Duenas 
gdue...@leftandrightsolutions.com wrote:


 Hi coders I have this function and I'm trying to control an instance
inside an external swf called botonX

so far this is what I've been doing.

really need help, I'd appreciate



this is my code


function contactUs():void{

var contactMe:MovieClip = new MovieClip();
var contactLoader:Loader = new Loader();
contactLoader.load(new URLRequest(contactUs.swf));
contactMe.addChild(contactLoader);
addChild(contactMe);
var myWindow:MovieClip = contactMe.contactLoader.botonX as MovieClip;
myWindow.addEventListener(MouseEvent.CLICK, closeClick);

trace(contact);
}//contact Us Function



this is the error message

TypeError: Error #1010: A term is undefined and has no properties.
   at main1_fla::MainTimeline/contactUs()
   at main1_fla::MainTimeline/onClick()




Regards,

Gustavo
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] controlling an movie clipo from an external swf (SOLVED)

2009-08-25 Thread Gregory Boland
there u go, good work

On Tue, Aug 25, 2009 at 5:15 PM, Gustavo Duenas 
gdue...@leftandrightsolutions.com wrote:

 You were right I google my way in and I put an eventlistener (complete) to
 see when it is loaded and now it is working.
  here is the solution for those interested.

 var contactLoader:Loader = new Loader();

 contactLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
 onCompleto);
 function onCompleto(e:Event):void{
 var utop:MovieClip = contactLoader.content as MovieClip;
 utop.buttonX.buttonMode=true;
 utop.buttonX.addEventListener(MouseEvent.CLICK, closeMe);
 function closeMe(e:MouseEvent):void{
removeChild(contactLoader);
 }
 trace(completo);
 }
 contactLoader.load(new URLRequest(contactUs.swf));
 addChild(contactLoader);
 trace(contact);
 }//contact Us Function



 Regards,

 Gus
 On Aug 25, 2009, at 4:47 PM, Gregory Boland wrote:

  you can't access another swf's timeline till its loaded.  Look at what
 your
 writing, you have to account for the time it will take for the movieclip
 to
 load in

 greg

 On Tue, Aug 25, 2009 at 4:24 PM, Gustavo Duenas 
 gdue...@leftandrightsolutions.com wrote:

   Hi coders I have this function and I'm trying to control an instance
 inside an external swf called botonX

 so far this is what I've been doing.

 really need help, I'd appreciate



 this is my code


 function contactUs():void{

 var contactMe:MovieClip = new MovieClip();
 var contactLoader:Loader = new Loader();
 contactLoader.load(new URLRequest(contactUs.swf));
 contactMe.addChild(contactLoader);
 addChild(contactMe);
 var myWindow:MovieClip = contactMe.contactLoader.botonX as MovieClip;
 myWindow.addEventListener(MouseEvent.CLICK, closeClick);

 trace(contact);
 }//contact Us Function



 this is the error message

 TypeError: Error #1010: A term is undefined and has no properties.
   at main1_fla::MainTimeline/contactUs()
   at main1_fla::MainTimeline/onClick()




 Regards,

 Gustavo
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders