<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Common Flash Compiler Errors: #1009</title>
	<atom:link href="http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/</link>
	<description>wrangling the Internet's wildest</description>
	<lastBuildDate>Fri, 16 Dec 2011 14:20:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-16369</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Fri, 17 Dec 2010 23:41:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-16369</guid>
		<description>Hi Chris,

Check that there is a symbol (movieclip or button) on your stage on the frame that this code runs that is named &quot;mop1&quot; in the Properties panel. Although are you certain this is the code that is throwing the error? Look for some code that begins with:
&lt;code&gt;
function stopDrag...
&lt;/code&gt;
As it looks like that&#039;s where your error is being thrown (you have &quot;stopDrag1()&quot; in the provided code).</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Check that there is a symbol (movieclip or button) on your stage on the frame that this code runs that is named &#8220;mop1&#8243; in the Properties panel. Although are you certain this is the code that is throwing the error? Look for some code that begins with:<br />
<code><br />
function stopDrag...<br />
</code><br />
As it looks like that&#8217;s where your error is being thrown (you have &#8220;stopDrag1()&#8221; in the provided code).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christiano</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-16365</link>
		<dc:creator>christiano</dc:creator>
		<pubDate>Fri, 17 Dec 2010 21:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-16365</guid>
		<description>hello from greece!
i have a problem with this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at graph_fla::MainTimeline/stopdrag()

and this is my code:


stop();

import com.greensock.TweenMax;
import com.greensock.TweenLite;
import com.greensock.easing.Sine;

//-------------drag

mop1.addEventListener(\mouseDown\,drag1);
function drag1(e:MouseEvent):void{
mop1.startDrag(false);
}
stage.addEventListener(\mouseUp\,stopdrag1);
function stopdrag1(e:MouseEvent):void{
mop1.stopDrag();
}


//------------------Zoom


ZoomP1.addEventListener(\mouseDown\,zoom3);
function zoom3(e:MouseEvent):void{
TweenMax.to(mop1, 1, {scaleX:0.6, scaleY:0.6, ease:Sine.easeOut});
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeIn});
}
ZoomP2.addEventListener(\mouseDown\,zoom4);
function zoom4(e:MouseEvent):void{
TweenMax.to(mop1, 1, {scaleX:1, scaleY:1, ease:Sine.easeOut});
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeIn});
}
ZoomP3.addEventListener(\mouseDown\,dezoom4);
function dezoom4(e:MouseEvent):void{
TweenMax.to(mop1, 1, {scaleX:2, scaleY:2, ease:Sine.easeOut});
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeOut});
}
ZoomM.addEventListener(\mouseDown\,dezoom3);
function dezoom3(e:MouseEvent):void{
TweenMax.to(mop1, 1, {scaleX:0.355, scaleY:0.355, ease:Sine.easeOut});
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeOut});
}

what i do wrong?

please help me

