I just log in here today and found this guest book tutorial. I would say this guestbook is really cool and what Iâm looking for. Thanks Flashmatazz
Still I have couple of questions about this guestbook. first, I saw the swf file of the guestbook is about 60kb, I just wondering what make it too big (I mean itâs only contain a few box,button and text right,I think 60kb too big for that)âŚis there a way to âshrinkâ the number (at least 20kb or less) ?
second question is, after the swf is load, it load the guestbook.xml content, I have put alot of entries for testing and it would take a while loading them (Iâm using dial-up)âŚis there a way so I could put a percentage preloader or may be a text like âloadingâŚâ to tell the viewer the content is being load?
AnywayâŚItâs a really really nice scripts (I think I could eleborate the function to do many thing else too)
// **** Load XML ****************************
//Put a play movie in here..... it will start playing just as the request is made to load the XML data
myXML = new XML();
myXML.ignoreWhite = true;
receiverXML = new XML();
myXML.onLoad = function(success){
myXML.contentType = "text/xml";
if (success){
this.showXML();
//Put stop/unload movie here once you know the XML file has been loaded.
}
else{
trace("Error loading XML file");
//You could tell a movie to play here saying that there has been a error if you wanted.
}
}
"; [color=red]myGuestbook.htmlText += this.firstChild.childNodes.firstChild.firstChild.nodeValue + â
â;[/color] [color=#ff0000][/color]
[color=red][color=#000000]And honestly, I donât really know how to solve this.[/color][/color]
[color=red][color=#000000]Anybody could help me on this ?[/color][/color]
[color=red][color=#000000][/color][/color]
[color=red][color=#000000]Thanks in advanceâŚ[/color]
We in the same boat Vulcan, I know nothing about XML too (just start to learn about it since this guestbook) I really really hope Flashmatazz could come up to solve thisâŚ
Ok, instead of using a new textnode, just use a new attribute.
assuming youâve created an input textfield called myEmail, within the sendButton.onRelease handler:
var myName = this._parent.nameField.text;
var myMessage = this._parent.messageField.text;
// emailfield
var myEmail = this._parent.emailField.text;
// etc.
It works! Youâre the man FlashmatazzâŚThank you very very muchâŚWhatâs the different between textnode and attribute? And thanks again to you too Vulcan
However, since we already have a node called âentryâ itâs a bit simpler to create an attribute for it to contain the email address, in the same way the ânameâ attribute is created.
Thank you very much Flashmatazz, thatâs help a lot though I guess Iâve to learn XML from zeroâŚI heard we could save/load images inside flash using XMLâŚdo you know any good tutorial on this one ?
Sorry to bother about this again Flashmatazz but regarding my earlier question, is any way to reduce the size of this guest book, In my server itâs indicate the swf file is more than 60kb, I wish to reduce it to at least half of it (30+kb is good enough)
add up to rinaazlin question, can it display âloading textâ first before it load XML. The_vulcanâs idea is great, but can it be done in other way? like put some text in flash AS.
Neo-Geo.
you can easily type a text like âloadingâŚâ or something inside the text field in the flash file. Just like that and the loaded guestbook.xml content will overwrite it. Off course vulcan suggest would be good tooâŚ
Is there any set-up with php and xml on my server before i try it? I canât seem to get it working. I have the html, php, xml, and the swf on my sever and they dont respond.