This content has been marked as final. Show 12 replies
imageLoader.load(urlReq); // get it
addChild(imageLoader); // display it
Maybe you have to wait until you are sure the image has been loaded, i.e. when the event "complete:Event" happens.
thanks for your answer. I am using the commands exactly as you are suggesting and also wait until Event:COMPLETE. Callin g the class directly from a Flash Document shows the pictures and calling the class from another class does not show the picture. Maybe the mistake lies in the way I am calling the DiaShow class from an other class?
you're adding imageLoader to diaShow and it doesn't look like diaShow is in the display list so imageLoader isn't going to be in the display list.
to remedy, you might want to pass a display object (like the stage) to your disShow class and attach imageLoader to that display object. or create a global reference to the stage so you can access the stage from diaShow.
I am afraid you know more than me but I am curious.1 person found this helpful
Have a look at this error checking...
You say the trace is working, so the function is called.
Why is there a forward slash here: "/prev" + i +".jpg" ?
I just tried it.1 person found this helpful
With the forward slash the loader reports an error in the debugger.
Under the variable imageLoader there is a property contentLoaderInfo and that reports exception thrown by getter.
Without the slash it works okay.
thanks for your answer. I tried:
var container:Sprite = new Sprite();
var container:CustomDisplayObject = new CustomDisplayObject();
both doesn't work. any other suggestion?
unfortunately also without slash I have the same problem, any other suggestions
if the path/file name were incorrect you should be getting an i/o error. i assume you're not or you would have indicated that was a problem.1 person found this helpful
are you adding container to a display object? ie, trace(container.root) returns the main timeline?
do you mean that I need to create a container in the calling class and pass it on to the called class? If so, how do I do that?
thanks for your help
no, i mean you can't just use addChild() and expect that something's going to be added to the display list UNLESS the addChild() statement is made within the scope of a display object.
and i doubt you're within the scope of a display object. you can test that by use trace(container.root) after your addChild(container) statement and see if you're getting the main timeline. are you?
thanks for your help, the problem is solved, with your suggestions you got me on the right track:
Class CallSwf1 calls class Swf1
Class Swf1 loads the .jpg and uses addChild();
Class CallSwf1 uses also addChild() referring to the called class Swf1