Archive for December, 2007
Using the MouseWheel to Scroll in AS3
Here is a nice little chunk of code that I wrote to help you enable the MouseWheel in your Flash AS3 files.
// Import MouseEvent
import flash.events.MouseEvent;
// Create MouseWheel Event
public function handleMouseWheel(event:MouseEvent){
trace(event.delta);
}
// Add MouseWheel Listener
addEventListener(MouseEvent.MOUSE_WHEEL,handleMouseWheel);
This will trace the movement from the MouseWheel and that value can be used in your Flash movie however you would like. Enjoy!
How to get a list of child objects that are inside another object
Here is an easy way to get a list of child objects from inside another object.
for(x=0; x < my_mc.numChildren; x++){
trace("Type: "+my_mc.getChildAt(x)+" Name: "+my_mc.getChildAt(x).name);
}
