Short answer:
  Define properties (AKA Variables) in the subpod (AKA component).  Use 
parameter passing (potentially with data binding) to send variables from 
the "main" component into the subcomponent.

  If you're using a ViewStack, keep in mind that the view probably won't 
be initialized until it is displayed, and accessing it will probably 
cause errors.

  Not sure if this helps.  Your code sample is not enough for me to 
diagnose the problem.

Scott Brady wrote:
> (Sorry if this is a frequent question, I tried searching but didn't
> find anything that matched what I'm trying to do)
> 
> My company's just getting started with Flex and I'm building an app
> based on the Adobe Dashboard sample app.  Basically, we have two tabs.
> The first tab shows a bunch of bar charts (they're all similar data,
> with different categories).  Two of the charts are going to be
> clickable -- when you click one, the other tab (the "Details" tab)
> will show up presenting the data in grid form.  The problem I'm having
> is I need to pass parameters into a function in that details display
> pod from the main mxml file.  I could probably accomplish it by
> running a function in the main mxml file, but I want all of my pods to
> be as independent as possible so other future dashboards could also
> use this pod.
> 
> Here's basically what I'm doing.  Clicking the chart calls this function:
> 
> ----------------
> BEGIN CODE BLOCK
> ----------------
> public function showDetailView():void
> {
>       var index:Number = 1;
>       
>       StateManager.setViewIndex(index); // Save the view index.
>       
>       viewStack.selectedIndex = index;
> 
>       // If data exists then add the pods. After the pods have been added
> the data is cleared.
>       var podLayoutManager:PodLayoutManager = podLayoutManagers[index];
>       if (podDataDictionary[podLayoutManager] != null)
>               addPods(podLayoutManagers[index]);
> 
> //    podLayoutManagers[index].items[0].getDetailData();
> }
> --------------
> END CODE BLOCK
> --------------
> 
> It's that last (commented-out) line where I'm trying to find a way to
> call the function. But, I can't figure out where in the document model
> that function would be, even after using watch expressions in the
> debugger.
> 
> Is it simpler than I'm making it out to be?  Or, is there a better way
> to accomplish the same thing (keeping the pod as independent as possible)?
> 
> Thanks in advance.
> 
> Scott 

-- 
Jeffry Houser
Flex, ColdFusion, AIR
AIM: Reboog711  | Phone: 1-203-379-0773
--
Adobe Community Expert 
<http://www.adobe.com/communities/experts/members/JeffryHouser.html>
My Company: <http://www.dot-com-it.com>
My Podcast: <http://www.theflexshow.com>
My Blog: <http://www.jeffryhouser.com>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:5203
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to