Flash not loading some PNG files via Actionscript

I have a set of PNG files saved from a PHP script on a server. They work fine in the browser. I then try to open them in flash. If I import them in authoring it works fine. If I try to load them via loadMovie I get a solid red rectangle. I noticed that tehy are about 2 K. If I resave from fireworks (no changes) they are 33 K and then load fine. The odd thing is that the image data is there and works otherwise. ANy ideas as to how to force them to work dynamically?

As you said that PHP script on a server is actually creating PNG files which you are loading in flash using loadMovie.

I feel that flash is trying to load these files before it gets generated completely on server.
you shouldput a check to test if PNG file has been generated completed then start loading it inside flash.

I thought that too so I had it actually save it to the server and redirect instead. I even pointed directly to one of these manually after generation and it failed there too. The same file loaded in a browser works. I can also download that file from the browser or via FTP and load it into Flash in authoring and it works, but loading it via loadMovie brings in the red rectangle.

I experimented with Flash's bitmap scaling a bit as another option but it seems to be almost as poor as its scaling of movie clips. I need a smooth bicubic style scaling that looks clean and anti-aliased.

The odd thing is that some of them do work. IE the letter "B" works while "A" does not.
Also, manually loading the same PNG into Flash in authoring does work. I think its some sort of bug in how it parses PNG files with load movie. I'll keep searching for alternatives.

Do you know of any way to get this better and smoother scaling via Flash's bitmap commands? That was my first approach but it seems to not dither correctly so the edges of high contrast colors look very blocky.

I found a bit of a work around but doing the scaling in the Flash file with bitmap objects. I load the base PNG that did work, then make a new bitmap object, then put that back in where the clip was using attach bitmap with smoothing set to true. Its not as nice as the PHP scaling for anti-aliasing but is enough to pass for this project.

Yes, its Flash 8. As far as I can tell the simplified PNG files created by the script are just not read by flash via dynamic loading. It apparently is looking for more info (maybe in the header, etc) than its getting. Other apps read the files fine but not Flash. I have a work around using hte bitmap scaling inside of flash but it took a little setup to get it to work. Still not ideal but workable for this project.

Well, if you open the same 11K image in Fireworks and resave its back to 33K. I think Fireworks and other apps use extra header info, or may use things like 0 in place of null characters for empty pixels. Just a guess, but that might also explain why Flash does not like some images. If the lat few bits were null it may see it as an invalid image or partial file. For import in authoring it would not matter as it can see the entire file length.