A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: prototype issues

  1. #1

    prototype issues

    I'm new to the protoype command, but there is a script I'm using for a puzzle, and it uses it. Here's an example:
    function pieceClass() {}
    pieceClass.prototype = new MovieClip();
    for (var i = 1; i<31; i++) {
    	Object.registerClass("puzzle"+i, pieceClass);
    	this.attachMovie("puzzle"+i, "piece"+i, i-31);
    so any subsequent instances of "puzzle", even if i'm dragging it straight out of the library rather than dynamically attaching it, they still inherit all the properties.

    how do i "disconnect" the prototype from just the new instances??
    i'm so frustrated and lost.

  2. #2
    is there some kind of "unload" function for prototype functions?

  3. #3
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    San Francisco, CA (USA)
    for (var i = 1; i<31; i++)
    Object.registerClass("puzzle"+i, null);

  4. #4
    ok. I tried that, just like you said, but the prototype properties won't go away. I even tried running this function right after the one that initializes the prototype properties just so I could see if it would take them away.

    no dice.
    am I doing something wrong? they're all in the same level so it's not a matter of targeting..

    any ideas are greatly appreciated. thanks for your help senocular!

  5. #5
    never fails, right after i finish with the post, i figure it out.

    needed to use the same function name.

    thanks man! you rock!

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