0
votes

Users upload images and select a template AS3 file, which would be used together with the images to compile into a SWF and be downloaded by the user.

Basically, use my own custom animations with the user's resource files in order to compile a new SWF at run-time.

I found a tool called "swftools", which can convert images into a slideshow, so I know something like this is partly feasible, I just don't know enough about AS3 to know how to load resources dynamically, without creating a FLA file manually.

EDIT: To clarify, I do not want to dynamically load an image from a URL or file at run-time. I want to embed the image into the SWF, but the image data is decided at compile-time.

2
That loads an external image at run-time. I need to embed an external image into the SWF at compile time. The SWF must be a standalone file.user1825066
You can't access the user's hard drive since it'll cause a sandbox violation. You can always host a server and go from there. See here for more info: help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/…David

2 Answers

2
votes

Same problem here, and I found some great tuts that show how it's done, but (unfortunately) in AS2 (not AS3):

loading images

The code to convert:

loadMovie("photo.jpeg",photo.empty);

loading text

The code to convert:

myData = new LoadVars();
myData.onLoad = function () {
  myText_txt.text = this.myVariable;
};
myData.load("myText1.txt");

AS2 to AS3 is very poorly documented, even for small scripts…

If you have a solution I'd like to know it ;-)

1
votes

Use Flex and compc compiler. http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fd2.html You can modify as3 sources on server and embed your images with [Embed(source='path/file.ext')] directive, run compc and get final swf...