ActionScript 3.0 :: XML: Move A Node Up/down
Oct 2, 2008How 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.
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.
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.
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?
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...
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].....
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.
just trying to get straight how this works. Say I create some XML like so:
ActionScript Code:
var sample:XML = <sample>
<items>
[code]......
tutorial where when you click on a movie clip it moves to a certain location on the page and then zoom in and makes it a certain size. Also i want it to move back to its original location if you click it again.I want the move and zoom to be smooth so the users can see it move across the screen then gradually get bigger.
View 5 Replieswell i want to make buttons that on rollover move to left, on rollout move back to their initial position, and if clicked, they but stay this time at the final rollover place, and be there until something else is clicked. When something else is clicked, the previous button , returns to its initial place. So i ve got it all figured out except for the freeze and move part when the buttons are clicked. All it does now , is when they are clicked they freeze at the position i want, but i havent got a clue how to update them, after so they start moving back, and reacting on rollover and rollout, when the next button is clicked.
[Code]...
I know this is very noob, but I need a simple AS move and loop. Move an object across the stage and once out of site, loop and start over again? It needs to be a slow and endless loop.
View 3 RepliesUsing Tween class maybe? I tried the easeOut. But if will write 2 Tween, the 2nd one will overwrite the 1st one, so I only see the obj moving in the 2nd Tween direction, not the 1st Tween direction. I know the coordinates for the 2nd Tween below is not correct (cos all coordinates shld follow the defined reference point), so I need to find out the logo's width and height. But is alright now cos it is for testing purpose.
[Code]...
How can I move (on click) the ball up? I'd like to click in ball and move it up, the gravity move it down as well...
View 1 RepliesI'm trying to create an animation with an rectangle. I want the rectangle to move in a loop from x=150 to x=50 and back to 150 and so on.
At the moment I can only move the rectangle forward and it stops after it moved 100px.
how to create the loop ?
This is what I have come up with. not much Iknow.
<s:Move id="moves"
target="{rect2}"
xBy="-150"
duration="1000"
easer="{sineEasing}"/>
I am having some dificulty making a path for this enemy i'm trying to create... cause i want him to rotate + move, then stop, then shoot, then rotate back and move off screen... Its easier if you see it.. you can download the swf file in the zipped archive to demonstrate what i mean. I did it there with tweens. Anyway.. i tried and make it but i'm a little stuck on the stopping part... you can also see what i did in the fla file attatched...
View 1 Repliesi have 2 movieclips: i want to move both of them but the second movie clip will only move if the first clip reach his final destination how do i do that?
View 2 RepliesI 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]....
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.
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]...
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 RepliesDoes 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.
I currently have the following XML code:
[Code]...
That however didn't trace anything. how I can read the galleryname?
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].....
I'm using XML to populate a comboBox Component. How do I get the aactionscript to trace which number in the array the choice is? So for example is my choices are:
choice A
choice B
choice C
on the dropdown box, whne I click "choice A" I want it to trace "0" because that's it's place in the XML, or if I click "choice C" it will say 2".If i use "length" it will tell me how many. I need to know what to use that tells me which one.
When i search for the "0_0_0" attributes value.How can i get parent node value.
var myxml:XML=<course>
<leval0 id="1" levalid="0">
<leval1 id="1" levalid="0_0">
[Code]....
How can you tell if an XMLlist object in AS3 contains a specific node?
View 2 RepliesHow do I change from <forward></forward> to <backward></backward> without delete in actionscript?
View 2 RepliesTrying to loop though my XML data and assign to text fields. Not get a specific error but I am pretty sure it has something to do with the way I am referencing the data and assign it to the .text box. I am also having issues with getting the length of my xml so I know how many times to loop.first a summary of my XML:
<Worksheet>
<Row>
<Data>Last Name</Data>[code].....
The e4x implementation in as3 doesn't seem to be able to handle node names that have dashes in them. The musicbrainz api returns xml with a node named artist-list and i can't seem to get it to let me access the node.[code]...
View 2 Repliesi have
<myXML>
</myXML>
[Code]....
but how to do it if 'text' is actually something contained in a string variable? so how do i add a childnode that has some programmatically generated content?
so i have:
var myXML:XML = <myXML><myXML>
var myString:String = "Hello World"
i want to do something like
myXML.appendChild(<bla>mySring</bla>);
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?