If I have this on the flash timeline, (CS3 or Flash 8)

import test.Test;
var test:Test = new Test(this);
*test.init( );*

----------------------------------------------------------------------

and then the class code has this

class test.Test
{

    private var m:Model;
    private var clip:MovieClip;

    function Test(clip:MovieClip)
    {
        this.clip = clip;
        trace ("test");
        trace (this instanceof Test);
    }
    public function init():Void
    {
        trace (this instanceof Test);
        m = new Model();
        trace ("m = " + m);
    }

----------------------------------------------------------------------
it traces:
test
true
false
m =

----------------------------------------------------------------------

but if I the init call originates from the constructor, instead of from the
main timeline, ie
function Test(clip:MovieClip)
    {
        this.clip = clip;
        trace ("test");
        trace (this instanceof Test);
        *init( );*
    }

it traces:

test
true
true
m = [object Object]

----------------------------------------------------------------------

does anyone know why the "m" value disappears when the init method is called
from the timeline?
.

Thanks in advance.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to