Thnks for the posts

Both suggested solutions don't work, altough the first one by Gilles does work. But I want the button to be selfcontained, no external initFunctions. Just a MovieClip onStage called btn and on the parent timeline of btn something like
btn.setLabel('hello world')

The onLoad suggestion I dont get working.
btn.onLoad = function(){
        this.setLabel('hello world')
}
this is actual the same as the onEnterFrame. It is not that I have a problem with the onEnterFrame, I just dont understand how Flash VM works. Basically I would like the enclosed script to be executed before the frame of the timeline it is seen on is started. Is this possible.

For more light on what I am trying to achive, the file can be downloaded here:
playground.dadata.org/initButtonWoo.fla

Jiri Heitlager | dadata.org wrote:
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