Well I have finished the frame for my first website but in trying to add php & MySQL is a little more difficult
Request Entries
[AS]
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLLoader;
import flash.events.Event;
var variables_re:URLVariables = new URLVariables();
var varSend_re:URLRequest = new URLRequest(âguestbookParse.phpâ);
varSend_re.method = new URLRequestMethod.POST;
varSend_re.data = variables_re;
var varLoader_re:URLLoader = new URLLoader;
varLoader_re.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader_re.addEventListener(Event.COMPLETE,completeHandler_re);
function completeHandler_re(event:Event):void{
if(event.target.data.returnBody==""){
gbOutput_txt.text=âNo data coming through.â
}else{
gbOutput_txt.condenseWhite = true;
gbOutput_txt.htmlText = ââ+event.target.data.returnBody;
}
}
variables_re.comType = ârequestEntriesâ;
varLoader_re.load(varSend_re);
[/AS]
Send Entry
[AS]
import flash.text.TextFormat;
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
import flash.events.MouseEvent;
msg_txt.restrict = âA-Za-z 0-9â;
name_txt.restrict = âA-Za-z 0-9â;
location_txt.restrict = âA-Za-z 0-9â;
var errorsFormat:TextFormat = new TextFormat();
errorsFormat.color = 0xFF0000;
processing_mc.visible = false;
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest(âguestbookParse.phpâ);
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(event:Event):void{
processing_mc.visible = false;
name_txt.text = ââ;
location_txt.text = ââ;
msg_txt.text = ââ;
status_txt.text = event.target.data.returnBody;
gbOutput_txt.condenseWhite = true;
gbOutput_txt.htmlText = ââ + event.target.data.returnVody;
}
submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
function ValidateAndSend(event:MouseEvent):void{
if(!name_txt.lenght){
status_txt.text = âPlease enter your name.â;
status_txt.setTextFormat(errorsFormat);
} else if (!location_txt.lenght){
status_txt.text = âPlease enter your locationâ;
status_txt.setTextFormat(errorsFormat);
} else if (!msg_txt.lenght){
status_txt.text = âPlease enter a message.â;
status_txt.setTextFormat(errorsFormat);
} else {
processing_mc.visible = true;
variables.comType = âparseCommentâ;
variables.userName = name_txt.text;
variables.userLocation = location_txt.text;
variables.usrMsg = msg_txt.text;
varLoader.load(varSend);
status_txt.text = âWaiting for server connectionâŚâ;
}
}
[/AS]
hope someone can help
error codes
Symbol âGUESTBOOKâ, Layer âSEND.ENTRY.CODEâ, Frame 1, Line 32 1119: Access of possibly undefined property lenght through a reference with static type flash.text:TextField.
I got php code as well if you want that ⌠and yes I have set up the db on my webserver