Ok i am needing some more help again.
I have a button that i want to use to load an external SWF dynamically. Here is my current code for it (below).
The first problem is I’m getting error 1120: Access of undefined property contact_btn.
And yes my instance name of the button is contact_btn in the property table.
So i don’t know what it is that is causing it?
I also am clueless of how to get this clip to unload from the screen when the user clicks a button, and show the original screen the user saw before he clicked on the contact button to load the contact form.
Or do i just use the same theory of loading the contact form, to load over the contact form that loaded over the main page when he clicked the contact button … sorry if this is getting confusing.
Any ideas?
I need this for a big project that i must have completed in a week.
Help is appreciated and thanked in advance!
stop();
// Import classes
import flash.net.URLRequest;
import flash.events.*;
import flash.display.Loader;
function contact(event:MouseEvent):void {
var contactRequest:URLRequest = new URLRequest("contact.swf");
var contactLoader:Loader = new Loader();
contactLoader.load(contactRequest);
addChild(contactLoader);
contactLoader.x = 0;
contactLoader.y = 0;
}
contact_btn.addEventListener(MouseEvent.CLICK, contact);