ActionScript 2.0 :: Reading And Writing Multiple ChildNodes
Oct 25, 2005[Code]...
THE ABOVE NEEDS TO BE MODIFIED TO ALLOW MULIPLE EVENTS... I'VE BEEN WORKING ON IT FOR DAYS....
[Code]....
[Code]...
THE ABOVE NEEDS TO BE MODIFIED TO ALLOW MULIPLE EVENTS... I'VE BEEN WORKING ON IT FOR DAYS....
[Code]....
I've been searching all morning for some samples on how to read and write xml files.Here's what I have so far.My XML File called Call2Action.xml
<?xml version="1.0" encoding="utf-8"?>
<Call2Action version="1.0" creationDate="2009-05-06">
<ProceraFixedImplantBridge>
<Yes>5</Yes>
[code]....
'String(xmlData[idx].Yes' is where I'm having a problem, can't figure out the syntax for declaring the element I want to read, plus I want to read the elements inside let's say <ProceraFixedImplantBridge>. I need to add that to the code.I want to increment the counter for yes or no, and write the file back.
I am a AS newbie, so just learning AS3 (I have heard that this is a good place to start!). I am trying to read and write to an XML file.I have learned how to read an xml file but for the life of me, I can not write to the file.I have found many many tutorials that I can't seem to get to work.This is my goal... I have a small flash game that after the user wins, their user name, date, time and score get entered into the xml file. So, I just want to append the new info into the existing xml file (all the files will reside in the same directory on my server). I have all the variables ready to send.. just need the way to do it!
I have a separate AS3 flash file that shows a listing of the xml file to display the scores to the users, I have a working version of this... but I may have to change this to match how the info is being stored into the xml.
[Code]...
reading and writing to textfiles. I need to save and load data to and from variables. I know how to read from text-files, but not how to write to them.
The text-files should work as a "database" for the high-score in a game, I cant use php cause the computer running the game wont be online all the time.
Is there a way to do file reading and writing in flash, like using actionscript 2.0? Just like how we do it in C++. Like read variables or a string from a .txt file and write in it.
View 9 RepliesI am currently working on the 'Flash.utils.ByteArrays' and I am using writeobject() and readobject() to write and read byte Array objects. I also understand that, the objects are serialized and de-serialized as byte arrays through AMF formatting.
Since I am trying to write the object to a device(credit card reader) that doesn't supports AMF, I was wondering if there is any other way where I can still use the writeobject() and readobject() methods but can control the creation or reading through other 'byte array ' serializing and de-serializing format options if any.
Currently I am using SWFDOTNET libray for reading and writing swf file,which supports swf file from version 1 to 7.Is there any other open C# source lib for reading and writing swf flash which supports swf file version 8,9 and 10?
View 1 RepliesI need to save and load data to and from variables. I know how to read from text-files, but not how to write to them. The text-files should work as a "database" for the high-score in a game, I cant use php cause the computer running the game wont be online all the time.
View 6 RepliesI am wondering if it is possible to use random file access for reading and writing data to file in Actionscipt 3.0 similar to that what is in Visual Basic?
View 1 RepliesWhen I open a text document containing 1 string of a Base64 Encoded Image, it works fine:
ActionScript Code:
import flash.display.Loader;
import flash.utils.ByteArray;
[code]...
The image displays and that's great, but I need to display multiple images; therefore, I used the standard format: var1=value1&var2=value2&... (In reality, the values are the huge base64 strings.) Then I just needed to add "my_loader.dataFormat = URLLoaderDataFormat.VARIABLES;" since the format of my source changed. The thing that bugs me is that I'm tracing the imgB64Str after I set it and it traces fine (just like the other version).
ActionScript Code:
import flash.display.Loader;
import flash.utils.ByteArray;
[code]...
It runs with no errors, but the image no longer displays.
This code is giving me undefined. I have 3 flashvars in the swfobject embed code in the HTML document. How do I fix this?[code]
View 3 RepliesHere is my XML that holds all images. I want the to get the childNodes of subcategory, sub1, sub2, sub3 etc...
< allImages>
<images>
<category>Architecture</category>[code]...........
Inside my XML file, I want to have multiple child nodes nested in a parent node. But when I try to trace out the multiple child nodes, I only get the first child node in the trace, despite using "@" wildcard. Is it because the childnodes are named the same?
Code:
<gallery>
<project>
<desc>Description</desc>
[code]....
I currently have some XML which looks like this:[code] I don't have any <discount> in my second listing. The content of <discount> is being displayed upon some graphic which I'm tweening around. However if there's no discount, I want to set this movieclip to ._visible = false - since its pointless to have it tweening around when there's no text on it.How on earth would I check if <discount> exists or doesn't? In most cases it will be there, but in a few it won't.[code]
View 2 RepliesI am trying to build xml menu. Some nodes have childNodes some don't. I have a problem in my array loop : the movieclip that I use to create subMenu attached to the entire array. How can I make that the movieclip that I use for subMenu only attach to the nodes that having childNodes?
Here's the code :
Code:
function buildingMenu(){
buttonArray = myXml.firstChild.childNodes;
for (var i=0;i<buttonArray.length;i++)
{
[code]....
Is there a way to add ".childNodes[0]" to a var? Like if I have:
myVar = this.firstChild.childNodes[0].firstChild.nodeValue;
And if the user push a button I want myVar to be;
myVar = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
I am changing the flashvars variables v1=value&v2=value ect then after the flash movie runs I am changing the variables externally by javascript, so far so good.when flash first loads it reads the vars correctly.when I try to read them ( after the change ) it keeps reading the old values.[code]everything works except I cannot seem to read the changed FlashVars.
View 1 RepliesI'm workig on my portfolio and here is what Im running into...en I debug my fla the following XML shows up with extra "xmlobj.childNodes[1].childNodes["Right here"]hen I browse the file in the debugger (variables section) instead of 0,1 and 2 for childNodes the are 0-5??? and every other one is all null values... also they show up as [1] [2] [3] directly under xmlobj when I expand it can anyone tell me whats up with my xml? if its my script or you think it is I'll post the code/fla if I need to... alsoMy xml will be dynamically created via a php -> mysql script eventually (I have that worked out I just need to get this working so I can properly format my php-> xml output for flash which is what I think my problem is.
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ROOT>
[code].....
I'm having trouble loading a XML file with AS2.0. I'll copy&paste a reduced version of my XML.
[Code].....
I'm trying to get my XML info into movieclips called "button_1" - "button_7" I have my XML ChildNodes showing up in my output window when I export my swf. I used the xml class to load into an xml instance So how do I assign the data to my movieclips.
Here's my code thus far:
stop();
import flash.display.*;
import flash.events.*;
import flash.net.URLRequest;import flash.net.URLVariables;
var numOfImages = 90;var imgNum = 0;
[Code] .....
[Code]...
I it to randomly pick one of the childNodes and display it in the container. I tried to place in a Math.random(); but I wasn't sure where to put it.
I have a movie clip in my library linked as aboutUsMenuBtn. And I as get the childNodes.nodeName from the XML file, I want them to be assigned to a dynamic text field "btn_txt" inside of the aboutUsMenuBtn. With each node, a button is going to be attached to the aboutUs stage (I'm working using a Flash Form Application).
[Code]...
I am trying to use Kirupa's XML drop down menu(action script 2.0): aka: [URL] however I cannot have it output the childNode. This is because it is using a for loop with the curr_item variable. when I try to trace the for loop count variable, it just returns the last for loop variable. I basically want it so that when I click on a button on the 3rd tier submenu, I want it to output all the prior tiers that the button belongs in.
View 2 RepliesI am doing an Actionscript 3.0 project which involves introspection. I am wondering if there is a way to get all the classes within a given package structure.
[Code]....
I have an menu for user to populate it. Then when the user finish, I would like to store his Order into an XML database. I do not know how to write to XML file in Flash.
View 9 RepliesI'm making a simple flash game as sort of a test, and I'd like to have save files by making flash write information to an xml file. Is there anyway to generate and edit an xml file using actionscript?
View 5 RepliesI have been struggling with this all week now. I am using as3 and within my movie I have a dynamic text box that contains a score.I need this score to be written to a text file preferbly in an array that only stores the highest 5 scores.I then need values from the array to be read and displayed on another movie which will act as a high score table. e.g. I will have a dynamic text box in my high score move that will display the 1st value in the array, and then the 2nd etc.
writing/reading data to text files.Alternatively if anyone else can suggest another method for a high score table please let me know. I only need a basic high score table that runs on a users local machine as the app i am making is desined to run on individual users machines.
i load in xml file so i can read the data. i've figured out how to add, delete and modify data. but the problem is, is that even when i do that it only does it within flash it doesn't make the changes to the actual file.so i want someone to help me do this. so please help i've been at this for week and its time i ask you nice and incredibly smart people.
here is my file, its clean and organized as its something i whipped up for the sake of figuring this out.i found this, people say it allows you to save the xml data, which would work, if i have to delete a file i can do that, i know how to do that. the script i found to do this is below incase it helps you guys to help me.
Code:
package com.hodgedev.xmlcreator
{
import flash.display.Sprite;
import flash.events.Event;
[code]....
i'm running into major problems with writing an irc client, it works perfectly when i execute it through flash, but when i upload it to a site, it won't connect, i understand that i need an crossdomain file, i've been doing alot of research, and can't make head's or tails
debugging shows that even though i do: Security.loadPolicyFile("http://example.com/crossdomain.xml");, it still attempts to read an crossdomain file from the target irc server, however, i don't have control over the target machine(nor should that be necessary), how do i get around this, or what am i doing wrong?
what i really need, is a simple example of connecting to an server that i don't control to load some resources(i.e grabbing an image), where all the crossdomains file's sit, and how it's generally done, googling around, it seems this information isn't as easy to come by as i thought
edit: also, i'm using raw sockets to connect to the irc server, if that makes a diffrence edit: alright, been reading alot more information, it looks like i do need to have a policy file to connect to said server, which is beyond retarded, please, someone tell me there's a way around this, but that doesn't explain why it works through flash?
is it possible to post to php in an .exe file instead of a .swf displayed inside a browser? If so, how? I figured if you just created the .exe on the server with the .php file in the same folder it would read it and work fine.
View 2 Replies