Flex - Choose Random Xml Node From Xmllist According To A Condition?
Feb 20, 2010I'mm using flex builder 3. I have an xml file that looks like this, notice the flag property. It can be either 0 or 1:
[Code]...
I'mm using flex builder 3. I have an xml file that looks like this, notice the flag property. It can be either 0 or 1:
[Code]...
How can you tell if an XMLlist object in AS3 contains a specific node?
View 2 RepliesI have this XMLList:
<content> <TextFlow color="#000000" columnCount="2"> <p>One</p></TextFlow> </content>
I need to get <textFlow> as an XMLList and as String.
Is there an XMLList equivalent to Array.indexOf?
For example -
var array:Array = ['one','two'];
trace(array.indexOf('two')); // returns 1, since it's at the second position
trace(array.indexOf('three')); // returns -1, since it isn't found
[Code]...
there's got to be an easier way to check to see if one of the nodes in the XMLList has a particular value than looping through all of them, right? something akin to -
xmlList.indexOfChildByNodeValue('two'); // returns 1, because it's the second child
xmlList.indexOfChildByNodeValue('three'); // returns -1, because it doesn't match any children
check to see if a node exists in an XMLList object. I have a list of objects to convert to XML, but if an xml entry already exists, then the following objects with the same name get added as children.
View 2 RepliesI have a series of images & links in my XML file that looks like[code]...
You'll see in the third once there is no link. Apparently, when I throw it into an XMLList, it gets ignored and all of the links are off by one.
how would i go about choosing one of the following at random?
ActionScript Code:
var example1:String = "hello";
var example2:String = "how are you";
[code]........
I have 5 movie clips on stage made invisible. Each time only 1 movie clip appear randomly. The next movie clip appear on condition that the previous movie clip must disappear by pressing of a button. Example: mc - A,B,C,D,E
If B appear, a button must be pressed to make B disppear in order for the next button to appear randomly.
I would like to have Flash choose a scene to play at random,then play the scene, then choose another scene to play at random excluding any scenes already played.
View 1 RepliesI 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 an XMLList 'Keywords', which consists of about 30 elements. I want to count the number of unique keywords in the List, and how often they occur. Then display the top 3 most occuring keywords.
View 1 RepliesAll I want is to display a random node from an xml file in Flash. I can display one node fine, but if try to display 2 or more, Flash sticks the XML tags back on the items - change the number following questions in the urlLoader_complete function to see what I mean.
Here's my AS3:
var questions:XML;
var urlRequest:URLRequest = new URLRequest("breakfast.xml");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
[Code] .....
I have several nested VBoxes in flex, and I'm aiming for one of them to get scrollbars if the total content is larger than the window height. However, when I grow the container, it doesn't get scrollbars at all (vertical scroll policy is AUTO), and the outer container stretches past the bottom of the screen, causing the entire app to get scrollbars. So it looks something like this:
[Code]...
HTTPService has a property resultFormat which can be set to any of the following: array e4x flashvars object text xml .I looked at the documentation to understand the difference, but still couldn't understand when to use each. I'm looking for the lightest weight of all of them.
P.S. I'm consuming output from my own server, so can change the output format as needed to make it compatible with each.
Imagine we have an object dispatching some event and this object should perform some action on this event. What's the right way of catching this event? May I listen to this event directly in my object or should I let this event travel through EventMap? Example: I have a popup window with form. On submitting form, I'm going to send a request to remote server and close this popup. Is it ideologically correct to perform popup close on click without dispatching custom event to EventMap?
View 2 RepliesI have recently been using Charles the debugging app. And noticed a very chatty app named skyrocket (a very very cool slide presentation app) sending a lot of data across the wire. It is built in flex by the looks and I was wondering why they had chosen to send their data using base64 and not amf. Is it because they don't want to be locked into the flash platform? Or could there be another reason. Is it to store it as XML in the database as they don't want to be dealing with amf when handing data to other services/clients (iPhone etc).
View 2 RepliesI am builder a graph that is going to cover an entire month. The user may change the Month/Year but there is no point in choosing a date for the month as it is going to show the entire month anyways. So is there a way to maybe make the DateChooser date always the first and only allow the user to pick the month and year?
View 1 RepliesI have the following XMLList and am trying to return the XMLList with the node having the label Mail Box or Outbox, depending on string variable called folder. folder can either be equal to "Mail Box" or "Outbox".
`<fx:XMLList id="treeData">
<node label="Mail Box">
<node label="Inbox">
[code].....
I'm trying to loop through an XMLList and rather than giving me each item in the list as XML, it's just coming back with the positions as strings e.g.
[Code]...
It just alerts "0" or "1". If I inspect the 'item' variable, I see the same thing. But if I inspect 'myList' it looks like the XML. I've also tried myList.children() and strongly typing 'items' to 'XML' but nothing I do has worked.
im kinda confuse why people use flash cs5 and some are using flex, flashdevelopl and etc..
View 3 RepliesI need to specify more than one condition for visibiltyvisible="{data.allow && data.open}"However, this gives the error "The entity name must immediately follow the '&' in the entity reference."I could use a function, but I'd like to know if it is possible to do this directly with different syntax.
View 1 RepliesIf I have an XMLList object in Flex, what is the proper way to check to see if the list is empty? Should I just compare the result of myList.length() > 0, myList.toString() != "" or try another method altogether?
View 1 RepliesHow would I get a range of items from my xmllist similar to the slice method for an array?
slice(startIndex,endIndex);
I am trying something like this:
var tempXMLList:XMLList = new XMLList();
[code].....
I am trying to create a xmllist variable in action script like this:
var _menuData:XMLList;
<menuitem label="File">
<menuitem label="Backup Schedule"/>
[Code]....
How do I assign this xml to _menuDAta in actionScript? I dont want to create a string first and then do it all by fixing line break errors.
I'm in the process of planning a banner project, where I want to being able to output all banner formats (about 10+ of them) from the same flex project. They will all contain pretty much the same content but with some variation, and because of the size limit I want to load only the necessary assets for each format.
I wonder if there's a way to dynamically load different assets (in form of swf or swc) depending on some setting? I can of course load different swf:s into the main swf but I want only one swf per format. How about launch configurations, is there a way to choose different swc:s there?
i have my hGroups as like [code]and i m trying to hide the hgroups on a condition when this bean tagInfoData have a value "notworking" otherwise it will shown..should i need to write code in the creation complete as all this is in a pop up window of the button click event.[code]
View 1 RepliesHow can I delete the element with a certain index in a Flex XMLList?
View 1 RepliesIs there anyway of type casting an ArrayCollection to xmllistcollection or to xmllist or can we covert ArrayCollection to xmllistcollection or to xmllist?
View 1 RepliesI have a flex MXML UI that is building a set of radio buttons using the Repeater component:
<mx:Repeater id="radios"
dataProvider="{_lists.(@id == _question.single.@response_list).group.listItem}">
<mx:RadioButton groupName="responses"
[Code].....