Error #1009: Cannot access a property or method of a null object reference.
I have the following error, when i convert swf file to gfx using scaleform exporter,
Note that
I can call other functions to set the width or the position of the button or the ImageLoader and it works, Only SetImagePath fails, so I can use other function to access the ImageLoader and set it's position!
This has nothing to do with the fact that I am trying to pass a DDS file, I have this issue with JPG too, the code worked when I passed a JPG file in adobe animate but i get this error when I try to convert the swf to gfx using scaleform exporter
for now Adobe Animate won't let me load a dds file for some reason unlike AS2
[Warning] <Flash> The method LoaderInfo::sharedEventsGet() is not implemented [MyButton.gfx]
[Error] <Flash> TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.display::ProLoader instance constructor()
at fl.containers::UILoader/initLoader()
at fl.containers::UILoader/load()
at MyButton/SetImagePath()
at MyButton_fla::MainTimeline/SetImagePath() [MyButton.gfx]package
{
import flash.display.MovieClip;
import flash.events.Event;
import flash.net.URLRequest;
import fl.containers.UILoader;
import fl.display.ProLoader;
public class MyButton extends MovieClip
{
public function ButtonWithImage()
{
stop();
buttonMode = true
mouseChildren = false;
}
public function SetImagePath(newPath: String): void
{
ImageLoader.load(new URLRequest("img://TEXID:"+newPath));
}
}
}var newButton = new MyButton();
newButton.ImageLoader.addEventListener(Event.COMPLETE, OnCompleteHandler);
SetImagePath("test.dds");
function OnCompleteHandler(loadEvent:Event)
{
addChild(loadEvent.currentTarget.content);
}
function SetImagePath(newPath: String): void
{
newButton.SetImagePath(newPath);
}ImageLoader is a UI component, as you can see I have the loader in 3 the Image Layer and it span over 3 frames. adobe animate doesn't complain, it compiles and works, so why the gfx fails

so Any Idea how to fix "Error #1009: Cannot access a property or method of a null object reference. "
optional request how to load a dds file in AS3, in adobe animate, but this is low priority
