Noob Flash Rss

Using the MouseWheel to Scroll in AS3

7

Posted by Aaron | Posted in ActionScript | Posted on 07-12-2007

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

0

Posted by Aaron | Posted in ActionScript | Posted on 04-12-2007

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);
}