But of course, "this" doesn't work, so I need to find out what number "this" is
Of course, it would be easy to remove the MC that I am checking "this" for distance with, it would just be splicing array[a], but it's "this" that I am just not sure how to splice.
given an arrayA = [a, b, c] and arrayB = [a1,a2,a3]
by using array[0].name, it will return "a", is there any function that i can get the number "0" when i do something to "a" ?
I hope i make it clear here Xp
because i have 2 array here, i wanted to do something when the position of an element in an arrayA is same as the position of another element in arrayB.
for example trace(array[0].name); -> output = A trace(array[0].?????); -> output = 0
This object is ok, and shows up correctly in debug mode. The problem is I have a country name i.e. private var _country:String = "Angola";, and I want to get the corresponding value 'AO' from the XML object. Do you know how to do this?
I have tried loads of Livedocs examples, but cant get it to work. P.S. I am working on a HtpService & WebService driven app to display global weather conditions overlayed on a Google Maps interface. Going to make it available to the Flex community when finished.
how do i find out the number of properties in any element of the ArrayCollection? The structure of the ArrayCollection wud be something like:
var arrColl:ArrayCollection = new ArrayCollection([{column1Data:"someData",column2Data:"someData"},{column1Data:"someData",column2Data:"someData",column3Data:"someData"},
I am dynamically creating 10 textinputs inside a vgroup . when user clicks a button, I want to fetch the text present on all textinputs. How to do this. My code looks like this
var vgroup:VGroup = new VGroup; for(var i:number=0;i<10;i++){ var textinput:TextInput=new TextInput(); vgroup.addElement(textinput): }
I am dynamically creating a number of objects (movieclips) which all have a number of attributes.[code]and so on. i.e sub attributes. I don't think this is possible? Only sprite and movieclips can have dynamic attributes so unless atrbY is a movieclip (which it isn't, it's a string) it isn't allowed?Each object can have suboptions with further attributes associated with the chosen suboption.Later in the program I will manipulate, read and interact with the objects and they have text display behaviours dependent on the suboption chosen. That part (should) be straightforward! heh. One the object has the attributes attached in a usable format, accessing them should be simple.This will be for a store. i.e t-shirt1 has size small, price 10, size medium, price 12, size large, price 14. t-shirt2 has size medium, price 35, size large, price 40 and so on.[code]
This format of the XML can be adjusted if it would make the parsing easier.I am currently reading the XML in, stepping through, grabbing the individual parameter such as category and then adding it as an attribute of the object and it works fine. i.e. I end up with obj.category = 'catname'. However, on suboptions I am having a problem.Should I put all the suboptions in a multidimensional array and use nested loops to apply them to the object?I would still have the problem of objX.suboptionarray[Y].suboptionprice which isn't allowed? In the above XML case Y would be 0,1 and 2 giving 3 suboptions to objX and each suboptions would hold attributes such as pvid associated with that suboption.I could go down the horrible route, obj1.suboption1subptionprice ; obj1.suboption1suboptionpname; obj1.suboption1suboptionvalue; obj1.suboption2suboptionprice; obj1.suboption2suboptionpname and so on and so on for each suboption which could be five options (small,medium,large,x-large, xx-large) and which would "work" but would be bad programming and involve splicing names to get say, the "third" suboptions' price and pvid e.t.c
Going down the route of mutidimensional arrays sounds good except that on say 50 objects I would have stacks of arrays which I'm guessing isn't great in terms of resources?.Just to add, the number of suboptions varies between object, every object has a minimum of one suboption (default option) but can have as many as needed (unlikely to be more than 5 but should be scalable). i.e some t-shirts only come in medium whereas some have many sizes.I have a fair amount of leeway on the format of the XML which I generate from the database so the formatting of that could change to make the parsing easier.
I know that there is no such function as getElementByName in Flex but I also now that you can do this["object_id"] to get the element of the application u're in.What about getting an element inside another element?I've tried making element["id"] ? But in my try-catch it always runs the "catch" part..how do I get an element inside another element just having it's id in dynamically created string form?
I have flash where there is a link for song download. And, at the bottom of the flash I've a count, loaded thorugh flash vars which should increment everytime donload button is hit. Please let me know what approach should i take to do that. can i call a Java method on donload button which will insert a row in the table and and then get the count and render it to the count variable in my flash?
May be this extremely confusing. Here is a very similar example on how it is done. This is actually very similar to what i want to do. [URL] on this link there is count below which increments you hit the download button.
I've built a rather robust tooltip class recently that attaches and draws a single tooltip sprite to the root, then uses MOUSE_OVER to detect when it is over a tooltippable object, and shows the appropriate tooltip text. At the moment, I'm ensuring that any elements in my application which wants to take advantage of showing tooltips implement the ITooltippable interface, and expose a public getter, get tooltip().
Basically I have 14 text boxes, each box draws its content from an external txt file. Next to each text box is a button. I want the button to be either visible=true or visible=false depending on weather or not the text box has content or is "undefined" Here is what I have so far, and it's not working:[code] I would like a FOR loop to just run through the variables and check to see if any of them are undefined. if it is, then make the correct send button invisible.
this["nodeValue"+i] = new TextField(); (surely in dynamic class )
then I want to change instance name of that element.when I trace this["nodeValue"+i].name.I got a different name for that element ! f ex : instance8 .how can I get "nodeValue"+i from my element and change that .is it read only ? I want to swap tow element's instance name !
for example : this["nodeValue"+i] to this["nodeValue"+i+1]
I must rejected all users outside Denmark from our live streaming (c-ip) and this is done in an access plug-insBut now I need to open up one of the streams, but I can't get the streaming name in the access-plug-ins only in the Auth-plug-ins.I cant use x-page-url or s-uri I need pStreamName. in access-plug-in like thissetStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME, pStreamName);but I cant get it inside the access-plug-in
I am having a problem with my drop traget. I have the ability to drop and duplicate multiple objects on a stage. I have a clip set up (canvas) which is used for if someone drops objects onto this it duplicates the dragged clip.
However the problem I am having is that if someone tries to drop an element on top of an already drop/duplicated element, it wont duplicate the new clip. Its like it thinks that the dragged clip is not over the canvas.
After loading the following XML file, is there a way to count the number of attributes of the "question" node, and if possible, the number of items having the word "answer" in them? (in this case 4 should be returned, ie. answer1, answer2, answer3, answer4)
Code:
<?xml version="1.0" encoding="utf-8" ?> <quiz> <question text="The man went ___ the morning." answer1="at" answer2="on" answer3="in" answer4="out" correct="in" /> </quiz>
here's a painfully easy one I bet -- I'm aware of how to use EX4 to filter most pieces of the xml I need however how can I filter an XML list such as the one below to check say --- if a dog is a beagle? preferably as a Boolean.
I want to get all xml elements (xml descendents) which have some attributes like: <books> <book concept="rr" author="xx"/> <book concept="tt" /> <book concept="yy" /> <book concept="uu" author="xx"/> </books>
I need to perform a xml descendent search for xml nodes with author attribute containing results should be: <book concept="rr" author="xx"/> <book concept="uu" author="xx"/>
In my project I have some xml I've embedded and am now parsing.
Here's an example of xml I have.
HTML Code: <use> <player> <add var="health">2</add>
[Code].....
I guess I could just change the names of them in my XML but their must be a workaround. I could potentially not have control over the file and then I'd be screwed.
In Flash I load the text content of the title attribute into a text field, problem is -- the prints instead of operating as a carriage return (new line).
Again, no access to the XML so changing the TextField to htmlText and adding a <br/> tag wont work.