Note that there are some explanatory texts on larger screens.

plurals
  1. POError #1009: Cannot access a property or method of a null object reference
    primarykey
    data
    text
    <p>Working on this Flash AS3 application and I am keep getting this error when I try to make an <code>imgLoader</code> clickable.</p> <p>The imgLoader is a dynamic loader which will load an image from XML file and its created using ActionScript.</p> <p>This is the full error I get:</p> <pre><code>TypeError: Error #1009: Cannot access a property or method of a null object reference. at apptest_fla::MainTimeline/frame1()[apptest_fla.MainTimeline::frame1:65] at runtime::ContentPlayer/loadInitialContent() at runtime::ContentPlayer/playRawContent() at runtime::ContentPlayer/playContent() at runtime::AppRunner/run() at ADLAppEntry/run() at global/runtime::ADLEntry() </code></pre> <p>and this is the code for making the <code>imgLoader</code> clickable:</p> <pre><code>imgLoader.addEventListener(MouseEvent.CLICK, doSomething); function doSomething(event:MouseEvent){ nextFrame() </code></pre> <p>anyone knows why this is happening?</p> <p><strong>EDIT</strong></p> <p>This is my entire code:</p> <pre><code>stop(); import flash.display.Loader; import flash.events.Event; import flash.net.URLRequest; import flash.display.Sprite; import flash.filters.DropShadowFilter; var xmlLoader11:URLLoader; var xml11:XML; var uRequest11 = new URLRequest("my.xml"); xmlLoader11 = new URLLoader(uRequest11); xmlLoader11.addEventListener(Event.COMPLETE, onXMLLoad11); var imgLoader11:Loader; var nameLoader11:Loader; var myString11:String = 'loading'; function onXMLLoad11(e:Event) { xml11 = new XML(e.target.data); imgLoader11 = new Loader(); imgLoader11.contentLoaderInfo.addEventListener(Event.COMPLETE, onImgLoaded11); imgLoader11.load(new URLRequest(xml11.Data.Image.text()[0])); Nametxt11.text = "" + xml11.Data.Name.text()[0]; } function onImgLoaded11(e:Event) { addChild(imgLoader11); imgLoader11.height = 300; imgLoader11.width = 300; var bitmapContent11:Bitmap = Bitmap( e.target.content ); bitmapContent11.smoothing = true; addChild( bitmapContent11 ); bitmapContent11.height = 150; bitmapContent11.width = 150; bitmapContent11.y = 65; bitmapContent11.x = 85; } imgLoader11.addEventListener(MouseEvent.CLICK, doSomething); function doSomething(event:MouseEvent){ nextFrame() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload