External Swf to Communicate with its own timeline after loading it into a containing swf. AS3
I have created a online portfolio that loads in External swfs. Everything works fine on its own but once the external swf is loaded into the containing swf I lose control of the external swfs timeline. Is this a bug or is there just something I am forgetting
function ValidateAndSend(event:MouseEvent):void{
//validate form fields
if(!name_txt.length) {
status_txt.text = "Please enter your name.";
} els开发者_运维百科e if(!email_txt.length) {
status_txt.text = "Please enter an email address";
} else if(!validateEmail(email_txt.text)) {
status_txt.text = "Please enter a VALID email address";
} else if(!msg_txt.length) {
status_txt.text = "Please enter a message.";
} else {status_txt.text = "Thanks " + name_txt.text + ", your message has been sent!";
variables.userName = name_txt.text;
variables.userEmail = email_txt.text;
variables.userMsg = msg_txt.text;
varLoader.load(varSend);
gotoAndStop(2);
}
}
So when I click the send button it sends the message, returns the thankyou, but does not go to the next frame. It works on its own but won't work once loaded into another swf.
What could be the problem?
The first thing I would try is
this.gotoAndStop(2);
or even casting this as the document class for the loaded SWF
(this as Main).gotoAndStop(2);
精彩评论