PDA

Click to See Complete Forum and Search --> : Altering Sample Guest Book



faeryking
09-19-2002, 04:23 PM
I want to delete recorded entries from the guestbook. I have created a delete button next to each entry but I am not sure how to hook up the button.

This piece of code reads all the data off the server:

function doRefresh() {
//trace("Refreshing panel");

_root.doCountEntries();
// look in the library for "myArray" for the code of doPopulate()
_root.myPane.getScrollContent().doPopulate();
}

The function I have started is as follows:

function doDelete() {
s = Stream.get("foo");
if (s){
s.onStatus = function(info){
if(info.code == "NetStream.Clear.Success"){
trace(info.description);
}
if(info.code == "NetStream.Clear.Failure"){
trace(info.description);
}
};
s.clear();
}
}

I an not sure how I get the button to hold the value of the record and then seend it to the function.

Any help would be greatly appreciated!

Chris

faeryking
09-20-2002, 03:21 PM
So I have added the delete button under the weblogentry symbol and named it delete_button that calls the function doDelete.

Now i just have to figure out how I get that button to hold the number of the item I want to delete within the delete button function.

Any suggestions?

Chris

psychlonex
09-20-2002, 05:43 PM
I don't think clear works from the client end. You'll have to set it up on the server-side, and then call it from there?

psx

faeryking
09-20-2002, 05:49 PM
Do you have any idea how I would call that function on the server?

Chris

faeryking
09-20-2002, 06:41 PM
Here is code I pulled out of the sample panel presentation which deletes slides off the server. Is this calling a server-side script, or doing it directly? Because I want to just have flash ask the server to delete and item directly.

// Sends a call to the server to remove a slide
FCTextPresentationClass.prototype.deleteSlide = function() {
if (this.speakerMode) {
this.nc.call(this.prefix + "deleteSlide", null);
}
};

psychlonex
09-21-2002, 04:06 PM
That code is calling a "deleteSlide" method on the server. You may be able to do something like:

this.nc.call(this.prefix + "clear", null);

but I have no idea if it will work. I seem to doubt it, as I think the only methods you can call are those defined on the server side. Actually a nice feature , that the client can't delete a stream without asking the server to do it.

Psx