ActionScript 3.0 :: XML Loading With No Root Node
Aug 20, 2010
I have a XML file that doesn't have a <root> node so when using c# XmlReader to create it doesn't like multiple nodes, so what I need to do is script a new way to read the xml file but passing the <Root> node and continuing as the current xml doesn't have it.
This is the current script
Code:
xmlData.onLoad = function(success:Boolean) {
if (success) {
//first node is for continents - their countries and color
xmlNode = this.childNodes[0]; //xmlNode = Continents
for (var counter:Number = 0; counter < xmlNode.childNodes.length; counter++) {
[Code] .....
View 5 Replies
Similar Posts:
May 19, 2011
I have 2 xml files and one function to parse them. The function has to know how to parse them according to the xml document root node name.
How can I get the root name?
View 3 Replies
Jan 9, 2010
I'm having trouble accessing the value of the root node of an XML variable in flex. For example:
[Code]....
I can change the "Type" attribute above with X.@Type="xyz"; But how do I change "Content123" to something else? If the xml document were longer/deeper, I could say something like X.Entry[11].Cost=2.22; But what do I say in this case? Obviously X="Content456" doesn't work...
View 4 Replies
May 27, 2010
How do I get the root node of an XML object in Actionscript?
One would think that I could say this:
var Node:XMLNode = XMLVar as XMLNode;
But although XMLVar is of type XML, Node will = null.
View 2 Replies
Feb 27, 2012
I'm having troubles expanding the root node of my AdvancedDataGrid. Simplified code below:
adg.addEventListener(FlexEvent.CREATION_COMPLETE, adgCreationHandler);
private function adgCreationHandler(event.FlexEvent): void {
adg.expandItem(groupCol.getRoot(), true)
}
Does anyone have any thoughts on why this approach won't expand my root node, or another easy way of expanding the root node by default when the AdvancedDataGrid is loaded?
View 1 Replies
Feb 16, 2011
I have inherited a Flex air project and have not worked with trees before. The tree is displaying an xml file hierarchically. The user can make a change to the data. I need to save the data of the entire tree to a file.I can save the currently selected item to a file, no problem. But I need to save all the data from the root of the tree, forward.I would think I could make a copy of the tree, and set the selected item of my new tree to root, or something. Sort of like this pseudo code:
var treeToSave:Tree = new Tree (editedTree);
treeToSave.selectedIndex = 0;
// now save treeToSave to file...
This creates a compile error, but hopefully you can see what I'm trying to do.
View 1 Replies
Feb 11, 2010
i am loading an XML, inside it there is a node like this "<yweather:forecast day="Thu" date="11 Feb 2010" low="16" high="27" text="Partly Cloudy" code="30" />" and i need to load it but when i type "_xmlData.channel.item.yweather:forecast" being _xmlData my XML var it says that there is a problem because of the ":", and i don't know what to do to load it.
View 6 Replies
Feb 23, 2006
im loading in a xml doc and it loop in the xml doc depeneding on how many node are in it. and attaches the nodes to a mc. the mc has three text fields in it. im trying to move that mc called t over 50px on _y.Code: as of right now they load on top of each other. does anyone know how i would go about doing that?
View 12 Replies
May 15, 2011
I am loading an xml file and some of the node attributes do not have values:
<books>
<book id="qq" description="test1"></book>
<book id="nn" description""></book>
</books>
I get a null object reference when I try to run the second book line because of the missing description. Can I check for this in code and skip accessing the description for this line?
Something like if (xml_book.@description is null) {do nothing}else{do something)?
View 4 Replies
Oct 6, 2010
I have an AS code which loads external images dynamically using an XML file. but i'd like to change the code so that the images are loading not into the browser but into the root MC through a loader.
the function is now like this:
ActionScript Code:
tn_group["tn"+i].tn_button.onRelease = function()
{
getURL( photo_url[this._parent.tn_no] );
[Code].....
View 6 Replies
Mar 25, 2009
I've been going through online tutorials and so forthand yea I'm still a newb. I have a flash site I'm designing and this is probably a simple answer. I've figured out how to incorporate the external flashes using buttons and loader, please see the script below. The main problem I am having is I want to load my 1.swf file as the main home page. When I load the flash is comes up empty instead of loading the swf file when the flash is first opened. I can use the button to load it back, but how do you get it to appear once the flash is initailly loaded instead of just pulling up a blank page?
Code:
on (release) {
//load Movie Behavior
if(this.home == Number(this.home)){
[code].....
View 7 Replies
Jan 14, 2010
I have an AdvancedDataGrid tree with a ArrayCollection as its dataprovider. Now, for instance, i drag a leaf from one node to another node. To catch the event I'm adding a Listener to dragComplete.
[Code]...
My Problem: I want to know the new node where the leaf was dropped. Actually i would have expected that in the event there is a property like dropParent. This is not the case.
View 1 Replies
May 10, 2011
when a button is clicked, I want an external swf to load and play, then I want to go back to a particular frame in the original timeline.
View 2 Replies
Jan 18, 2011
I have a tree im my mxml that uses a XMLListCollection as dataProvider. Itīs XML is like:
<list>
<conta nome="Plano de Contas" id="1">
<conta nome="Creditos" id="2" />
<conta nome="Vendas" id="4" />
[code]....
How can I make the node for, say, id==4 visible AND selected?
View 2 Replies
Sep 21, 2011
i have a question whether we can create a new xml node in as3 node containing dynamic value inside.....
as like if i want to get like..var newNode:XML = <IMAGE FULL="fullimages/3.jpg"THUMB="thumbnails/3.jpg"/>
where the images are dynamic values...
View 5 Replies
May 26, 2005
I thought this was going to be easy! I would like to search an XML file for a particular data set i.e. set of nodes depending on a passed variable. However, storing a subset of my XML file via Code:var gallery = this.firstChild; and then searching 'gallery' as you would an array-using a for()-doesn't work since this.firstChild isn't returning an array
Code:
<gallery>
<collection title="Christmas 2004">
[code].....
View 3 Replies
Jun 25, 2009
I am building a small banner, which ideally will have a random string of text fade in (long enough to be read), then fade out...to play another random text.
Each of my texts have been built as movie clips... they fade in, stay up long enough to be read, then fade out. At the end of this, I need the movie to go back to frame 1 of the main timeline, as I am using the following script:
Code:
_root.onLoad = function() {
//generate a random number from 1 to 11
var nRandom = 1+Math.floor(Math.random()*12);
//tell timeline to goto and play the random number 'nRandom'
gotoAndPlay(nRandom);
};
Each of my text movie clips are on a different frame, so I need to call a new random _root frame to play from within the movie clips. So far, all that is happening is whichever movie is chosen to play, goes in a loop.
View 5 Replies
Sep 1, 2010
I've got some xml:
var xmlData:XML =
<1stNode>
<buttonID>first child node value</buttonID>
[Code]....
Then I want to read specific node value based on a value passed to a function. .
var buttonID = new Button;
var imageID = new Image;
var labelID = new Label;
[Code]....
I'm don't know how to get the value when node name is dynamically changed.
View 3 Replies
Jun 24, 2008
just trying to get straight how this works. Say I create some XML like so:
ActionScript Code:
var sample:XML = <sample>
<items>
[code]......
View 4 Replies
Jan 14, 2009
Situation:
- We have a Flash application located on a SAP EP (let's say ep.x.com)
- We have a SAP ABAP Application (Webservices) on a SAP WebAS
server (abap.x.com)
- Clarification: This is not about Flash islands / but a normal Flash application communicating with WebAS ABAP via WebServices
Problem: Due to the changed security policy in Flash 10 this scenario does no longer work.
- A crossdomain policy file on root level cannot be deployed on root level
- The WebServices http/s headers cannot be modified, since the WebServices are generated by the WebAS IDE.
Comment: Technically there is a way to patch a WebAS ABAP,but this is not a practical / acceptable way in a normal SAP WebAS infrastructure.
Conclusion:- The above scenario (Flash from EP content / WebAS ABAP as backend) is a quite normal scenario in the SAP world.
- SAP / Adobe always features the close relationship between their technologies.
Question:- What could we do?
- How does the Visual Composer works around that problem?
View 1 Replies
Mar 22, 2010
I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.How can I called the root stage properties rather than adding MC2 into the stage?
View 1 Replies
Nov 7, 2011
How do you tell the root timeline to root.gotoAndStop(2); from the timeline of a movieClip added using addChild?In the maintime line I have
addChild(fade_eng);
and in fade_eng I have the following on frame 20
root.gotoAndStop(2);
this.gotoAndStop(1);
But I am getting 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.
View 1 Replies
Aug 19, 2008
I have a datagrid called dg that has data populated to it thru an external XML. What I am trying to achieve is whenever someone clicks on an item in the grid it stores that items coordinates to a variable called locCoordinates. At this moment it is tracing out the coordinates for all of the items in the grid. I just dont know how to go about only getting the selected items coordinates.
XML Snippet
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<Placemark>
[code]....
View 3 Replies
Apr 1, 2012
Given
<nodeList>
<crazyNode>Data to be overwrited</crazyNode>
<simpleNode>Normal data</simpleNode>
<crazyNode>Actual data</crazyNode>[code]......
I want to get the last crazyNode (the one which contains Actual data).I know how to access the first node, for example:
nodeList.crazyNode[0]
And I guess a solution would be
nodeList.crazyNode[nodeList.crazyNode.length() - 1]
But for some reason I don't like doing that, too verbose and maybe there's a method more elegant.
View 2 Replies
Feb 6, 2009
This might be a stupid question:
Let's say I have:
var myXML:XML = new XML(<node></node>);
and I want to set a value for the <node>, so that the xml would become[code]...
View 4 Replies
Oct 26, 2005
I want to add new node to the current XML file. It already contain some data and I want to add new node with Flash. I know how to retrieve the data but don't know how to insert
View 3 Replies
Oct 24, 2009
Does anyone know of a way to get an XML node's name? Or to call the node without knowing it's name? I'm looking for something generic and reusable, with the child-node name not hard coded. My XML looks like this:
Code:
<list>
<doc>145</doc>
<doc>388</doc>[code]....
I've tried to import a string into the class to replace "doc", using XMLList, descendants, elements, children, etc. and nothing seems to work short of turning the whole thing into a string and chopping it up later.
View 4 Replies
Feb 2, 2011
I currently have the following XML code:
[Code]...
That however didn't trace anything. how I can read the galleryname?
View 1 Replies
Oct 2, 2008
How would I move an XML node? For instance:
<root>
<child />
<child />
<child />
<child />
<child />
</root>
I want to move the third <child> node up one.
View 2 Replies
Dec 19, 2009
i have an xml like this one, How can i change the values of the nodes <adposx> and <adposy> of the node array "YAYA" .I did that :
this.Pages.page.adverts[1].adposx= newvalue;
this.Pages.page.adverts[1].adposY= newvalue;
but it dont work
[Code].....
View 2 Replies