A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: MovieClip variable

Hybrid View

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Posts
    12

    MovieClip variable

    In a MovieClip named testMC, there is a function,

    loadCodes();
    function loadCodes() {

    this.col = _root.DropZone;
    this.ast = _root.temp;
    this.col.tmp3 = 0;

    ...


    But I can not find the place where the col, ast, and tmp3 are defined.

    Are the col, ast, tmp3 created at run time or they are the implicit attributes
    , no need to explicitly define. If so, what are the "col", "ast", and "tmp3"?


    Thanks

    Scott

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    they are actually being declared and defined at the same time.

    "col", "ast", and "tmp3" are not reserved words, they are arbitrary names made up by whoever provided this script to you.

    this line:
    this.col;
    just creates a property called col on whatever the keyword this refers to.

    this line:
    this.col = _root.DropZone;
    both declared the property and gives it a value.

    These properties can be any datatype, they figure out their datatype depending on type of value you assigned to it. If _root.DropZone refers to a string, this.col is a string datatype.

    Only members of the object datatype (known as the object class) can have properties applied to them. So I know that _root.DropZone refers to an object. I know this because this line:
    this.col.tmp3 = 0;
    wouldn't work otherwise. In order to assign the property tmp3 to col, col must be an object.

  3. #3
    Junior Member
    Join Date
    Apr 2007
    Posts
    12
    Great answers! Thanks. --Scott

  4. #4
    Junior Member
    Join Date
    Apr 2007
    Posts
    12
    For the line:

    _parent.SplitArray.push("abc");

    I did not find the declaration for SplitArray. I expect something like this:

    var SplitArray = new Array();

    But, the there is no such declaration in the codes.

    Can I say that the "SplitArray" is created and populated at the runtime (or dynamically)?


    Thanks


    Scott
    Last edited by otnj2ee2; 05-03-2007 at 03:19 PM.

  5. #5
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    an array should always be declared before use of them. I'm not even sure if you can declare and push at the same time. Use flash's find and replace and search for SplitArray in all source. Perhaps there was a parent movie to the one you're working on.

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