 |
Featured jobs
Featured template
View more templates
 |
 |


Next 5
login scripts
 |
 |
on (release) {
// A. Construct a XML document with a LOGIN element
loginXML = new XML();
loginElement = loginXML.createElement("LOGIN");
loginElement.attributes.username = username;
loginElement.attributes.password = password;
loginXML.appendChild(loginElement);
// B. Construct a XML object to hold the server's reply
loginReplyXML = new XML();
loginReplyXML.onLoad = onLoginReply;
// C. Send the LOGIN element to the server,
// place the reply in loginReplyXML
loginXML.sendAndLoad("https://www.imexstocks.com/main.cgi",
loginReplyXML);
}
function onLoginReply() {
// Get the first XML element
var e = this.firstChild;
// If the first XML element is a LOGINREPLY element with
// status OK, go to the portfolio screen. Otherwise,
// go to the login failure screen and let the user try again.
if (e.nodeName == "LOGINREPLY" && e.attributes.status == "OK") {
// Save the session ID for future communications with server
sessionID = e.attributes.session;
// Go to the portfolio viewing screen
gotoAndStop("portfolioView");
} else {
// Login failed! Go to the login failure screen.
gotoAndStop("loginFailed");
}
}
Posted by: leo | website
https://www.imexstocks.com/main.cgi
|
 |
 |
 |
Build an XML object to send via socket
 |
 |
function sendInsert (cmzt, user, tx, tgy) {
myXML=new XML();
twElement = myXML.createElement("tw");
twElement.attributes.type = "request";
twElement.attributes.modul = "message";
twElement.attributes.action = "insert";
Element = myXML.createElement("uzenet");
Szoveg = myXML.createTextNode(tx);
Element.appendChild(Szoveg);
from = myXML.createElement("from");
User = myXML.createTextNode(user);
from.appendChild(User);
sub = myXML.createElement("subj");
Targy = myXML.createTextNode(tgy);
sub.appendChild(Targy);
for (i=0; i<cmzt.length; i++) {
to = myXML.createElement("to");
Cimzett = myXML.createTextNode(cmzt[i]);
to.appendChild(Cimzett);
twElement.appendChild(to);
}
myXML.xmlDecl = "<?xml version='1.0' encoding='utf-8' ?>";
twElement.appendChild(sub);
twElement.appendChild(from);
twElement.appendChild(Element);
myXML.appendChild(twElement);
sendData(myXML);
}
// Send XML via SOCKET CONNECTION
function sendData (Data) {
socket.send(Data);
}
// XML includes the details of a message
a1=new Array("435", "245", "436"); // TO
a2="265"; // FROM
a3="HI EVERYBODY!\nTHIS IS THE CONTENT OF THIS MESSAGE.\n\nBYE,\nDANI"; // CONTENT
a4="Subject of the message"; // SUBJECT
sendInsert (a1, a2, a3, a4);
// ********************************************************************
The sent XML:
<?xml version='1.0' encoding='utf-8' ?>
<tw action="insert" modul="message" type="request">
<to>435</to>
<to>245</to>
<to>436</to>
<subj>Subject of the message</subj>
<from>265</from>
<uzenet>HI EVERYBODY!\nTHIS IS THE CONTENT OF THIS MESSAGE.\n\nBYE,\nDANI</uzenet>
</tw>
// ********************************************************************
Posted by: Daniel Kiss | website
http://www.deltabroker.at
|
 |
 |
 |
Converting XML based string to Flash object
 |
 |
////////////////////////////////////////////////
// Converting XML based string to Flash object
////////////////////////////////////////////////
/* Define below function to create object to store XML string:
function dropDown (ID, text, URL) {
this.ID = ID;
this.text = text;
this.URL = URL;
}
*/
var Drop = new Array();
function Convert () {
XMLString = "<dropDown><dNum>2</dNum><dText><b>AAA</b></dText><ddown><dID>1</dID><dText>BBB</dText><dLink>BBB.html</dLink></ddown><ddown><dID>2</dID><dText>CCC</dText><dLink>CCC.html</dLink></ddown>";
docXML = new XML(XMLString);
XMLDrop = docXML.childNodes;
XMLSubDrop = XMLDrop[0].childNodes;
_level0.menu.menuHeader = XMLSubDrop[1].firstChild;
_level0.menu.itemCount = parseInt(XMLSubDrop[0].firstChild);
count = _level0.menu.itemCount+2;
for (i=2; i<count; i++) {
XMLDrops = XMLSubDrop[i].childNodes;
ID = Drop.length;
Drop[ID] = new dropDown(XMLDrops[0].firstChild, XMLDrops[1].firstChild, XMLDrops[2].firstChild);
set ("_level0.menu.item"+Drop.length+"Label", Drop[ID].text);
set ("_level0.menu.item"+Drop.length+"URL", Drop[ID].URL);
}
}
Posted by: Mustafa Basgun | website
http://www.basgun.com
|
 |
 |
 |
Easy and Lightweight Tag Notation
 |
 |
function tagNotation(xmltarget){
tagChildren(xmltarget);
function tagChildren(node){
for(var i=0 ; i<node.childNodes.length ; i++){ child = node.childNodes[i]; if(node[child.nodeName]==undefined){ node[child.nodeName] = child ; }else{ if(node[child.nodeName].length==undefined){ temp = node[child.nodeName]; node[child.nodeName]=new Array(); node[child.nodeName][0] = temp; }
node[child.nodeName].push(child); }
if(child.hasChildNodes){ tagChildren(child) }
}
}
}
Posted by: ABeall | website
http://abeall.com
|
 |
 |
 |
flash_script
 |
 |
var Drop = new Array();
function Convert () {
XMLString = "<dropDown><dNum>2</dNum><dText><b>AAA</b></dText><ddown><dID>1</dID><dText>BBB</dText><dLink>BBB.html</dLink></ddown><ddown><dID>2</dID><dText>CCC</dText><dLink>CCC.html</dLink></ddown>";
docXML = new XML(XMLString);
XMLDrop = docXML.childNodes;
XMLSubDrop = XMLDrop[0].childNodes;
_level0.menu.menuHeader = XMLSubDrop[1].firstChild;
_level0.menu.itemCount = parseInt(XMLSubDrop[0].firstChild);
count = _level0.menu.itemCount+2;
for (i=2; i<count; i++) {
XMLDrops = XMLSubDrop[i].childNodes;
ID = Drop.length;
Drop[ID] = new dropDown(XMLDrops[0].firstChild, XMLDrops[1].firstChild, XMLDrops[2].firstChild);
set ("_level0.menu.item"+Drop.length+"Label", Drop[ID].text);
set ("_level0.menu.item"+Drop.length+"URL", Drop[ID].URL);
}
}
Posted by: Sachin | website
http://www.yahoo.com
|
 |
 |
 |
Next
5
|  |
Search Entire Site
Advertisements
Latest New Articles
- Set up a simple IIS Server for Flash
by Peter McBride - Day 1 at FITC Toronto 2008
by Anthony Pace - Simple reflection effect with AS2
by Jean André Mas - ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff - Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F
|
 |