Each time you click a button in the following example, you attach a movie clip instance to the Stage in a random position. When you click a movie clip instance, you remove that instance from the SWF file.
function randRange(min:Number, max:Number):Number { var randNum:Number = Math.round(Math.random()*(max-min))+min; return randNum; } var bugNum:Number = 0; addBug_btn.onRelease = addBug; function addBug() { var thisBug:MovieClip = this._parent.attachMovie("bug_id", "bug"+bugNum+"_mc", bugNum, {_x:randRange(50, 500), _y:randRange(50, 350)}); thisBug.onRelease = function() { this.removeMovieClip(); }; bugNum++; } dumt spørgsmål jeg stillede mig selv der
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.