Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2009
    Location
    Worcester
    Posts
    172
    Thanks
    13
    Thanked 6 Times in 6 Posts

    Getting the value from an Array?

    Hi all,

    I've got 2 arrayCollections, one populates a list control, the other lies dormant until a user selects something from the list, an event is triggered which basically gets the image data from a sperate database holding the image info.

    So, if a user selects something, it brings up all the details of the object they selected, but the image data isn't stored in that database. A RemoteObject request is submitted and passes the 'model' argument to CF where it then selects the image from imageTable where model = #arguments.model#. This works fine. But it gets returned as an arrayCollection or an array, how can i access the data using dot notation?

    i have a bindable var called imageData which is the resultHandler's arrayCollection from the ro.seeImage.

    Here's the code:
    Code:
     private function displayInfo(event:Event):void
         {
    	myDetails = new Object();
    	myDetails = event.currentTarget.selectedItem;// get details from the selected item
    	var modelPic:String = details.model;// set the model info to string
    	ro.seeImage(modelPic);// send the info to the remote object
    	model.text = details.model;
    	make.text = details.make;
    	image.load('assets/temp/' + //whatever the dot notation is or var from the arraycollection i have set up in the resultHandler?);
         }
    i've tried imageData.image, imageData.getIndex([0]), i've tried to create a new object from the imageData var but i need some way of triggering it or selecting it??d

    Hope i've explained this ok?

    Really hope someone can help with this

  • #2
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,008
    Thanks
    59
    Thanked 10 Times in 10 Posts

    Thumbs up

    hi , try this:

    Code:
     private function displayInfo(event:ResultEvent):void
         {
    	myDetails = new Object();
    	myDetails = event.currentTarget.selectedItem;// get details from the selected item
    	var modelPic:String = details.model;// set the model info to string
    	ro.seeImage(modelPic);// send the info to the remote object
    	model.text = details.model;
    	make.text = details.make;
    	image.load('assets/temp/' + myResultArray[0].data//whatever the dot notation is or var from the arraycollection i have set up in the resultHandler?);
         }



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •