Welcome, Guest
  • Author Topic: guestbook works only in guestbook.html and not in full flash site  (Read 5275 times)

    Sandy

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    Hello,

    I got the guestbook to work.
    The problem is that it only works in GuestBook.html and not in the full flash site that I built  >:(.
    The full flash site uses only one html file called index.htm. The button link to the guestbook is also pointing to the directory where the guestbook is located and I cant figure out why it is not reading within flash.

    Is there a way to have the guestbook to work within a full flash site and not as a separate page?


    Thanks.

    vesa kortelainen

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 3450
      • View Profile
    Hi Sandy,

    How do you call the guestbook.swf..with LoadMovie?

    If so, then the paths ain't matching because default is _root.GB_MovieClip_Instance but when using Loadmovie, it will be _level1.GB_MovieClip_Instance but Actionscripts are trying to target for "_root.GB_MovieClip_Instance" .that's the reason why GuestBook can't communicate with PHP.
    « Last Edit: 02/20/05, 16:03 by vesa kortelainen »

    Sandy

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    hello I not good at hiearchy or actionscript, maybe you can help.

    Here is the code on my submit button:
    //GuestBook = name of the .swf file
    //EnterData = movie clip that contains the sign up info

    on (release) {
       if (Name eq "") {
          _level1.GuestBook_EnterData.Status = "Please enter your name";
       } else if (Email eq "") {
          _level1.GuestBook_EnterData.Status = "Please enter email Address";
       } else if (Website eq "") {
          _level1.GuestBook_EnterData.Status = "Please enter the URL to your website";
       } else {
          Submit = "Yes";
          NumHigh = 10;
          NumLow = 0;
          _level1.GuestBook_EnterData.GuestBook = "Processing..   Loading New... ";
          loadVariables ("GuestBook.php", 1, "POST");
          _level1.GuestBook_EnterData.Status = "Your entry has been submitted.  You should see your comments appear immediatly";
          gotoAndStop (2);
       }
    }



    //Also on the home page where all the links are, for the guestbook button: I have this code

    on (release) {
       _root.contents.loadMovie ("GuestBook/GuestBook.swf");
    }

    //"Contents" is the container clip for all of my pages.

    Sandy

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    i changed the location of the sign in info and placed it on the main timeline to avoid any confusion. So "EnterData" can be removed if needed in heiarchy.

    vesa kortelainen

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 3450
      • View Profile
    in guestbook, replace _level1 with "this" (or if it doesn't work, then  _root.contents , as you said:
    "Contents" is the container clip) :)

    Give also look for Dowload FLA that will run when loaded into any level or MC......, it's an modified version of the Guestbook, by BurtonRider.
    « Last Edit: 02/20/05, 18:41 by vesa kortelainen »

    Sandy

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    ok, thanks, I tried to redo the code but it still doesnt work.
    I will download to see if that helps, if not I would like make it happen somehow.

    Thanks again.

    Sandy

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
     :o I got it to work!!!

    The download didnt help my situation, but I thought that I should post this info and maybe it will help save someone else's time.

    In GuestBook.fla, I placed all the contents of the "EnterData" mc to the main Timeline.
    So Basically, this will eliminate the need for unecessary movie clips.

    On the submit button I placed this bit of code:
    ================================================================
    on (release) {
       if (Name eq "") {
          Status = "Please enter your name";
       } else if (Email eq "") {
          Status = "Please enter email Address";
       } else if (Website eq "") {
          Status = "Please enter the URL to your website";
       } else {
          Submit = "Yes";
          NumHigh = 10;
          NumLow = 0;
          GuestBook = "Processing..   Loading New... ";
          loadVariablesNum ("GuestBook.php", 0, "POST");
          Status = "Your entry has been submitted.  You should see your comments appear immediatly";
          gotoAndStop (2);
       }
    }
    ================================================================

    Then I edited "GuestBook.php"

    *Special Thanks to someone who posted this bit of info:
    This is what my code looks like, "contents" is my container clip for all pages with in flash, replace contents with whatever name you are using.

    =================================================================
    look for line 79:
    print "&_root.contents.TotalEntries=$NumEntries&_root.contents.NumLow=$NumLow&_root.contents.NumHigh=$NumHigh&_root.contents.GuestBook=";

    =================================================================

    Now my scrollbar doesnt work  ;) but I can manage that one, I think.

    francisco_g

    • Server what's that
    • *
    • Posts: 1
      • View Profile
      • Email
    Thanks sandy! you solved  my PHP problem  ;D So here's how I fixed the scroll bar:
    All you need to do is bring up the actionscript for the scrollbar on the main (guestbook.fla) timeline... look for


    onClipEvent (enterFrame) {
       if (dragging == true) {
          _root.GuestBook.scroll = 1+int((_y-top)*50/(300-_height));
       }

    and change it  to:

    onClipEvent (enterFrame) {
       if (dragging == true) {
          _root.MC.GuestBook.scroll = 1+int((_y-top)*50/(300-_height));
       }

    where MC is the name of the clip where guestbook.swf is loaded to. on your main site. I hope this helps.  :)

    On a side note, do you notice that when the scroll bar does work, the boundries are all glitchy.  Specifically, after the bar is moved, if you try to use the up button the bar will scroll past its intended boundry and if you use the down button it will only move down about half way and then stop. I havent touched any code aside from whats above, so I'm sure someone else has seen this.  Any ideas?

    Sandy

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    Hello, Im glad that I was able to assit you.
    I have been really busy this week and will edit the scroll bar when I have the chance. When I get to that part, I will post some info.