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 <
[email protected]> 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
[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

Reply via email to