Added on Monday 19 July 2010 12:26:43
by flashbuilding
16351 Views
5.0 / 5
54 rates
Learn how to program the MOUSE_WHEEL event in Flash Actionscript 3.0 to add a whole new level of interactivity to your projects. We access the delta property to see if the user is scrolling up or down.
Is there a way I can make the wheeled object be in front of the other ones? I have the problem that my object is behind the other ones around it when I wheel in on it and make it bigger... just asking... oO
I got this:
"1120: Access of undefined property event" referring to the "event.delta".
I also tried MouseEvent.delta but to no avail.
I have imported the right events and stuff (everything from display, events and ui) so that can't be the problem.
Wow, I should have proof read /doh.
I meant I have a button that I want people to be able to scroll (with the mouse wheel since it's a nob (potentiometer) and have it make my child movie clip play 1 frame per mouse wheel event. I'll check in the help section again but so far so, lost ;)
Great vid, thanks for sharing. I need to do something like this but not zooming. I need have a circle and outside of it there's a movie clip that I want to rotate one frame of it's movie clip per mouse wheel. The movie clip is called arrow, so I imaging it would be something like gotoAndStop("NextFrame"); for + and PrevFrame for - but not sure how to write that. I'm not new to Flash, but am very new to AS3. Any help would be greatly appreciated but either way, thanks again. I Learned a lot.
But the addEventListener is added to the stage.
a.k.a stage.addEventListener in this case.
How is it that event.target is the circles ? I know it works...but why ?
@AwesomeGirl86
I'm making an interactive Flow from Microsoft Visio to flash, adding Onmouse over info, on click event showing windows with info, draging that windows effects etc...
If you need somenthig I can help.
@AwesomeGirl86
Sorry some how it didn't worked for me like video shows , I got it working replacing redball with "this.redball" but I used this next code, since it worked for me for any object
You can also increase with a negative number, so the object would shrink. This way you dont need to type an if...else... statment. Example :
this.width += zoomAmount * deltaVar;
I did like you said in the video but for some reason it's not working for me.
I do have Flash CS3 & the ActionScript 3.0 but I don't know what went wrong. :(
So, I don't know if I'm missing something or that I need to try something else.