Hello Jiri,

do you absolutely have to use an enterFrame function ?
you can write an init function like this :
function init (myMc:MovieClip,myLabel:String,mySize:Number,hasIcon:Boolean) {
        myMc.setLabel(myLabel);
        myMc.setSize(mySize);
        myMc.setIcon(hasIcon);
}
init(toto_mc);

This function won't make your movie flick.

Hope this helps,


Gilles

Le 18 avr. 07 à 14:55, Jiri Heitlager | dadata.org a écrit :

Hello list,

I have made a very simpele MovieClip that functions as a generic button,
this is clip 'gen_btn_mc'.
For the designers it is important that I place the gen_btn_mc on stage
and not attach it at runtime. The gen_btn_mc clip itself has a few
functions on the 1st frame of its timeline, these are:
setLabel()
setSize()
setIcon()

Because the button is place on stage during authortime, it seems the
functions of the gen_btn_mc can only be called after one 'onEnterFrame'
because it seems the functions are 'undefined' otherwise.

EXAMPLE

clipInstance0 is set on stage timeline. Then on the stage timeline I
have to put this code.

onEnterFrame = function(){
        clipInstance0.setLabel('hello world')
        clipInstance0.setSize(200)
        clipInstance0.setIcon(true)
        delete this.onEnterFrame
}

This makes the clip flicker, and it is clearly being set, becuase of the
one onEnterFrame loop.

QUESTION

Is there a way I can overcome this init. problem WITHOUT attaching the
clip at runtime?

Many thanks.

Jiri

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to