Help loading an external SWF
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help loading an external SWF

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    2

    Help loading an external SWF

    Hey guys, So I've pretty much finished making a site, I just need a gallery. To make it easily edited I decided to use the
    Photo Gallery Maker program, found here: http://www.photogallerymaker.com/

    But I keep getting an error loading this and I have no idea how to fix it, the error is:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at GalleryLoader()[E:\Projects\GalleryMaker\FlexSource\GalleryLoader\ src\GalleryLoader.as:23]

    The code I'm using is this:


    Code:
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    
    function startLoad()
    {
    var mLoader:Loader = new Loader();
    var mRequest:URLRequest = new URLRequest("WG3.swf");
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
    mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
    mLoader.load(mRequest);
    }
    
    function onCompleteHandler(loadEvent:Event)
    {
            addChild(loadEvent.currentTarget.content);
    }
    function onProgressHandler(mProgress:ProgressEvent)
    {
    var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
    trace(percent);
    }
    startLoad();

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    105
    Your error looks like it is coming from the actionscript file for the GalleryLoader. The Error #1009 comes from trying to talk to something that is not there... Check this article: http://curtismorley.com/2007/08/15/f...ect-reference/

    Does the gallery play fine in its own swf? and now you are having trouble incorporating it into your file?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com