Jump to content

Trouble loading swf's in AS3.0


Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...