continuing on from waiting for godot:Introducing Depot
Originally posted by: Arsis
Try this:
- Create a new Fla in the Flash directory (and make sure the com directory is in there).
- Add the following script to the movie:
import com.snepo.depot.*;
url = "/testDir/subDir";
var PO = new Depot("localhost", 2323);
PO.onGet = myOnGet;
PO.onCreate = myOnCreate;
PO.onError = myOnError;
test = "this is a string";
PO.create(url, test, "a test object");
PO.get(url);
function myOnError(event:String, code:String) {
if (code == Errors.NOT_FOUND) {
createDirectory();
}
}
function myOnCreate(event:Object) {
trace("Data created");
}
function myOnGet(resultsIn:Array) {
for (var i = 0; i<resultsIn.length; i++) {
trace(resultsIn[i]);
}
}
I don't have an ide to test but it should create a directory, sotre a test string then retrieve the test string.
If this all works the run Depot Explorer.exe, click the servers tab and add a server at "localhost" port 2323. Click the xplore tab and should should see your depot instance and the new test data.
The more questions asked the better we can understand the issues.... so bring it on. smile
I now have updated FlashMX2004 from 7.0 to 7.2 and directories are setup as specified.
Depot Explorer is running, added a server, ip= localhost, port= 2323 and ..
in the Explore tab I see a dir named localhost. I can open and close it but don't see any test data.
When I click on the Perms tab the User Authentication panel is there asking me for admin password so Ill have to find that file mentioned earlier (or was it in the docs?), delete it and go from there.



