Integration Project
Run-time instances
-
Create one more series of the buttons
- Use the same graphic symbols for the furniture and transform each to the button. Give them recognizable names like btChairSeed or btBedSeed
- Add the following code to each of the buttons. Adjust value name for each button – "armchair", "tv center" or so on
on(release) { _root.textfurn.text = "desk"; }Again as for the previous buttons set clicking will update the dynamic text field "textfurn".If compare those buttons to previous set – new ones don't have linkage name and not encapsulated into the movie symbol.
-
Create one more button on the stage. Add the code
on(release) { a++; thedepth++; attachMovie(_root.textfurn.text,"fr"+a, thedepth); setProperty("fr" +a, _y,450); setProperty("fr" +a, _x,80); }This code create the new instance of the movie clip. It knows exactly what symbol is bred – desk, chair or bed – because it reads the value of the dynamic text fields, which is updated every time the chair or desk is clicked.Pay attention to the incremented depth and unique name of the instances created.
At the end the new instance is positioned appropriately on the stage.
- Test this module of the program. Again you may do it in the separate file and wait for the main file to be ready to accommodate ready symbols.