-
1. Re: What's wrong with my code?
kglad Mar 30, 2011 1:24 PM (in response to barpos)you have an undeclared variable but i don't see anything that could be null there. your null reference is elsewhere.
click file/publish settings/flash and tick "permit debugging". retest. the problematic line of code will be in the error message.
-
2. Re: What's wrong with my code?
barpos Mar 30, 2011 1:29 PM (in response to kglad)Sorry, the following line of code was above the other code. I forgot to copy and paste it in here.
var buildingPix:Bitmap;
I'll try the debugger ...
Ron
-
3. Re: What's wrong with my code?
barpos Mar 30, 2011 1:34 PM (in response to kglad)Actually, the "permit debugging" option is already selected.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at WebsiteNew_fla::MainTimeline/displayStageObjects()[WebsiteNew_fla.MainTimeline::frame1:80 ]
at WebsiteNew_fla::MainTimeline/frame1()[WebsiteNew_fla.MainTimeline::frame1:57]Here's line 80:
buildingPix.scaleX = scaleW;
Here's line 57:
displayStageObjects(myStage.stageWidth, myStage.stageHeight);
It appears the displayStageObjects function does not get executed. Line 80 is within the function code.
Thanks!
Ron
-
4. Re: What's wrong with my code?
kglad Mar 30, 2011 1:42 PM (in response to barpos)i infer line 80 executes before loading is complete. that's the problem. fix that.
-
5. Re: What's wrong with my code?
dmeN Mar 30, 2011 1:46 PM (in response to barpos)>>It appears the displayStageObjects function does not get executed. Line 80 is within the function code.
No, the function get's executed... the error shows the call stack - line 57 called the function, and then an error occured on line 80, where buildingPix appears to be null. Follow kglads advice...
-
6. Re: What's wrong with my code?
barpos Mar 30, 2011 2:39 PM (in response to kglad)Makes sense! <s>
-



