Skip navigation

How to click button in exported SWF to go to frame in parent SWF?

Oct 29, 2011 3:54 PM

  Latest reply: Beaastie, Oct 29, 2011 7:29 PM
Replies
  • Peter Celuch
    505 posts
    Nov 17, 2005
    Currently Being Moderated
    Oct 29, 2011 6:30 PM   in reply to Beaastie

    Oh my. Let's try one more thing, if it doesn't work, pack the whole project and send me link via private message.

     

    change parent one more time:

     

    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.events.ProgressEvent;
     
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("projectgallery_cutlimestone.swf");
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgressHandler);
    myLoader.load(url);
     
    function loadProgressHandler(event:Event):void {
         if(myLoader.content) {
              addChild(myLoader.content);
              myLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgressHandler);
     
         }
     
    }
     
    
     
    |
    Mark as:
  • Peter Celuch
    505 posts
    Nov 17, 2005
    Currently Being Moderated
    Oct 29, 2011 7:21 PM   in reply to Beaastie

    OK, fixed.

     

    The main problem was in naming your Document classes. In both files, the Document class was Main. Flashplayer caches all class definitions so they can be reused and shared between loaded swfs. This is really useful feature if you're aware of it. Otherwise it can cause quite a headache. The errors seem to pop out for no apparent reason etc. I renamed the Document class of first swf to Index. Make sure you never ever have two document classes with the same name. You should change the Main also to CutLimestone if you plan on loading other galleries.

     

    I also made some smaller changes - make sure to copy them to new galleries so they all behave the same.

     

    Good luck!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points