A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] [F8] External .as onLoad function help

  1. #1
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392

    resolved [RESOLVED] [F8] External .as onLoad function help

    Hello everyone, I am having trouble getting an onLoad to work correctly.

    I have a dynamic text box that I populate with a button on the stage. I am using an external .as file to tell everything what to to and how to do it.

    My problem is, with this method I have to give the dynamic textbox both a var name and an instance name, otherwise my coding will not work. That spawns the problem that the dynamic text box is filled with the "Level0.mc.textbox" gibberish when the movie loads.

    If I tell the textbox to display "" on load it won't work.

    So far the only way I have found to do this is to place this on the parent MC (that holds the textbox)

    Code:
    onClipEvent(load){
    	this.dynamicTxt = "";
    }
    Where "this" is the parent MC and "dynamicTxt" is the var and instance name of the text box.

    I am trying to find a way to put this in the .as file, but nothing I have tried works, including setting a function, or using relative and/or absolute pointers.

    Anyone have any ideas?

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

  2. #2
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392
    I got it. Just used this.onLoad = function() {} in the .as and it works.

    Although how the as knows what "this" is doesn't make much sense to me. LOL

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

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