Using An Array Collection Produced From XML In Conjunction With Shared Object

I have an old app that Greg LaFrance helped me out with greatly which allows the user to drag items between two tilelists and then save the contents of both tilelists by clicking a save button using the sharedObject method. The tilelists are populated by array collections defined in the app. I want to change this so that the tilelists are instead populated by an array collection which I've retrieved from a remote xml file via http request but I can't get this to work. Basically I need to replace both the predefined array collections profile1NewsAndSportaddLinksFullAC and profile1NewsAndSportaddLinksAC with my xml/httprequest produced newsAC array collection and still make the tilelists saveable. Can anyone help me out? Here's the code:-
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="newsService.send(); initprofile1NewsAndSportSO()">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.*;
import flash.net.SharedObject;
Bindable]
private var newsAC:ArrayCollection;
private function newsResultHandler(event:ResultEvent):void{
newsAC=newsService.lastResult.newscategory.news;
public var profile1NewsAndSportSO:SharedObject;
private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new ArrayCollection([{label:
"BBC News"},{label:
"ITV"},{label:
"Sky News"}]);
private var profile1NewsAndSportaddLinksAC:ArrayCollection = new ArrayCollection([{label:
"BBC News"},{label:
"ITV"},{label:
"Sky News"}]);
private function profile1NewsAndSportReset():void{resetprofile1NewsAndSportAC();
profile1NewsAndSportAddLinksTilelist.dataProvider
= profile1NewsAndSportaddLinksAC;
profile1NewsAndSportLinkChoice.dataProvider =
new ArrayCollection([]); }
private function resetprofile1NewsAndSportAC():void{profile1NewsAndSportaddLinksAC.removeAll();
for each(var obj:Object in profile1NewsAndSportaddLinksFullAC){profile1NewsAndSportaddLinksAC.addItem(obj);
private function initprofile1NewsAndSportSO():void{profile1NewsAndSportSO = SharedObject.getLocal(
"profile1NewsAndSport");
if(profile1NewsAndSportSO.size > 0){
if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList){
if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList != "empty"){
var profile1NewsAndSportaddList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split(",");
var profile1NewsAndSporttempAC1:ArrayCollection = new ArrayCollection();
for each(var str:String in profile1NewsAndSportaddList){
for each(var obj1:Object in profile1NewsAndSportaddLinksAC){
if(str == obj1.label){profile1NewsAndSporttempAC1.addItem(obj1);
continue;}
if(profile1NewsAndSporttempAC1.length > 0){profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;
if(profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){
var profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(",");
var profile1NewsAndSporttempAC2:ArrayCollection = new ArrayCollection();
for each(var str2:String in profile1NewsAndSportchoiceList){
for each(var obj2:Object in profile1NewsAndSportaddLinksAC){
if(str2 == obj2.label){profile1NewsAndSporttempAC2.addItem(obj2);
continue;}
if(profile1NewsAndSporttempAC2.length > 0){profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;
else{profile1NewsAndSportReset();
private function saveprofile1NewsAndSport(event:MouseEvent):void{
var profile1NewsAndSportaddList:String = "";
if(profile1NewsAndSportAddLinksTilelist.dataProvider){
if(ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){
for each(var obj1:Object in profile1NewsAndSportAddLinksTilelist.dataProvider){
profile1NewsAndSportaddList += obj1.label +
else{profile1NewsAndSportaddList =
"empty";}
profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;
var profile1NewsAndSportchoiceList:String = "";
for each(var obj2:Object in profile1NewsAndSportLinkChoice.dataProvider){
profile1NewsAndSportchoiceList += obj2.label +
profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;
profile1NewsAndSportSO.flush();
]]>
</mx:Script>
<mx:HTTPService id="newsService" resultFormat="object" result="newsResultHandler(event)" url="http://www.coolvisiontest.com/getnews.php"/>
<mx:Button click="profile1NewsAndSportReset()" id="reset" label="
Reset" y="5" height="25" x="5"/>
<mx:TileList id="profile1NewsAndSportLinkChoice" fontWeight="bold" dragEnabled="
true" dragMoveEnabled="true" dropEnabled="true" height="129" width="
650" top="5" left="521" columnCount="5" rowHeight="145" columnWidth="
125" backgroundColor="#000000" color="#FFFFFF"/>
<mx:TileList id="profile1NewsAndSportAddLinksTilelist" fontWeight="bold" dragEnabled="
true" dragMoveEnabled="true" dropEnabled="true" height="129" width="
385" top="5" left="128" columnCount="3" rowHeight="145" columnWidth="125" backgroundColor="
#000000" color="#FFFFFF"/>
<mx:Button click="saveprofile1NewsAndSport(event)" id="save" label="Save Changes" x="
5" y="38" width="113" height="25.5"/>
</mx:WindowedApplication>

It might be easy to solve these issues if you post your form.
Post your form if it doesn't contain any confidential information.
Nith

Similar Messages

  • Is it possible using SQLite to collect data from an older SQL database?

    Is it possible using SQLite to collect data from an older SQL database? Where can I find a possible answer. Thanks in advance.

    There are 3rd-party tools (see comprehensive list at http://www.kenhamady.com/bookmarks.html) that provide extra pdf functionality on top of the pdf export from Crystal. 
    In the case of my Visual CUT software, you can use hidden formulas inside your Crystal report to generate form fields (pre-populated as well as empty) as part of the pdf export process.
    hth,
    ido

  • After 3 years of use, my I-photo dissappeared from my mac along with all my pictures.  Stupid me has no back up either.  any ideas how I can get my pictures back?es bautupi

    Happy Holidays.  After 3 years of use, my I-Photo disappeared from my Mac along with all my pictures.  And stupid me has no back-up.  Any ideas on how I can find my pictures?  Thanks.

    Happy Holidays to you too.
    What exactly is missing?
    The iPhoto icon in the Dock, that you used to launch iPhoto?
    The iPhoto application from the "Applications" folder?
    Your iPhoto library from your "Pictures" folder?
    To check what is still left, click on the looking glass icon in the upper right corner of your screen and type "iPhoto" into the Spotlight search field. This should find anything with iPhoto in its name. Does it show an iPhoto application? Then click it to launch it.
    But before you do anything else, I'd strongly suggest to get yourself a backup disk and make a Time Machine backup of your machine right now. You have already noticed, how risky it is, not to have a working  backup. The best computer will crash one day.
    Regards
    Léonie

  • Artwork Missing from Front Row 2 with Shared iTunes

    From what I can see this is not solved in X.6.5
    This topic is closed:
    http://discussions.apple.com/thread.jspa?threadID=1195773&start=0&tstart=0
    I suggest to reopen one here. Cool if all affected users send the following message to Apple via the feedback form (http://www.apple.com/feedback/macosx.html):
    +Dear Apple dev team,+
    +I would like to know what is the status in resolving the original Bug ID# 3792802 "Artwork Missing from Front Row 2 with Shared iTunes".+
    +This issue has been around since Mac OS X.5.2, and is to my knowledge, still not resolved in X.6.5+
    +Thank you in advance for your answer.+
    Post your progress here. Thanks.

    This issue is still not solved in X.6.6,...
    By the way, no one has bothered answering to this topic. I'm saying sending feedback to Apple is a good idea, but that is the only way I could figure. Any other ideas from your side?
    Has anyone sent feedback to Apple? If not, please give their dev team some feedback about this issue.
    Thanks. Comments appreciated.

  • Use Java to collect data from HTML

    Hi Guys
    I am doing a online stock trading project, the main part is to collect raw data from http://finance.yahoo.com User can retrieve the stock detail by inputting the right stock symbol, such as "AOL". I dont have too much problem in this part because yahoo provde a spreedsheet format to display the result. If you type the URL below, it can bring you a set of stock data separating by comma. So, I can use StringTokenizer(date, ",") to collect each data from yahoo into my system.
    ========================================================================
    http://finance.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=AOL&
    "AOL",15.57,"8/12/2003","4:01pm",+0.04,15.47,15.63,15.40,12097200
    ========================================================================
    However beside this function, I also need to search Stock Symbol, because user may only know the company name. Although Yahoo finance also provide this function, with no spreedsheet format provided. So, if I type the URL below, it will only give me a set of result BUT in HTML format.
    ========================================================================
    http://finance.yahoo.com/l?s=AOL&t=S&m=
    ========================================================================
    So, can anyone tell me what is the best way to collect data from a HTML page? Or anyone know any good stock quoting sites which also provide spreedsheet format?
    Thank you very much
    Kel

    I am doing a online stock trading project, the
    the main part is to collect raw data from
    http://finance.yahoo.com
    Sounds fun.
    So, can anyone tell me what is the best way to
    to collect data from a HTML page? Or anyone know any
    good stock quoting sites which also provide
    spreedsheet format?I really don't know any other stock quote sites. But if you want to implement a search function for stock names, I would do it like this
    1) Code the HTTP SUBMIT/POST to lookup the possible stock names
    2) Use XSL to filter out the HTML path to the table with results, the layout is consistent, so there are no strange exceptions. You can check the DOM structure by using Mozilla's DOM inspector. Just write down the path to the TABLE element and select it, and transform it to CSV for example.
    3) Reparse the CSV to fill some boxes
    To possibly save some server load use a small fixed size in memory cache to store N requests based on some strategy.
    The other part is actual a separate part of what you want to code and should be a separate class in which you can feed the stock name.
    If the user types in a bad stock name, you can retrieve a list of possible names using the input as the company name.
    Greets.
    Maybe there is a SOAP service out there somewhere.

  • Using java to get stuff from xml

    Hi,
    i need to parse stuff from XML file into java from different nodes and attributes. I thought of using the DOM. can you all suggest any sites that have examples to that or give me some suggestions on how to code it?
    Thanks!

    http://java.sun.com/webservices/docs/1.0/tutorial/index.html

  • Possible to use JavaScript to Import Data from XML file to pre-fill fields?

    Hi,
    I have a dynamic fill-in PDF that I want to "pre-fill" internally in my company before sending out to users who will change any pre-filled fields necessary and answer questions we did not already answer.
    We do not have LiveCycle Reader Extensions, but we can use Acrobat to import data from an XML document to pre-fill the named fields.  Is it possibly to do this task using folder-level Javascript or some other method?  I can look into this, and post my findings, but I'd like to know if it's possible or if I need to use a different programming language.

    Hi,
    I am afraid that solution was for a specific client and I can't share it. If I get a chance I will mock up an example, but this wont be for a while. From memory it was just a straight importData method. This would normally fail silently in a non-certified form, but when the form is digitally signed/certified, it works without a hitch.
    Good luck,
    Niall

  • Using an array to read from and write to files

    my problem is, I do not know how to do this program, it's like an inventory warehouse program that uses an array to store the items, then I have to use a keyboard input to run through the program the first time, using a write method to save the file, and a read method to go through the program a second time and resave it to a different file with the write method, I've asked countless times for help, but the instructor just won't help, so I was hoping I could get some help here, and if I don't get this done, I'm going to end up failing the class.
    also, the requirements are listed here as well, so it can be better understood.
    Write a program that:
    1. allows the user to choose whether the inventory data comes from a file or from the keyboard
    2. allows for up to 20 inventory items
    3. if the data comes from the keyboard, asks for all inventory information (item name, number in stock,
    initial warehouse, and value of one item)
    4. if the data comes from a file, displays the inventory information for the item.
    5. for each item, asks the user how many items to add or delete from inventory
    6. determines whether an item must be moved to a different warehouse and changes the location if
    necessary (note, it may be necessary to move an item to a smaller warehouse)
    7. once all inventory changes have been made, for each warehouse displays the items in the warehouse, the
    total number of items in the warehouse, and the total value of the items in the warehouse.
    8. once all inventory changes have been made, stores the item information in a file (which can be used for
    the next program run)
    9. asks the user for the names of the input file (if data is coming from a file) and the output file (always).
    p.s. I can post the source code for it if it's required for the help.
    Thanks,
    Xandler

    my specific question is how I would go about using the scanner utility to tell it to input from the file or keyboard, if from keyboard it's manually item information is done manually, if from file it asks the user for the file name and the user selects it, then it saves it to a file, can't really post what I've tried because that's the problem, I don't know how to go about doing it and the instructor won't help me, I know though that it requires a file read method for the 2nd run, and a keyboard input for the first and a write for the saving of the file(s).
    Thanks,
    Xandler

  • Flash Log In From with Shared Objects

    So i want to create a flash log in and registration form for my flash game. THis game is played on your local PC not in the internet and i am using AS 2.0. So on the registration from i want to have two input text fileds: username and password. When you click on register the data from those fields to be saved as Shared Object and then on the log in when you type something in the log in fields (again two fields : username and password) the data that you wrote in those fields to pass trough the saved data as shared objects and if those two are the same then the log in is successfull if i want the movie to go on a certain frame whare it says access denied. pls help

    if you use the obviously named textfields:
    var so:SharedObject = SharedObject.getLocal("login","/");
    if(so.data.username==undefined){
    //need to register and assign:
    so.data.username=usernameTF.text
    so.data.password=passwordTF.text
    loginBtn.onRelease=function(){
    if(so.data.username==usernameTF.text && so.data.password==passwordTF.text){
    //successful login
    } else {
    //login failure

  • Manually Moving VMS from HOST to HOST *WITH* Shared SAS Storage

    Hi,
    Environment will be 2 Windows 2012 R2 Hyper-V servers.
    They will be connect via shared SAS.  These are two identical IBM servers with shared SAS storage
    I am hoping to eliminate using MS Clustering of the Hyper-V servers just to keep things straight forward.
    In the event, I had a complete failure of one of the  physical server Hyper V hosts, I was hoping be able to manually add/import (not sure what the terminology is here) and run the virtual machines on the second host until the first is repaired.
    If there is third party software that can do this, I would entertain it.
    In VMware (I had two hosts and would manually remove them from inventory on one server and add them to a second server). 
    Ideally, if I could keep both Hyper-V hosts in a Windows Workgroup and as vanilla as possible.
    Thanks in Advance,
    G

    Hi,
    Sorry for the late reply.  I have been researching all I can. And thanks to all for your patience and help!
    Let's start with the hardware to help paint the picture:
    2 @ IBM X3550 M4
    1 @ IBM V3700
    The two X3550's are going to be connected via 6GB SAS Cards (2/server for redundacy)
    Current environment (residing on VMWare with older IBM Xseries servers DS3524 connect via SAS connections)  40 users total.
    Windows servers are:
    1 @ SBS 2011 (One and only AD/PDC)
    2 @ Windows 2008 Servers that are CRM (these are Windows Member Servers)
    5 @ Windows 2003 servers that are going to be replace with Windows 2008 Servers (these are Windows Member servers) (low usage servers)
    Just to recap:
    The current environment running VMware 4.1 has both IBM X3500 servers able to see a  single 1.5 TB lun (SAS connected) presented by the DS3524.
    Currently, in VMware, I can see the same LUN on both servers.  I have all my VM's on HOSTA, if HOSTA should suffer a system board failure, I manually connect to HOSTB with the VMware client and add the VMs that I can see on the shared LUN
    and add them to HOSTB.
    My understanding is that its strongly recommend that my DC (not sure if they are implying PDC or BDC) on a physical server.  My hesitation is now I have to introduce a DC to SBS 2011 and manage a physical server and deal with with SBS 2011's quirks.
    So I was hoping that if I presented a LUN to both my HyperV hosts (In a Workgroup), and created on my VMs on hostA, if something went very bad with HOSTA,  I could connect to HOSTB and "Import" them and manually start the VMs, especially since
    SBS 2011 is sensitive.
    The client is okay with some downtime, so if the process is supported and works, then I am okay with doing the work.
    Clustering or even Replicas will add:
    Complexity to the environment
    Patching needs to be carefully planned as it would not look good to have to failover due to a Windows update on the primary host.
    The tech's that support that environment will now need to know about Clustering and/or Replication ontop of the SAN stuff
    I am looking at Veeam, Double-Take to see if they can work with 2 @ 2012 Hyper-V hosts configured in a Workgroup.
    The SBS 2011 is the "hinge" that will make or break the success of this project.  I personally love the way 2012 Hyper-V works, but it would be great if a physical server outside of the HyperV hosts was not required.
    Thanks !
    G

  • Can i use airport extreme as wifi range extender in conjunction with a Linksys AE4500 router

    can i use airport extreme base station as wifi range extender in conjunction with a Linksys AE4500 router

    If you are trying to "extend" using wireless only......Apple tells us that their "extend a wireless network" feature is designed to only work with other Apple routers.
    So, in order to use your AirPort Extreme as an extender, you would need to have another Apple router.....an AirPort Express, Time Capsule, or another AirPort Extreme as the main base station.
    I haven't tested the specific Linksys model that you have, but have owned and worked with several other Linksys models, none of which were compatible with Apple for the purpose that you ask about....so I would have to say that it is extremely unlikely that your model would be compatible with the AirPort Extreme.

  • Can i use Airport Express as a range extender in conjunction with my standard (non-Apple) hub ?

    I have poor Wifi signal upstairs in my house. Can Airport Express to extend that in conjunction with my current Hub (it's a Livebox - i currently live in France) ? Or do i need to run the Airport Express in conjunction with an Apple Hub ?

    Bonjour!
    You can extend the Livebox, just not wirlessly as Apple's implementation of WDS only works with other Apple devices.
    So you can either use an ethernet cable or as I do with my netgear router turn off the Livebox's WiFi (If that's possible) and use Airports to set up a separate wireless infrastructure.  Get 2 APs and plug one directly via etherenet into the Livebox then use WDS to extend this to a second AP wirelessly.
    Regards,
    Shawn

  • Strange behavior when using Labview to collect data from Tektronix tds8200 oscillosco​pe

    I have hit a wall in trying to figure this one out. The problem I am having is that my program does not start the oscilloscope when it should.
    I am using a Tektronix TDS8200 oscilloscope. My goal is to collect waveform data from the oscilloscope using Labview. My program first initializes and configures the oscilloscope; this part of the program runs fine.
    The second part of the program begins the data aquisition using the  'tktds8k Start or Stop Aquisitions.vi' function, which is equivalent to pressing the Run button on the scope. The 'tktds8k Get Waveform.vi' function is then used and should ideally return the data, which I have connected to a waveform graph for visualization.
    When I run my program, the first part executes without issue, but as soon as the program gets to the Get Waveform function, the Run button on the scope, which is green when running, turns off; the program then times out, and no data is collected.
    Here's where it gets weird. I went through some debugging to try and figure this out, and I put breakpoints on both the Start and Get Waveform functions so that I could step through the later part of the program. The program continues through the Start function, and the Run button on the scope is green. The breakpoint for the Get Waveform function is reached, and when I press continue, the Run button turns off and then turns back on almost immediately; the data is collected, the waveform graph is displayed, and the program exits without an error.
    I thought timing might be the issue, so I made the program wait as long as 5 seconds between the Start and Get Waveform functions, and that did not work. I also tried moving the Start function to before the configuration functions, and removing the Start function altogether; neither method worked.
    Are there any thoughts on why the program works when I have the breakpoints enabled and doesn't when the breakpoints are disabled? I am sure that there is an easy fix, but I haven't been able to find a solution.
    I have attached a pdf containg information on the Oscilloscope functions (tktds8k.pdf), and I have also attached my program.
    Solved!
    Go to Solution.
    Attachments:
    tktds8k.pdf ‏1424 KB
    set_up_osc.vi ‏32 KB

    Thank you for the swift replies.
    After Bill asked about the ID Query, I decided to try a few things that I had already gone over just to double check. I was suspspicious that timing was the source of the error. Using a timed while loop, I set the wait time to 10 seconds and got results. As it turns out, 5 seconds is not long enough, but 8 seconds is a sufficient wait time for the program to work. With the problem solved, I am still mystified as to why waiting 8 seconds is required.
    I think that the oscilloscope must be given sufficient time to display the signal on-screen before the Start Aquistion or Get Waveform functions are used. With this logic in mind, the breakpoints were acting as a sort of wait, allowing the signal to be displayed before continuing through the program.
    In response to Jeff, I am indeed using an external direct trigger. The hardware is sound, but apparently, my coding could use some work.
    I have attached the modified code. I am certain that there is a more elegant solution to the timing than simply slapping a timed while loop on the code. Any suggestions?

  • Using Query to fetch data from xml file

    Hi guys ,
    Just want to know , how to fetch data from an XML file in adobe flex? i have a database generated xml file.

    you can use httpService.

  • Using LINQ to extract list from XML [OpenXML]

    The following is the XML file that is generated from Word document through OpenXML:
    XML Link here
    I want to get the following list using LINQ:

    Hi,
    Take a look at this blog post:
    http://blogs.msdn.com/b/ericwhite/archive/2008/07/10/how-to-create-hierarchy-from-flat-data-using-linq.aspx
    It does exactly what you are wanting to accomplish.
    One point - if you want to get the text of those headings exactly, including the numbering, then you will want to make use of ListItemRetriever, which returns the list item (i.e. 1.1.1.1) for any given paragraph that is part of a numbered or bulleted list.
    http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2014/04/03/announcing-a-complete-re-write-of-listitemretriever-cs.aspx

Maybe you are looking for

  • How can I change a folder icon. Or at least change the background color. Folders are great for organization but the are SO ugly!!!!

    Want to be able to change my folder icon to a different icon image or at least change the background from dismal grey to a different color!

  • Strange schema validation error

    Hi, I have the following piece of schema: <xsd:complexType name="New Item"> <xsd:complexContent> <xsd:extension base="xyz:Item"/> </xsd:complexContent> </xsd:complexType> <xsd:element name="New Item" type="xyz:New Item"/> and I got the following erro

  • How to view definition of a view in the database

    Hi ! I want to see the definition of a view that has already been created in the database. Incidently I misplaced its script. How can I see the definition since when I go to all_views table, it shows text as long datatype aand can't be displayed in s

  • How to open the phone's hidden files using Nokia P...

    Hello. I am Callista. I like to explore my cellphones using Nokia Phone Browser. Some of the files can be opened while others can't. Graphics menus, which containt clip art ect. are visible. But why gallery menu especially ringtones invisible. Are th

  • Sharing ripped tunes

    I have a large library of MP3s, all ripped from CDs I own. I have a shared family computer (a MacMini), and my itunes library is set up and seems peachy keen for personal use. But I want to be able to share the files I have with other members of my f