teitunge Posted November 18, 2008 Share Posted November 18, 2008 Hi people!The last time I used Actionscript, the current standard was 2.0, and I realize things have changed. I encounter my problem when trying to load a swf into a movieclip-container on the "main page". homeBTN.addEventListener(MouseEvent.CLICK, myButtonFunction);function myButtonFunction(event: MouseEvent) {_root.contents.loadMovie("commercial.swf");} Flash responds with:1119: Access of possibly undefined property contents through a reference with static type flash.display:DisplayObject.The coding in line three used to work in AS2.0, and I've been searching the web forward and back for many hours now without a final solution.Could anyone please give me any pointers? Thanks in advance :-) Link to comment Share on other sites More sharing options...
teitunge Posted November 18, 2008 Author Share Posted November 18, 2008 All right - this code works for loading the external swf - but it doesnt help me to put it into the "cointainer"-movieclip..homeBTN.addEventListener(MouseEvent.CLICK,myButtonFunction);function myButtonFunction(event: MouseEvent) {var request = new URLRequest("http://www.evyandersen.com/commercial_main.swf");var loader:Loader = new Loader()loader.load(request);addChild(loader);}Please..:-) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.