;

PDA

Click to See Complete Forum and Search --> : extend the movieClip object?


swrzzzz
12-11-2006, 06:59 PM
Hi

I am trying to create a new object which extends the MovieClip.

I have modelled this code on some MM examples but I don't see the hello world

Can anyone tell me what I have done wrong? (probably loads :-( )

Ta

Steve

My fun file has only this actionscript.....

#initclip

function SWR_Tree()
{
this.createTextField("tf",100,20,20,200,200);
tf.text="hello world";
}

SWR_Tree.prototype = new MovieClip();

Object.registerClass("SWR_Tree",SWR_Tree);

#endinitclip

attachMovie("SWR_Tree","tree", 101);

swrzzzz
12-26-2006, 11:31 AM
Hi

This one has sat for a while and I am still stuck...

Does anyone have a simple example of how to write an object which is a MovieClip in KM? I have tried to work it out from the KC8 and MM examples but nothing I try seems to work.

Thanks as usual

Steve

w.brants
12-26-2006, 01:44 PM
Maybe #initclip isn't supported in the main timeline :confused:
How I get your code to work is like this ...

Add a movieclip to the symbol library with link name SWR_Tree and add this part of the code to it's first frame.#initclip

function SWR_Tree()
{
this.createTextField("tf",100,20,20,200,200);
this.tf.text="hello world";
}

SWR_Tree.prototype = new MovieClip();

Object.registerClass("SWR_Tree",SWR_Tree);

#endinitclipNow addattachMovie("SWR_Tree","tree", 101);to the first frame of the main timeline.

That should do it.

swrzzzz
12-26-2006, 03:53 PM
Thank you! yes that works

I have been working n a tree type nav bar. Now I can run it as a movie clip from the symbol table I will pop it on KoolExchange in the next day or so

Cheers

Steve