0
votes

I built an AS3 image gallery using FlashDevelop.

Before I zip up the application, I can run the image gallery in my browser by simply opening the index.html for the project. Everything works perfectly.

I then zip up the project as proj-0.1.2.zip using winrar.

I then unzip this newly created zip and try to load the application using the project index.html like above. The gallery doesn't function properly. From seeing what happens, it appears as though the image metadata is not present(but I'm not sure, see below).

There are other applications as well that are broken. Videos don't load. If an application doesn't depend on any external assets then everything looks fine.

Another thing..If I then build the FlashDevelop project and republish the swf..then it works in the index.html like I want. What is going on here?

I want people to be able to fire up my demo apps out of the box by just running the index.html. If that doesn't always work and they have to figure out that they need to rebuild the SWF then that's pretty bad.

1
To summarize: when I zip and then unzip a flashDevelop swf, that swf can no longer correctly load external files. After the zip & unzip my video player and image gallery are broken. I must rebuild the flashDevelop swf in order for it to work again. I converted one of the flashDevelop apps to a flash CS3 app and the Flash CS3 version does not have this problem. Why does flashDevelop have this problem?Ryan

1 Answers

1
votes

I don't think zipping is the problem, I think moving to a different folder is a problem.

I assume you are running this index.html on your local PC, and not on a webserver?

By default, Flash cannot access from a local SWF to load other local files. However, FlashDevelop / Flash CS3 / Flex Builder, in order to get around this restriction, set some flags in the flash player telling him "This SWF is a trusted SWF, allow him to open local files". But it's based on the exact location of the SWF.

There's a setting somewhere in the compiler, that sets a flag in the SWF saying "This SWF can access local data", but there's one downside: It blocks all access to network resources. So it's either/or: access local data, OR access network resources (anything that goes over HTTP, Socket, etc). I'm not sure where this setting is offhand. It may be that the default setting for Flash CS3 is different than the default setting for FlashDevelop.

Anyway, the easy way to avoid all this issue is to not run the file locally. Put it on your webserver before testing.