-
Remember, this is using a server technology that can only be tested on a server that supports PHP. I'll see if I can get around to uploading the file later today.
-
Originally Posted by Taidaishar
Remember, this is using a server technology that can only be tested on a server that supports PHP. I'll see if I can get around to uploading the file later today.
yeh.. i upload the php files to my server and i assigned the path /// the problem is with the components i have to use..for example which component shud i use to upload the mp3 file ?
and to edit the xml... shall i put a text field ? these are my few questions..thats y im asking u for the fla file
Thanks in advance !
-
problem...
I can't find the file... my work laptop just recently crashed and I had a backup, BUT the backup was made BEFORE I made this file.... so now I've lost it... which is bad news for me AND you.
I'll see if I can give you a bit more explanation through a bit more commenting:
PHP Code:
// Set the URL for the PHP uploader scripts
var myUrl:URLRequest = new URLRequest("writeit2.php");
var url2:URLRequest = new URLRequest("putFile.php");
//reads in the current XML document in order to add to it
function readXML():void
{
//xmlText.text = "reading xml file";
var vers:* = new Date().getTime();
var myLoader:URLLoader = new URLLoader();
myLoader.addEventListener(Event.COMPLETE, xmlLoaded);
myLoader.load(new URLRequest(path+"songs.xml"));
};
// Function that fires off when the user presses the "done" btn... begins the process of uploading the MP3 file
function uploadVars(e:MouseEvent):void
{
//mcSermonsPage is just a movieclip that contained all my components, text fields and OTHER movie clips.
//mcBlocker is just a movieclip that covers up the preloader until someone hits the done button
mcSermonsPage.mcBlocker.visible = false;
fileRef.upload(url2);
//btnDone is a button that starts the upload process and this makes it invisible once it's clicked
mcSermonsPage.btnDone.visible = false;
readXML();
}
//called when the current XML document is loaded and ready for addition
function xmlLoaded(e:Event):void
{
//This runs if you're uploading a file for the first time... otherwise it skips it so as not to overwrite data previously added to the XML file
if(runCount <= 1)
{
myXML = new XML(e.target.data);
list = new XMLList(myXML);
}
var node:XMLNode = new XMLNode(1, "song")
var urlNode:XMLNode = new XMLNode(1, "url");
//txtFilename is an input text field that contains the "URL" data that is to be appended onto the XML file
var urlText:XMLNode = new XMLNode(3, "sermons/"+mcSermonsPage.txtFilename.text)
urlNode.appendChild(urlText);
node.appendChild(urlNode)
var preacherNode:XMLNode = new XMLNode(1, "preacher");
//txtSpeaker is an input text field that contains the "preacher" data that is to be appended onto the XML file
var preacherText:XMLNode = new XMLNode(3, mcSermonsPage.txtSpeaker.text)
preacherNode.appendChild(preacherText);
node.appendChild(preacherNode)
var dateNode:XMLNode = new XMLNode(1, "date");
//txtDate is an input text field that contains the "date" data that is to be appended onto the XML file
var dateText:XMLNode = new XMLNode(3, mcSermonsPage.txtDate.text)
dateNode.appendChild(dateText);
node.appendChild(dateNode)
var titleNode:XMLNode = new XMLNode(1, "title");
//txtTitle is an input text field that contains the "title" data that is to be appended onto the XML file
var titleText:XMLNode = new XMLNode(3, mcSermonsPage.txtTitle.text)
titleNode.appendChild(titleText);
node.appendChild(titleNode)
//fyi, all of the text fields mentioned previously were on the mcSermonsPage movie clip
list.appendChild(node);
};
// Function that fires off when the MP3 File is selected from PC and Browse dialogue box closes
function syncVariables(e:Event):void
{
//txtFilename is a textbox that holds the filename of the file chosen in the browse box (fileref)
mcSermonsPage.txtFilename.text = "" + fileRef.name;
mcSermonsPage.btnDone.visible = true;
//mcProgress is a movie clip used for a preloader
mcSermonsPage.mcProgress.width = 1;
var variables:URLVariables = new URLVariables();
variables.body = myXML;
url2.data = variables;
url2.method = URLRequestMethod.POST;
}
// Function that fires off when the upload of the MP3 file is complete... this function uploads the XML
function completeHandler(e:Event):void
{
myUrl.method = URLRequestMethod.POST;
myUrl.data = myXML;
myUrl.contentType = "text/xml";
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(myUrl);
xmlLoader.addEventListener(ProgressEvent.PROGRESS, xmlProgress);
}
-
Erros :S
got sum erros..working on them... !
Last edited by g2gayan; 11-04-2009 at 03:34 AM.
Reason: zz
-
Last edited by g2gayan; 11-04-2009 at 03:33 AM.
Reason: my stupidity
-
I didn't think about decompiling the SWF file. Yeah, I'll zip it up and attach it in a few minutes.
-
-
PHP Code:
if(runCount <= 1)
{
myXML = new XML(e.target.data);
list = new XMLList(myXML);
}
where did you define runcount?
-
also I'm getting a
1120: Access of undefined property myXML. " myUrl.data = myXML; "
and were
myXML = new XML(e.target.data);
list = new XMLList(myXML);
defined somewhere else?
i changed it to
var myXML = new XML(e.target.data);
var list = new XMLList(myXML);
but havent been able to test because of that error.
Could anyone help?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|