![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
Hi,
I spend some time searching the web for a solution to initialize Flash components (buttons, input text, list, tree, and so on) properties on the beginSprite Director?s event and I couldn?t find any practical solution then I?d like to share with you an easy trick I?ve found. With this little script you can have just one Flash member on your cast and put on the stage any number of instances of it and set its properties independently or you can call any handler that fills data on components like List, Tree or Data Grid on the beginSprite event. Works fine and it?s much more efficient than the enterFrame or exitFrame solutions out there, on this stepFrame is played once instead every application loop like enterFrame and exitFrame, so no processor penalties. I hope this can help to anyone who needs it. -- Behavior Script attached to a button component instance on the stage property pSprite -- any flash or flash component (a button in this case) property pName property pStep on beginSprite(me) pSprite = sprite(me.spriteNum) _movie.actorList.append(me) end on stepFrame me if pStep then _movie.actorList.deleteOne(me) pSprite.label = pName -- here the code or handler, flash asset full loaded (button sprite label in this case) else pStep = 1 end if end on getPropertyDescriptionList(me) vPDL = [:] vPDL.addProp(#pName, [#default:"BUTTON", #format:#string, #comment:"NAME:"]) return vPDL end -- End Behavior Script |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise