A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Access array elements throw different swf's

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    4

    Access array elements throw different swf's

    Hi there,

    I need to access the elements of an array that is declared in the main swf(_level0). But I need to change it from another swf.
    How can I do it??

    So far I have this:


    MAIN SWF:

    var vector1:Array = [biblio_vid1, biblio_vid2, biblio_vid3, btn_1_4, biblio_vid4];

    OTHER SWF:

    var vector2:Array = _level0.vector1.slice();
    trace(vector2); // undefined,undefined,undefined,undefined,undefined



    Thanks!

  2. #2
    Senior Member
    Join Date
    Jun 2003
    Location
    Kent, WA
    Posts
    536
    Curious... I wonder if it's failing to evaluate the paths because it's referencing the wrong level? Clearly it's copying the array if it's returning multiple undefined's; it's just the contents of the array that's awry.

    What happens if you individually access the array elements like this:

    Code:
    var vector2:Array = _level0.vector1.slice();
    trace(_level0[ vector2[0] ]);
    Also make sure that the instances of the movieclips referenced in the array are actually on the timeline when your other SWF is trying to access them.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center