Link to home
Start Free TrialLog in
Avatar of jabronicus
jabronicus

asked on

Flex: ArrayCollection :: Using Javascript Array to populate the ArrayCollection

I am developing a panel in Photoshop with Flex and Extendscript. I am pretty close to getting this to work, but with my Flex skills I am having a little issue with the Array I am pulling in from the jsx file. The function is being called but I am not sure that my grabFolderNames.data is the js array. Thanks for any help on this.

Here is my Flex
protected function loadData():void {
    var grabFolderNames:SyncRequestResult = CSXSInterface.instance.evalScript("labNames");
    var list:String = grabFolderNames.data;
    var array:Array = list.split(",");
    var arrayCollection:ArrayCollection = new ArrayCollection();
    arrayCollection.source = array;
    labFolderList.dataProvider = arrayCollection;
}

Open in new window


and here is the jsx:
function labNames() {
  var labs = ["Red", "Green", "Blue", "Purple", "Yellow"];
    alert("This function is firing" + labs);
}

Open in new window

Avatar of dgofman
dgofman
Flag of United States of America image

change to

var array:Array = list.split(",");
labFolderList.dataProvider = new ArrayCollection(array);
ASKER CERTIFIED SOLUTION
Avatar of jabronicus
jabronicus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jabronicus
jabronicus

ASKER

I've requested that this question be closed as follows:

Accepted answer: 0 points for jabronicus's comment #37693677

for the following reason:

This is the answer. ArrayCollections have to be dealt with as Object and XML
Sorry you disagree my friend, but your reply in #37691579 offers no additional content that is not in the original question.

Also your assumption that I have not spent time investigating the problem assumes that you can judge the amount of time that I spent coming up with the solution that I provided, that in the context the question was proposed SOLVES the issue.

I enjoy using this forum and have always had great relations with those that provide help, and by your statistics you have supplied help to many. However, in this case, dealing with Flex and Photoshop Panels, my own solution solved the ASKED question and it would be a diservice to to the forum and knowledge base to accept anything that you offered as a solution.
Sorry you disagree my friend, but your reply in #37691579 offers no additional content that is not in the original question.

Also your assumption that I have not spent time investigating the problem assumes that you can judge the amount of time that I spent coming up with the solution that I provided, that in the context the question was proposed SOLVES the issue.

I enjoy using this forum and have always had great relations with those that provide help, and by your statistics you have supplied help to many. However, in this case, dealing with Flex and Photoshop Panels, my own solution solved the ASKED question and it would be a diservice to to the forum and knowledge base to accept anything that you offered as a solution.