
Originally Posted by
sankalpgarud98
Hey, why dont you try to load that file not by using action script but by using flash itself. I dont remember the name now, but its something like uiloader properties or somewhere along those lines. If that files successfully loads, then you may have problem with the script, I know uve tested with another file.I probably think that you are trying to load a file which isnt supported by the UI loader.
cheers mate, you just refreshed my memories with flash coz Ive left it this year to devote more time in academics.
Thx
Okay, that sounds like an idea to test what's what. I've created a new Flash file, and just put a UILoader straight in, and defined it without any AS. This was done by clicking it, going to the Component Inspector, and manually entering in the file to load. I tested this on the image, which works fine. I've then tested this on a newly created SWF file that simply has scribbles on, and that shows up fine. When loading both of the SWF files as before, neither was working. Therefore it must be the scripting in them.
To determine what it didn't like, I copied over assets across from instruments.swf bit by bit to the SWF that did work, starting with the button, and then parts of the code itself. The strange thing is that I copied everything across, and that file works! I then did the same for paint.swf, and the same results appeared! When I loaded them into the original uiloader.fla/swf, they actually worked!
Well... one at a time. When I ran it, it will load one up fine, and then when you proceed to view the next one, you get errors like this:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at noAS_test_fla::MainTimeline/startDrawing()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at noAS_test_fla::MainTimeline/stopDrawing()
If you went to re-launch the movie and click the second one first, that will load up fine... but the first one wouldn't! I'm guessing that's due to the EventListeners for the previous clip is still being called, as I'm still able to draw when I click "Instruments".
It's a shame you can't have destructor that get automatically called, like in C++. I could have used such a thing to automatically remove the listeners.
Thanks for suggesting your method! Looks like a bug to me, but I suppose I'll have to live with it...