A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Target a MC with LoadVars

  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    60

    Target a MC with LoadVars

    I'm trying to load an external txt file into a dynamic text box..

    When I do it all in the scene root, it works perfectly. I make a dynamic textbox, give it an instance (no var., multiline), and on an empty frame, I paste this code :

    Code:
    myData = new LoadVars();
    
    myData.onLoad = function() {
    
    test_txt.text = this.content;
    
           };
    
    myData.load("content.txt");
    Everything works fine that way, it loads the content of the file in the test_txt text box.

    But what if the dynamic textbox is inside a MovieClip, and the code in the scene's root ?

    I also tried it with the loadvars inside the movieclip, without success... Can't seem to be able to specify the MC instance.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    _level0.container_mc.test_txt.text = this.content;

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