• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

xml/flash

hi guys!
i have tag like this


<good></good>
<vgood></vgood>
<ci></ci>
<nb></nb>

I want to integrate flash/xml for rating my site.i have four buttons in the stage,as good,very good,not bad,can Improve.if a user presses
first button,the  <good> tag should be incremented by 1 and so on for all tags.


i can get values from xml file but i don't know how to send from flash to xml file.please provide me the code for modifying a
particular tag,deleting values from a particular tag and adding values to a particular tag.I am sure that  the people
reading my question can help me .please help me as early as possible.
0
vinoddb
Asked:
vinoddb
1 Solution
 
elhyCommented:
I did it before but not with xml alone. I used asp and from asp response.write the xml tags. Not sure if u can do it directly with xml alone. what i did was send the variable to a asp page then with the vbscript, modify the value. response.write the name data in xml format.

here's a sample code for flash:

myXml = new XML();
loadDataXml = new XML();
loadDataXml .onLoad=function(){
    //do sth here.
};
myXml.sendAndLoad("aspfile.asp", loadDataXml);
0
 
henrywwCommented:
hi vinoddb,

if u know how to load from the xml file, that's good

then u have to construct a new XML object
and do the calculation etc and add the node and send the xml to ur script (asp,php etc) -> save to db ...
is that what u want?

// a, b ,c ,d being the values u get from load XML and manipulated add, minus, remove etc

myStats= new XML();
XMLObject = STATS.createElement("statREC");
XMLObject.attributes.good= a;
XMLObject.attributes.vgood= b;
XMLObject.attributes.ci= c;
XMLObject.attributes.nb= d;
myStats.appendChild(XMLObject);
trace(myStats.toString()); // if u wanna see what is happending

myStats.send("update.asp")
// etc ...


have a look at this question, it may give u some hint
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_20515181.html

cheers
0
 
hansamryanCommented:
I might being missing something here, so forgive me if this does't go along with what you are asking.

But, upon clicking on a button just have that access an asp page behind the scene with a querystring? And have your asp page do all of the work?


example: update.asp?good=0&vgood=1&ci=0&nb=0


---------update.asp-----------
<%
if not isempty(request.querystring("good")) then
Good=request.querystring("good")
vGood=request.querystring("vgood")
ci=request.querystring("ci")
nb=request.querystring("nb")
if good <> 0 then
''XML ADD 1 to GOODVOTE
elseif vgood <> 0 then
''XML ADD 1 to VERY GOOD VOTE
elseif nb <> 0 then
''XML ADD 1 to NOt BAD VOTE
elseif ci <> 0 then
''XML ADD 1 to IMPROVE VOTE
end if
%>

===========
or Use one querystring variable and a switch statement in the asp page.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now