Just nu i M3-nätverket
Jump to content

AS 3


moltass

Recommended Posts

Jag vill i samband med att jag hämtar ett MC från biblioteket ska föregående MC försvinna utan att jag lägger till en remove knapp. Hur löser jag detta?

 

myKnapp1.addEventListener(MouseEvent.CLICK,getStripe1);

myKnapp2.addEventListener(MouseEvent.CLICK,getStripe2);

myKnapp3.addEventListener(MouseEvent.CLICK,getStripe3);

 

 

function removeStripe1()

{

var v_remove:MovieClip;

v_remove=MovieClip(myScene1.getChildByName("stripe1"));

myScene1.removeChild(v_remove);

}

 

 

 

function getStripe1(e:MouseEvent)

{

var v_stripe1:MovieClip = new stripe1();

v_stripe1.name="stripe1"

myScene1.addChild(v_stripe1);

 

 

}

 

function removeStripe2()

{

var v_remove:MovieClip;

v_remove=MovieClip(myScene1.getChildByName("stripe2"));

myScene1.removeChild(v_remove);

}

 

 

 

 

function getStripe2(e:MouseEvent)

{

var v_stripe2:MovieClip = new stripe2();

v_stripe2.name="stripe2"

myScene1.addChild(v_stripe2);

}

 

function removeStripe3()

{

var v_remove:MovieClip;

v_remove=MovieClip(myScene1.getChildByName("stripe3"));

myScene1.removeChild(v_remove);

}

 

 

function getStripe3(e:MouseEvent)

{

var v_stripe3:MovieClip = new stripe3();

v_stripe3.name="stripe3"

myScene1.addChild(v_stripe3);

}

 

 

 

 

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...