Package Practice

Vodpod videos no longer available.

package {

import flash.display.MovieClip;
import com.PersonWidget;
import flash.events.MouseEvent;

public class MarysScene extends MovieClip {

public var bob:PersonWidget=new PersonWidget;
public var suit:clothes=new clothes;

public function MarysScene() {
addChild(bob);
bob.x=230;
bob.y=100;
bob.addChild(suit);

addClothes_mc.addEventListener(MouseEvent.CLICK,_handleclothesMouseClick);
noClothes_mc.addEventListener(MouseEvent.CLICK,_handlenoneMouseClick);
}

private function _handleclothesMouseClick(event:MouseEvent):void {
bob.addChild(suit);
}

private function _handlenoneMouseClick(event:MouseEvent):void {
if (suit!=null) {
bob.removeChild(suit);
}
}
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s