DrewFulton
October 19th, 2008, 08:47 PM
I am new to Flash CS3 and ActionScript 3.0 but have been making good progress I think. However, I am stuck with an error at the moment and after and hour of testing haven't come up with a solution.
The error reads:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at slideshow_fla::mc_slideshow_3/loadThumbs()
at slideshow_fla::mc_slideshow_3/slideshow_fla::frame1()
I am posting a couple snippets of code here but the whole project is attached.
Basically, I have cobbled a couple different projects together in an attempt to make a slideshow with scrolling thumbnails at the bottom and a slideshow at the top. I haven't added in the ability to click on a thumbnail and change the top image yet but thats next. Right now I am just trying to get the thumbnails to show up and scroll with onmouseovers which will eventually be converted to buttons instead.
Anyway, this is the section of loadThumbs() mentioned in the above error.
I can comment out one line that removes the error but then nothing happens and that is noted below.
function loadThumbs():void {
//check here to see if the thumbLoader is null or not. If its not null, that means a load operation is in progress
//so we need to kill that load using the unload method, remove its event listeners and set that instance of the loader object
//to null
if (thumbLoader!=null) {
thumbLoader.contentLoaderInfo.removeEventListener( Event.INIT, thumbLoaded);
thumbLoader.close();
thumbLoader = null;
}
thumbLoader = new Loader();
thumbLoader.contentLoaderInfo.addEventListener(Eve nt.INIT, thumbLoaded);
thumbLoader.load(new URLRequest( "images/thumb/" + xmlSlideshow..image[i].@filename)); //COMMENT OUT THIS LINE AND NO ERROR!
i++; //increment through the thumbnails array
}
Thanks for any and all help.
The error reads:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at slideshow_fla::mc_slideshow_3/loadThumbs()
at slideshow_fla::mc_slideshow_3/slideshow_fla::frame1()
I am posting a couple snippets of code here but the whole project is attached.
Basically, I have cobbled a couple different projects together in an attempt to make a slideshow with scrolling thumbnails at the bottom and a slideshow at the top. I haven't added in the ability to click on a thumbnail and change the top image yet but thats next. Right now I am just trying to get the thumbnails to show up and scroll with onmouseovers which will eventually be converted to buttons instead.
Anyway, this is the section of loadThumbs() mentioned in the above error.
I can comment out one line that removes the error but then nothing happens and that is noted below.
function loadThumbs():void {
//check here to see if the thumbLoader is null or not. If its not null, that means a load operation is in progress
//so we need to kill that load using the unload method, remove its event listeners and set that instance of the loader object
//to null
if (thumbLoader!=null) {
thumbLoader.contentLoaderInfo.removeEventListener( Event.INIT, thumbLoaded);
thumbLoader.close();
thumbLoader = null;
}
thumbLoader = new Loader();
thumbLoader.contentLoaderInfo.addEventListener(Eve nt.INIT, thumbLoaded);
thumbLoader.load(new URLRequest( "images/thumb/" + xmlSlideshow..image[i].@filename)); //COMMENT OUT THIS LINE AND NO ERROR!
i++; //increment through the thumbnails array
}
Thanks for any and all help.