Welcome, Guest. Please login or register.
Did you miss your activation email?
05/21/12, 03:15
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Recent Tutorial Support
| |-+  Flash GuestBook Support (Moderators: Flash-db, vesa kortelainen, Ronald Wernecke, Mohsin Sumar, Jorge Solis)
| | |-+  guestbook v2 to flash mx
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: guestbook v2 to flash mx  (Read 6188 times)
3Pinter
Server what's that
*
Posts: 4



View Profile WWW Email
« on: 12/30/04, 05:05 »

Well, first of all.

I'm new to this forum. hello to you all!



I've been searching for a good guestbook for ages. Well. Guestbook v2. looks nice ... especially the use of mysql.

BUT:

I use flash MX ... not 2004 ...

Is there a way I convert this file without messing or corrupting the AS2 ??


Why I don't use guestbook 1... > it's flash 5 based. I can't get it to work when I load it into another .swf.


Thnx already
Logged

+ You age in the eyes of others +
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #1 on: 12/30/04, 06:09 »

Hi, and welcome to the boards.

You should, more or less, get the V2 running under Flash MX (6) too.

If you know how to query a database, it should not be a problem at all, to create a guestbook of your wishes.

In doubt, look at the load and save tutorial - and if you still get stuck, post your questions here.

Good luck
Logged

happy flashing
Cool
Ronald
3Pinter
Server what's that
*
Posts: 4



View Profile WWW Email
« Reply #2 on: 12/30/04, 07:56 »

Well,


I've found somehting .. a bit futher in your topics..

http://www.flash-db.com/Board/index.php?board=12;action=display;threadid=9835;start=0

This one is more like it. Except his problem is quite strange... I'm trying to figure it out.

Perhaps anyone else has a clue (look at his fla)

Logged

+ You age in the eyes of others +
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #3 on: 12/30/04, 08:40 »

Hi again,
what exact problem are you facing?

In that example you gave, it was a problem of scope and paths inside of flash.
This is a problem comming up very often Wink

How experienced are you? Do you use the guestbook inside of a construction with several movieclips? is the server backend running ok? do you use loadVars object?
Logged

happy flashing
Cool
Ronald
3Pinter
Server what's that
*
Posts: 4



View Profile WWW Email
« Reply #4 on: 12/30/04, 09:12 »

Well,

How experienced are you?
average... I guess... maybe average++

Do you use the guestbook inside of a construction with several movieclips?
I have main.swf which loads guestbook.swf using loadmovie.

is the server backend running ok?
Yes. the guestbook is working just fine.

do you use loadVars object?
yes.


------------------------
guestbook.fla:

two mc's:
read
write
------------------------
    write mc ... as1 on frame 1.
yourname, youremail, yourcomments are inputfields' instancenames.

   
Code:
submit.onRelease = function() {
   //
   // Modify these reference paths to yours if you
   // have changed them. Also modify gb_status
   // reference path if required
   //
   yourname = yourname.text;
   youremail = youremail.text;
   yourcomments = yourcomments.text;
   // Check variable data
   if (yourname eq "") {
       gb_status.text = "Vul je naam in";
   } else if (youremail eq "") {
       gb_status.text = "Vul je e-mail adres in";
   } else if (!youremail.length || youremail.indexOf("@") == -1 || youremail.indexOf(".") == -1) {
       gb_status.text = "Dit is geen geldig e-mail adres";
   } else if (yourcomments eq "") {
       gb_status.text = "Je hebt nog geen bericht ingevuld";
   } else {
       gb_status.text = "Een ogenblik...";
       newEntry = new LoadVars();
       newEntry.ref = this;
       newEntry.submit = "Yes";
       newEntry.yourname = yourname;
       newEntry.youremail = youremail;
       newEntry.yourcomments = yourcomments;
       newEntry.sendAndLoad("GuestBook.php?action=write&r="+random(999), newEntry, "POST");
       newEntry.onLoad = function(success) {
// not working
           _parent.write.yourname.text = "";
// not working
           _parent.write.youremail.text = "";
// not working
           _parent.write.yourcomments.text = "";
// not working
           if (success) {
               // Clear fields
               _parent.write.yourname.text = "";
// not working
               _parent.write.youremail.text = "";
// not working
               _parent.write.yourcomments.text = "";
// not working
               _parent.write.gb_status.text = this.gb_status;
// not working
               _parent.read.loadEntries("Default", 10);
           }
       };
   }
};
wissen.onRelease = function() {
// works
   _parent.write.yourname.text = "";
// works
   _parent.write.youremail.text = "";
// works
   _parent.write.yourcomments.text = "";
};




What has to happen:

when you press 'submit button' it sends the message (works just fine!!) but it should also 'reset' the inputfields.
This isn't happening. If you give the 'yourname, youremail etc' a var-name you can 'reset' it but still it says 'vul je naam in' (which is Dutch for: enter your name).


That's my problem now...

It's quit a different topic now, I agree.
Logged

+ You age in the eyes of others +
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #5 on: 12/30/04, 09:43 »

OK, now its a little more clear Wink

NEVER use the same name for two different things Wink

you have an instance of a textfield called yourname, and in the same procedure you have a variable yourname.

You dont need that variable. You can assign the textfield directly to the loadVars variable.

Logged

happy flashing
Cool
Ronald
3Pinter
Server what's that
*
Posts: 4



View Profile WWW Email
« Reply #6 on: 12/30/04, 11:23 »

SOLVED!!  Cheesy


How stupid of me overlooking that... aarghh!!

I've changed it. Maybe is there a better / shorter way of actionscripting it Ronald Wernecke?

Anyhow tnx a lot!

Code:
submit.onRelease = function() {
   //
   // Modify these reference paths to yours if you
   // have changed them. Also modify gb_status
   // reference path if required
   //
   naam = yourname.text;
   email = youremail.text;
   comments = yourcomments.text;
   // Check variable data
   if (naam eq "") {
       gb_status.text = "Vul je naam in";
   } else if (email eq "") {
       gb_status.text = "Vul je e-mail adres in";
   } else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
       gb_status.text = "Dit is geen geldig e-mail adres";
   } else if (comments eq "") {
       gb_status.text = "Je hebt nog geen bericht ingevuld";
   } else {
       gb_status.text = "Een ogenblik...";
       newEntry = new LoadVars();
       newEntry.ref = this;
       newEntry.submit = "Yes";
       newEntry.yourname = naam;
       newEntry.youremail = email;
       newEntry.yourcomments = comments;
       newEntry.sendAndLoad("GuestBook.php?action=write&r="+random(999), newEntry, "POST");
       newEntry.onLoad = function(success) {
           _parent.write.yourname.text = "";
           _parent.write.youremail.text = "";
           _parent.write.yourcomments.text = "";
           if (success) {
               // Clear fields
               yourname.text = "";
               _parent.write.youremail.text = "";
               _parent.write.yourcomments.text = "";
               _parent.write.gb_status.text = this.gb_status;
               _parent.read.loadEntries("Default", 10);
           }
       };
   }
};
wissen.onRelease = function() {
   _parent.write.yourname.text = "";
   _parent.write.youremail.text = "";
   _parent.write.yourcomments.text = "";
};
Logged

+ You age in the eyes of others +
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything