Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 08-02-2006, 02:21   #1 (permalink)
Neuer User
 
Registriert seit: Nov 2005
Beiträge: 15
How to load XML?

We can send xml to http server like this:
Code:
var my_xml:XML = new XML("<highscore><name>Ernie</name><score>13045</score></highscore>");
my_xml.contentType = "text/xml";
my_xml.send("http://www.flash-mx.com/mm/highscore.cfm", "_blank");
But how can I get the XML information in Http server?

Thanks!
lantian329 ist offline   Mit Zitat antworten
Alt 08-02-2006, 04:28   #2 (permalink)
Techniker
 
Benutzerbild von hgseib
 
Registriert seit: Sep 2003
Ort: 64807
Beiträge: 16.322
make sendAndLoad to PHP
Code:
var my_xml:XML = new XML("<highscore><name>Ernie</name><score>13045</score></highscore>");
my_xml.ignoreWhite = true;
my_xml.onLoad = myOnLoad;
my_xml.sendAndLoad("your.php", my_xml);
function myOnLoad(success:Boolean) {
	if (!success) {
		// fac
	} else {
		// ok
	}
}
PHP-Code:
<?php
$back
="";
foreach (
$_POST as $elem)
{    
$back.=$elem;
}
echo(
stripslashes($back));
?>
__________________
die ultimative antwort auf alle programmierfragen: der debugger
mfg h.g.seib www.SeibsProgrammLaden.de
hgseib ist offline   Mit Zitat antworten
Alt 08-02-2006, 05:41   #3 (permalink)
Neuer User
 
Registriert seit: Nov 2005
Beiträge: 15
Thanks

Thangk you hgseib .

Could tell how to receive xml information in coldfusion 7 server?

Thx!
lantian329 ist offline   Mit Zitat antworten
Alt 08-02-2006, 07:18   #4 (permalink)
Supermassive
 
Benutzerbild von elysian
 
Registriert seit: Aug 2004
Ort: Frankfurt, Bornheim
Beiträge: 861
hi, best practice to do so is to use flashRemoting. we had this question a couple of days ago, so maybe this helps you out.
although it's written german, you maybe come along with the examples. if you don't, tell me and i'm going to translate some stuff for you.

greetings, elsyian.
__________________
Personal » amenity*blogging » elysian.de » Flexpertise - Enterprise Flex Collaboration
Networks » Xing » ColdFusion Community
Everything Cairngorm »
cairngormdocs.org
elysian ist offline   Mit Zitat antworten
Alt 08-02-2006, 07:31   #5 (permalink)
Neuer User
 
Registriert seit: Nov 2005
Beiträge: 15
Thanks

Great!
Thank you very much,elysian!

But this script can run well.

var my_xml:XML = new XML("<highscore><name>Ernie</name><score>13045</score></highscore>");
my_xml.contentType = "text/xml";
my_xml.send("http://www.flash-mx.com/mm/highscore.cfm", "_blank");

Could you guess the source code of this file "highscore.cfm"?

Thankx again!

Geändert von lantian329 (08-02-2006 um 07:38 Uhr)
lantian329 ist offline   Mit Zitat antworten
Alt 08-02-2006, 18:00   #6 (permalink)
Supermassive
 
Benutzerbild von elysian
 
Registriert seit: Aug 2004
Ort: Frankfurt, Bornheim
Beiträge: 861
hi again.

i could guess, sure, but that's not what you want...
the way you're about to go - passing variables directly to cfm templates - is good for small applications, but in the "real world" you'll shortly detect problems with that solution (e.g. conceptual design of the whole application, and also with lots of data to be transferred...)

however, there is a tutorial on how to pass variables from flash to cfm-files using the loadvars class and that should help you out.
you can find it here. if this still doesn't help or you're interested in the flashremoting solution after all, just let me know.

greetings, elysian.
__________________
Personal » amenity*blogging » elysian.de » Flexpertise - Enterprise Flex Collaboration
Networks » Xing » ColdFusion Community
Everything Cairngorm »
cairngormdocs.org
elysian ist offline   Mit Zitat antworten
Alt 09-02-2006, 03:40   #7 (permalink)
Neuer User
 
Registriert seit: Nov 2005
Beiträge: 15
Thanks

Thank you very much,elysian!
I find the solution like this.

flash:
Code:
on (click) {
var my_xml:XML = new XML("Ernie13045");
my_xml.contentType = "text/xml";
my_xml.send("http://t065/tony/xml.cfm", "_self","post");
}
xml.cfm:
Code:
<cfset my_xml=xmlparse(gethttprequestdata().content)>
<cfoutput>
#my_xml#
</cfoutput>
lantian329 ist offline   Mit Zitat antworten
Alt 10-02-2006, 09:00   #8 (permalink)
Neuer User
 
Registriert seit: Nov 2005
Beiträge: 15
How to get radiogroup's value?

Code:
this.createClassObject(RadioButton, "first_rb", 10, {label:"first", data:5, groupName:"radioGroup"});
this.createClassObject(RadioButton, "second_rb", 20, {label:"second", data:10, groupName:"radioGroup",selected:"true"});
this.createClassObject(RadioButton, "third_rb", 30, {label:"third", data:15, groupName:"radioGroup"});
Now,the second radio button "second_rb" is selected in these radio buttons.(Note:I didn't click any button)
How to get radiogroup's value?

Thanks!
lantian329 ist offline   Mit Zitat antworten
Alt 10-02-2006, 09:11   #9 (permalink)
Supermassive
 
Benutzerbild von elysian
 
Registriert seit: Aug 2004
Ort: Frankfurt, Bornheim
Beiträge: 861
PHP-Code:
trace('selected radiobutton's label: + radioGroup.selection.label); 
for a reference of the radiobutton class take a look here or look into the flash help...
__________________
Personal » amenity*blogging » elysian.de » Flexpertise - Enterprise Flex Collaboration
Networks » Xing » ColdFusion Community
Everything Cairngorm »
cairngormdocs.org
elysian ist offline   Mit Zitat antworten
Alt 13-02-2006, 01:57   #10 (permalink)
Neuer User
 
Registriert seit: Nov 2005
Beiträge: 15
Thanks!

Thanks,elysian,you are right!
lantian329 ist offline   Mit Zitat antworten
Alt 13-02-2006, 08:53   #11 (permalink)
Supermassive
 
Benutzerbild von elysian
 
Registriert seit: Aug 2004
Ort: Frankfurt, Bornheim
Beiträge: 861
you're very welcome.
__________________
Personal » amenity*blogging » elysian.de » Flexpertise - Enterprise Flex Collaboration
Networks » Xing » ColdFusion Community
Everything Cairngorm »
cairngormdocs.org
elysian ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 17:59 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele