0 Replies Latest reply on Dec 6, 2010 3:52 PM by poltiruun

    External .swfs

    poltiruun

      Hi All. I’m new to Flash and really enjoying the challenges and rewards of working with this software.

      But recently I ran into a problem that’s been giving my headaches for the past few weeks, What I’m after is a website that will load and unload external .swfs from the navigation bar which I’ve achieved and this works well, The problem is when I put a button in one of the externally loaded .swf to load another no luck.  I have attached a link to scaled down version of the site I’m working towards, my problem begins at my Gallery page which has the buttons on and id like to link these buttons to the pages of the same name and after also have Previous and Next function to go back and forward between the gallery pages.

       

      Code

      var Xpos:Number = 0; var Ypos:Number = 0; var swf:MovieClip; var loader:Loader = new Loader(); var defaultSWF:URLRequest = new URLRequest("swfs/HOME.swf");  loader.load(defaultSWF); loader.x = Xpos; loader.y = Ypos; addChild(loader);  // Button function function btnClick(event:MouseEvent):void {            removeChild(loader);      var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");      loader.load(newSWFRequest);      loader.x = Xpos;     loader.y = Ypos;      addChild(loader); } // Button listeners HOME.addEventListener(MouseEvent.CLICK, btnClick); ABOUT.addEventListener(MouseEvent.CLICK, btnClick); GALLERY.addEventListener(MouseEvent.CLICK, btnClick); CONTACT.addEventListener(MouseEvent.CLICK, btnClick); GALLERY1.addEventListener(MouseEvent.CLICK, btnClick); (This the line I’m having the problem with I receive 1120: Access of undefined property GALLERY1.)

       

      http://rapidshare.com/files/435359413/My_Gallery.zip

       

        Any help and comments will be much appreciated and thanks in advance.