On 3/21/06, Merrill, Jason <[EMAIL PROTECTED]> wrote:
>
> I know it's a personal thing, but I usually try and avoid using _global
> variables (in fact, I use them so little, this is probably why I have
> this question), but I found a case where I needed to use them - at least
> temporarily for testing purposes.  Without going in to why I'm using one
> (please don't ask, just humor me :) ), I found a weird behavior I cannot
> explain.
>
> Say clip A is the main _level0 clip where the _global.myVar is defined.
> Clip B is an external .swf references the _global myVar.
>
> When I test my Movie (crtl+Enter) for the main _level0 clipA it loads
> clip B in fine and reads the _global variable in fine as well as
> expected.  However, when I test the main _level0 clip A in the browser,
> clip B does NOT read the _global variable as it did in the Flash IDE
> test mode - it's showing as undefined  - why? I thought _global was
> _global in the 'ol grande document level stack? No?
>
> This is true from clip B if I try accessing it via either myVar or
> _global.myVar.
>
> Thanks for any insights,
>
>
Two possible things which may cause problems, not sure if it is in your
case:
1. If the swfs are published to different versions of the flash player(for
example, a v7 swf and a v6 swf), they won't be able to read each other's
_global's
2. If the swf's are in different domains, they may not be able to read each
other's globals (not completely sure about this), without specifically
allowing the domains using System.security.allowDomain() (in both
directions, A allows B's domain, B allows A's domain)

3. A loading issue? I've had problems where things work offline, but not
online, due to me not checking if certain resources are completely loaded
yet. (Yes I know this is vague, but it's a general hint)


hope this helps,
David R
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to