Hi Tracy,

You were correct! By changing the delimiter to "?", the parameters value was picked up. I am assuming that it will also populate each name pair instance such as: ?project=projectName&loginId=username

Would this give me document.parameters.project and document.parameters.loginId?

Thanks,
Adrian

Tracy Spratt wrote:

It may be the "#". If you append url parameters to the swf url, you can access them in this.parameters.

...myWidget.swf?project=myProject

I have done this, sorry I didn't think to suggest it.

Tracy Spratt
Lariat Services

Flex development bandwidth available

------------------------------------------------------------------------

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

Hi Alex,

Just for giggles, I tried that and while the document.parameters object exists, it's empty. I also tried several other possible areas and they are the same. Was worth trying though!

Thanks,
Adrian

Alex Harui wrote:

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...@...> <mailto: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