Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

.if i add a movieclip like below code means then how can i remove the movieclip from stage .....

Community Beginner ,
Jan 18, 2016 Jan 18, 2016

.if i add a movieclip like below code means then how can i remove the movieclip from stage .....

function dupCircle(){

     var circ = new myCircle();

     circ.x = Math.random () *400;    

      circ.y = Math.random () *250;

     addChild(circ);

}

TOPICS
ActionScript
431
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2016 Jan 18, 2016

among the ways to remove from same timeline that contains that code:

  var circ:myCircle;

function dupCircle(){

    circ= new myCircle();

     circ.x = Math.random () *400;    

      circ.y = Math.random () *250;

     addChild(circ);

}


function removeCircF():void{

removeChild(circ);

}

however, if it's possible to call dupCircle twice (or more) without calling removeCircF, that won't work and you'll need to do something else. eg,

var circA:Array=[];

function dupCircle(){

     var circ = new myCircle();

     circ.x = Math.random () *400;    

      circ.y = Math.random () *250;

     addChild(circ);

circA.push(circ);

}


function removeAllCircF():void{

for(var i:int=circA.length-1;i>=0;i==){

removeChild(circA);

circA.splice(i,1);

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 19, 2016 Jan 19, 2016

thnks bro............

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2016 Jan 19, 2016

you're welcome.

(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 10, 2016 Feb 10, 2016
LATEST

K

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines