Link to home
Start Free TrialLog in
Avatar of Anubis2005
Anubis2005Flag for Vanuatu

asked on

Passing variables between swf's

Hello All,

Beginning with flash only a few weeks ago, I have had to jump right into some pretty tricky areas...  At the moment, my sticking point is trying to pass variables between two swf files.

(Main SWF Loaded From Browser)
        (Child MC in library)
              (Child MC loaded from external)

It is the bottom most SWF which needs the data located in the Main SWF.  In the main swf I have an array defined as:

_global.ArrayObj = new Array();
ArrayObj[0] = new Array({item1:Value, item2:Value, n...})

    (or)

_global.ArrayObj = new Array();
ArrayObj[0] = new Array(Value1, Value2, n...})

I have also tried several different options such as references using _root with lockroot, direct calls to _parent._parent etc, but nothing appears to work.  However one strange instance, it appears as though when calling this from the bottom most child:

_global.ArrayObj[0] is returns [object Object] however when referencing the items both by name .item1 or by number [0] it returns undefined.

Does anyone have any ideas?

Thanks
-Anubis
SOLUTION
Avatar of Dushan Silva
Dushan Silva
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anubis2005

ASKER

Thank you for your quick comments.

Looking at it again this morning with fresh eyes, I noticed the very trailing end of the array.  It appears as though the items being loaded into the array are being undefined when set and consequentally undefined when being called.  It had me stumped cause I was sure (as is true) that I had the code correct.

Thank you again.
-Anubis
Avatar of MHenry
MHenry

Asked by Author to reopen question. Said he wished to split points.

MHenry
PE