kisses from greece
chris</description>
		<content:encoded><![CDATA[<p>hello from greece!<br />
i have a problem with this error:<br />
TypeError: Error #1009: Cannot access a property or method of a null object reference.<br />
	at graph_fla::MainTimeline/stopdrag()</p>
<p>and this is my code:</p>
<p>stop();</p>
<p>import com.greensock.TweenMax;<br />
import com.greensock.TweenLite;<br />
import com.greensock.easing.Sine;</p>
<p>//&#8212;&#8212;&#8212;&#8212;-drag</p>
<p>mop1.addEventListener(\mouseDown\,drag1);<br />
function drag1(e:MouseEvent):void{<br />
mop1.startDrag(false);<br />
}<br />
stage.addEventListener(\mouseUp\,stopdrag1);<br />
function stopdrag1(e:MouseEvent):void{<br />
mop1.stopDrag();<br />
}</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Zoom</p>
<p>ZoomP1.addEventListener(\mouseDown\,zoom3);<br />
function zoom3(e:MouseEvent):void{<br />
TweenMax.to(mop1, 1, {scaleX:0.6, scaleY:0.6, ease:Sine.easeOut});<br />
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeIn});<br />
}<br />
ZoomP2.addEventListener(\mouseDown\,zoom4);<br />
function zoom4(e:MouseEvent):void{<br />
TweenMax.to(mop1, 1, {scaleX:1, scaleY:1, ease:Sine.easeOut});<br />
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeIn});<br />
}<br />
ZoomP3.addEventListener(\mouseDown\,dezoom4);<br />
function dezoom4(e:MouseEvent):void{<br />
TweenMax.to(mop1, 1, {scaleX:2, scaleY:2, ease:Sine.easeOut});<br />
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeOut});<br />
}<br />
ZoomM.addEventListener(\mouseDown\,dezoom3);<br />
function dezoom3(e:MouseEvent):void{<br />
TweenMax.to(mop1, 1, {scaleX:0.355, scaleY:0.355, ease:Sine.easeOut});<br />
TweenMax.to(mop1, 1, {x:240, y:160, ease:Sine.easeOut});<br />
}</p>
<p>what i do wrong?</p>
<p>please help me</p>
<p>kisses from greece<br />
chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-5117</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 04 Nov 2009 15:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-5117</guid>
		<description>Ah, nevermind.  I didn&#039;t realize that it was a path.  I assumed that each line was an individual type error.  There&#039;s actually an additional line on top of that MovieClip/gotoAndPlay() location.  I just assumed it was linking to a separate issue, but I am in the middle of debugging that problem now as it relates to a separate issue I&#039;m having with a scrollbar code.  So, I will continue to work that out.  Thanks, your help is much appreciated!</description>
		<content:encoded><![CDATA[<p>Ah, nevermind.  I didn&#8217;t realize that it was a path.  I assumed that each line was an individual type error.  There&#8217;s actually an additional line on top of that MovieClip/gotoAndPlay() location.  I just assumed it was linking to a separate issue, but I am in the middle of debugging that problem now as it relates to a separate issue I&#8217;m having with a scrollbar code.  So, I will continue to work that out.  Thanks, your help is much appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-5115</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Wed, 04 Nov 2009 15:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-5115</guid>
		<description>Hi Adam,

This is actually the path it took to get to your error, so the error was triggered after the gotoAndPlay() method on frame20 of the intro animation. This is the only code in the intro animation? What code is on frame 3 of the main timeline?</description>
		<content:encoded><![CDATA[<p>Hi Adam,</p>
<p>This is actually the path it took to get to your error, so the error was triggered after the gotoAndPlay() method on frame20 of the intro animation. This is the only code in the intro animation? What code is on frame 3 of the main timeline?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-5111</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 04 Nov 2009 15:22:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-5111</guid>
		<description>Hey,

Well, it&#039;s actually coming from two different locations, it would seem:

at flash.display::MovieClip/gotoAndPlay()
at index.fla::Intro_5/frame20()

Frame 20 is where the action is located.  I have also tried to import flash.display.*; and import flash.events.*;
as I had seen that might be necessary on some other forums.</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>Well, it&#8217;s actually coming from two different locations, it would seem:</p>
<p>at flash.display::MovieClip/gotoAndPlay()<br />
at index.fla::Intro_5/frame20()</p>
<p>Frame 20 is where the action is located.  I have also tried to import flash.display.*; and import flash.events.*;<br />
as I had seen that might be necessary on some other forums.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-5110</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Wed, 04 Nov 2009 15:18:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-5110</guid>
		<description>Hi Adam,

What does the full error look like? Is it being thrown by the Intro Animation or the main timeline?</description>
		<content:encoded><![CDATA[<p>Hi Adam,</p>
<p>What does the full error look like? Is it being thrown by the Intro Animation or the main timeline?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-5109</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 04 Nov 2009 14:58:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-5109</guid>
		<description>Hi,

I&#039;m working with a movie clip that is on the main timeline.  It is an intro animation, located on Frame 2 of a 3-Frame Timeline.  Frame 1 being a preloader, and Frame 3 being the content of a website.  Here is my workflow:

Frame 1 - Preloader loads content --&gt; Frame 2 - Intro Animation movieclip plays.  When finished on the final frame, a gotoAndPlay code runs, telling it to go to --&gt; Frame 3 - Content.

The AS3 code, located within the Intro movie clip is simply:

MovieClip(parent).gotoAndPlay(3);

And I get the type error.  I have also tried running MovieClip(root) to no avail.  Any ideas on where my problem might lie?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m working with a movie clip that is on the main timeline.  It is an intro animation, located on Frame 2 of a 3-Frame Timeline.  Frame 1 being a preloader, and Frame 3 being the content of a website.  Here is my workflow:</p>
<p>Frame 1 &#8211; Preloader loads content &#8211;&gt; Frame 2 &#8211; Intro Animation movieclip plays.  When finished on the final frame, a gotoAndPlay code runs, telling it to go to &#8211;&gt; Frame 3 &#8211; Content.</p>
<p>The AS3 code, located within the Intro movie clip is simply:</p>
<p>MovieClip(parent).gotoAndPlay(3);</p>
<p>And I get the type error.  I have also tried running MovieClip(root) to no avail.  Any ideas on where my problem might lie?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Porter</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-963</link>
		<dc:creator>Mike Porter</dc:creator>
		<pubDate>Mon, 08 Jun 2009 11:23:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-963</guid>
		<description>Ans,
Many thanks for the reply. You&#039;re right - I think it&#039;s the way that &#039;simulate download&#039; is working here that confused me...I couldn&#039;t understand why the image was displaying as I had a stop(); on Frame 1...and had assumed it as something to do with the preloader code over-riding it some way. Now I can see that it is infact looping (ignoring the stop). Tthe trace(currentFrame) trick is very useful - will definitely add that to the armoury!  Again, your reply is much appreciated. Can be v.frustrating/time consuming trying to sort these things when your learning/working solo. 
Kind regards
Mike
P.S The soulofathens site is fabulous, both the way it looks and the content. Very inspiring in all sorts of ways. Haven&#039;t looked at everything yet but &#039;lost in plain sight&#039; is v.moving.</description>
		<content:encoded><![CDATA[<p>Ans,<br />
Many thanks for the reply. You&#8217;re right &#8211; I think it&#8217;s the way that &#8216;simulate download&#8217; is working here that confused me&#8230;I couldn&#8217;t understand why the image was displaying as I had a stop(); on Frame 1&#8230;and had assumed it as something to do with the preloader code over-riding it some way. Now I can see that it is infact looping (ignoring the stop). Tthe trace(currentFrame) trick is very useful &#8211; will definitely add that to the armoury!  Again, your reply is much appreciated. Can be v.frustrating/time consuming trying to sort these things when your learning/working solo.<br />
Kind regards<br />
Mike<br />
P.S The soulofathens site is fabulous, both the way it looks and the content. Very inspiring in all sorts of ways. Haven&#8217;t looked at everything yet but &#8216;lost in plain sight&#8217; is v.moving.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ans</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-958</link>
		<dc:creator>Ans</dc:creator>
		<pubDate>Sun, 07 Jun 2009 10:59:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-958</guid>
		<description>Interesting find. This seems like a bug in &quot;simulate download,&quot; since it doesn&#039;t show this behavior when tested in real-time. The reason bar_mc is null is that on the enter frame event where bytesloaded equals bytestotal the playhead has begun moving again, so it moves to frame 2, where bar_mc doesn&#039;t appear on the stage. It then loops back to frame 1, where bar_mc exists again. trace( currentFrame ); in your myprogress(.) function to see this, or place a stop(); on frame 2.</description>
		<content:encoded><![CDATA[<p>Interesting find. This seems like a bug in &#8220;simulate download,&#8221; since it doesn&#8217;t show this behavior when tested in real-time. The reason bar_mc is null is that on the enter frame event where bytesloaded equals bytestotal the playhead has begun moving again, so it moves to frame 2, where bar_mc doesn&#8217;t appear on the stage. It then loops back to frame 1, where bar_mc exists again. trace( currentFrame ); in your myprogress(.) function to see this, or place a stop(); on frame 2.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Porter</title>
		<link>http://blog.anselmbradford.com/2009/02/26/common-flash-errors-1009-cannot-access-a-property-or-method-of-a-null-object-reference/comment-page-1/#comment-947</link>
		<dc:creator>Mike Porter</dc:creator>
		<pubDate>Sat, 06 Jun 2009 10:08:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.anselmbradford.com/?p=661#comment-947</guid>
		<description>Anselm,
Thanks for this v.clear explanation. Wondered if you&#039;d come across anything like the following &#039;null&#039; problem:

I have a a MovieClip that flip flops between being a MovieClip and a null object. The following code is on Frame 1 of a .fla with the bar_mc movieclip pre-placed on the stage and a large bitmap on Frame 2 to provide something to preload. Running the swf via &#039;simulate download&#039; , the trace(bar_mc) function outputs MovieClip right up until the moment bytesloaded=bytestotal. Then it traces null. Then reverts to MovieClip. It works but I&#039;m intrigued to understand what&#039;s going on.

stop();

addEventListener(Event.ENTER_FRAME, myprogress);

function myprogress(e:Event)
{
var loaded = stage.loaderInfo.bytesLoaded;
var totalLoad = stage.loaderInfo.bytesTotal;

var loadedPercent = Math.floor((loaded/totalLoad) * 100);
trace (bar_mc);

if (loadedPercent == 100)
{
removeEventListener(Event.ENTER_FRAME, myprogress);
trace (loaded,totalLoad,bar_mc,root,loadedPercent);
}

if(bar_mc is MovieClip)
{
bar_mc.scaleX = loadedPercent/100;
}		
}</description>
		<content:encoded><![CDATA[<p>Anselm,<br />
Thanks for this v.clear explanation. Wondered if you&#8217;d come across anything like the following &#8216;null&#8217; problem:</p>
<p>I have a a MovieClip that flip flops between being a MovieClip and a null object. The following code is on Frame 1 of a .fla with the bar_mc movieclip pre-placed on the stage and a large bitmap on Frame 2 to provide something to preload. Running the swf via &#8216;simulate download&#8217; , the trace(bar_mc) function outputs MovieClip right up until the moment bytesloaded=bytestotal. Then it traces null. Then reverts to MovieClip. It works but I&#8217;m intrigued to understand what&#8217;s going on.</p>
<p>stop();</p>
<p>addEventListener(Event.ENTER_FRAME, myprogress);</p>
<p>function myprogress(e:Event)<br />
{<br />
var loaded = stage.loaderInfo.bytesLoaded;<br />
var totalLoad = stage.loaderInfo.bytesTotal;</p>
<p>var loadedPercent = Math.floor((loaded/totalLoad) * 100);<br />
trace (bar_mc);</p>
<p>if (loadedPercent == 100)<br />
{<br />
removeEventListener(Event.ENTER_FRAME, myprogress);<br />
trace (loaded,totalLoad,bar_mc,root,loadedPercent);<br />
}</p>
<p>if(bar_mc is MovieClip)<br />
{<br />
bar_mc.scaleX = loadedPercent/100;<br />
}<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

