Yes, also Application.application will give you a reference to the
top-level application.  As I said in my other post, there are many ways.

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of shawn.gibson
Sent: Thursday, March 15, 2007 6:15 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Unbelievably embarassing question - making
components talk (and modules) amongst

 

I'm sure it goes deeper than this (if you'll pardon the pun), but if 
you add 'parentDocument' to your parent (i.e., 
parentDocument.thumbloader.etc you get the kind of thing I'm hoping, 
at least for component-to-component-from-within-the-same-module.

I typed the name of the error message into the help screen. Go 
figure :S

Shawn

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "shawn.gibson" <[EMAIL PROTECTED]> 
wrote:
>
> Thanks to Tracy's earlier help, I was able to get at least the ugly 
> (i.e., my) version of HTTPService going (and I'll revisit it to 
> Tracy's specs one I figure this here problem out), but in order for 
> me to do it, I had to de-compartmentalize all my code. In other 
> words, I have originally been using an approach where each 
> major 'page' was a module loaded into a state of my main app, and 
> each major chunk of a module was made of a custom component (the 
> entire Tree, it's code, the little stuff; or the entire thumbnail 
> with all it's itemrendering in a HorizontalList...etc)- nice 
> separation of code, easy to understand in 6 months, and no 6,000 
line 
> files. Also offered me a fighting chance in the future to figure 
out 
> model, control, and view separation.
> 
> But for me to get (for example) the tree component I made to 
> communicate with the thumbnail component, both housed in the 
> galleries module, I had to hardcode the components back into the 
> module (i.e., they are no longer components), so the module is now 
> one big-ass file that has no components, they are right in the 
file. 
> 
> I can't go on like this, it's just too ugly. As a designer and a 
poet 
> wannabe, that sucks LOL.
> 
> But I can't for the life of me get things to talk amongst 
themselves, 
> say my module has 3 custom components doing their things...how do I 
> access something in one component from another component?
> 
> I became very afraid when I realized there doesn't seem to be any 
> kind of AS2/Flash dummy-movie approach - loadMovie ('thisthing') 
into 
> dummyclip instance 'whatever' and suddenly you just say 
> whatever.thisthing.stuff, and you've gained access to everything. 
In 
> other words, you can jump up and down as long as you know the 
scope. 
> I haven't a clue what the equivalent is in Flex 2.
> 
> It's very embarassing. I refuse to get through this weekend without 
> figuring it out. I'm not botching my gallery project by having 5-6 
> modules (as I DO want) but with thousands of hardcoded chunks 
within 
> them, when each module should by rights have nice piecemealed 
(sorry 
> for the word) custom components doing their thing from their own 
file 
> and from there communicating with each other. I need to use 
> components in the modules for my own sanity, and even worse, how do 
I 
> get one module to talk to another module's objects, functions, etc.?
> 
> In a word, you can't go from:
> 
> [EMAIL PROTECTED];
> srv.send();
> 
> ...strip it out into a component and then call the id of the 
parent, 
> i.e.:
> 
> [EMAIL PROTECTED];
> thumbloader.srv.send();
> 
> ...you get "Access of undefined property thumbloader" for your 
> troubles...
> 
> You can't back up a generation like you could with Flash. Or if you 
> can, I'm missing big bits of the puzzle.
> 
> Any suggestions, other than take a chill-pill?
> 
> Thanks guys,
> 
> Shawn
>

 

Reply via email to