In theory, instead of decoding this.url, you can look at the 
document.parameters.projectName

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Adrian Williams
Sent: Thursday, January 22, 2009 9:35 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] SOLVED...Simply!!! Re: Passing variables from .swf to 
.swf


Hi All,

    First, thanks very much to all the great ideas that were thrown at me on 
this one...in the end, we were all very much over complicating this...

    Quite simply, from the dashboard, in each SWFLoader, I simply add a 
deeplink (probably not needed but...) with a simple name-pair.  I.E.  
SWFLoader.source = widget.source + "#project=" + projectName;

    Then in the widgets, I simply access this.url, which is unique to each 
instantiation of the widget and simply substring the url to get the 
projectName...

                var urlString:String = String(this.url);
                projectName = urlString.substring(urlString.search("=")+1);

    This works perfectly and gets the data that is specific to the tab....and 
in this way, my users only have to endure one data load event instead of 
multiply recurring events every time they change tabs.

Thanks!
Adrian

Amy wrote:

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, "Tracy 
Spratt" <tspr...@...> wrote:

> Using a model and events is probably "best", but you can also go
> straight through dom references. Listeners can be added to
dynamically
> created components, so you would not need specific, named references
to
> the child swfs.

Note that you probably want to still keep references to your swfs
somewhere, so that you can remove the listeners if you need to make
sure they get garbage collected. You'll probably want to do this in an
Array or ArrayCollection so that it can expand with the number of swfs
you create.

Or you can just use one swf and move it around :)

HTH;

Amy

Reply via email to