[flexcoders] accessing ArrayCollection in class

2007-08-27 Thread dylan_r
Hello,

I'm new to actionscript programming so this is certainly a newbie
question. 

I'm trying to access an array from the mxml file in a loaded
actionscript package. Not sure how to bind the data between the two.

mxml: 

...

Model id=pic_res source=piclist.xml /
Model id=links_res source=links.xml /

ArrayCollection id=myAC source={ArrayUtil.toArray(pic_res.pic)} /
ArrayCollection id=theLinks
source={ArrayUtil.toArray(links_res.link)} /

local:DisplayShelf id=shelf  horizontalCenter=0
verticalCenter=-10 borderThickness=5 

... 

I need to access theLinks array in DisplayShelf.as
I've tried using theLinks in the actionscript file but I get errors
saying theLinks is not defined. 


TIA,
Dylan




RE: [flexcoders] accessing ArrayCollection in class

2007-08-27 Thread Alex Harui
Not sure I understand.  ArrayCollection id=theLinks .. defines a new
variable in your MXML file.
 
If you want to get to the one in DisplayShelf, you might want to just
bind it directly?
 
local:DisplayShelf theLinks={theLinks.source}
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of dylan_r
Sent: Monday, August 27, 2007 8:01 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] accessing ArrayCollection in class



Hello,

I'm new to actionscript programming so this is certainly a newbie
question. 

I'm trying to access an array from the mxml file in a loaded
actionscript package. Not sure how to bind the data between the two.

mxml: 

...

Model id=pic_res source=piclist.xml /
Model id=links_res source=links.xml /

ArrayCollection id=myAC source={ArrayUtil.toArray(pic_res.pic)} /
ArrayCollection id=theLinks
source={ArrayUtil.toArray(links_res.link)} /

local:DisplayShelf id=shelf horizontalCenter=0
verticalCenter=-10 borderThickness=5 

... 

I need to access theLinks array in DisplayShelf.as
I've tried using theLinks in the actionscript file but I get errors
saying theLinks is not defined. 

TIA,
Dylan