PDA

View Full Version : Importing JPGs,PNGs,etc.


pdarley
09-22-2006, 04:52 PM
Is there a way to import other file types other than SWF files? For example, can we import a PNG or JPG into the FLA file using JSAPI?

Or is there's no such way?

SkyNarc
09-22-2006, 05:04 PM
Same way you do a normal swf file using loadMovie....

pdarley
09-22-2006, 05:29 PM
This is what I know
fl.getDocumentDOM().importSWF(fl.configURI+"swfFile.swf");

But using the loadMovie idea, I am not sure where to place it in the code. Something like this?

fl.getDocumentDOM().loadMovie(fl.configURI+"jpgFile.jpg");

bigevilbrain
09-23-2006, 03:23 AM
I think you're looking for importFile.

http://livedocs.macromedia.com/flash/8/main/00004467.html

var dom = fl.getDocumentDOM();
var URI = fl.browseForFileURL("select", "Import File");
dom.importFile(URI);

pdarley
09-25-2006, 04:05 PM
Yes that is what I was looking for. Unfortunately I do not have Flash 8. I am stuck with 7 for the time being.

Thanks for the help guys.