A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Altering Sample Guest Book

  1. #1
    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

  2. #2

    Making progress

    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

  3. #3
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    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

  4. #4

    Server Side

    Do you have any idea how I would call that function on the server?

    Chris

  5. #5

    Deleting an item off the Flashcom server

    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);
    }
    };

  6. #6
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center