Français
  • Flash AS3 Tutorial : Mouse Wheel Interactivity for Zooming Games CS5 CS4 CS3


    Added on Monday 19 July 2010 12:26:43
    by flashbuilding
    16351 Views
    5.0 / 5
    12345
    54 rates
    Send this video to your friends
    Get embed code of video

    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.



    facebook
  • Write your comment here...
  • providence99ph

    thank you very much you just save my work.ahaha!!!
    Wednesday 12 October 2011 21:05:31
  • automaticchic

    Does it work with laptop? i don't have a mouse...it desn't seem to work..or i'm doin' it wrong :/
    Monday 01 August 2011 11:54:25
  • potter503

    please dont talk like that (1:51 BLUE BAR! )
    Friday 08 July 2011 20:28:03
  • potter503

    please dont talk like that (1:51 )
    Friday 08 July 2011 20:27:42
  • potter503

    please dont talk like that (1:5`)
    Friday 08 July 2011 20:27:25
  • potter503

    please dont talk like that (1:52)
    Friday 08 July 2011 20:26:58
  • Lebensbaustein

    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
    Wednesday 22 June 2011 13:30:50
  • Lebensbaustein

    Thanks! I don't get why you pronounce "ball" like that, but thanks for the vid anyway... ;)
    Wednesday 22 June 2011 12:04:01
  • sharksystem1

    this is what i need! thanks man! is there a way to make the zoom smoother?
    Tuesday 21 June 2011 21:22:17
  • paddotk

    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.
    Friday 25 March 2011 09:00:55
  • Danbo342

    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 ;)
    Thursday 03 March 2011 22:32:44
  • Danbo342

    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.
    Thursday 03 March 2011 22:27:41
  • raichz

    Is there anywhere that "Facebook game style board" tutorial ? I Cant find it anywhere and it is exactly what I needed.
    Wednesday 16 February 2011 16:03:12
  • MythOfEchelon

    Is there any way to make them grow by less than 3?
    Saturday 25 December 2010 10:40:45
  • Bracerjack

    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 ?
    Thursday 21 October 2010 14:44:48
  • kikeub

    @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.
    Sunday 10 October 2010 11:57:52
  • kikeub

    @kikeub mouseListener = new Object(); mouseListener.onMouseWheel = function (delta) { if (delta > 0) {scale += steps; _root.YOUROBJECT._height += _root.YOUROBJECT._height * 0.2 ; _root.YOUROBJECT._width += _root.YOUROBJECT._width * 0.2;} else if (delta < 0) {ecale -= steps; _root.YOUROBJECT._height -= _root.YOUROBJECT._height * 0.2 ; _root.YOUROBJECT._width -= _root.YOUROBJECT._width * 0.2; }} Mouse.addListener(mouseListener);
    Sunday 10 October 2010 11:52:14
  • kikeub

    @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
    Sunday 10 October 2010 11:51:40
  • AwesomeGirl86

    @kikeub Can you please clarify just a little bit. Do I add it to the code or do I select the red ball and add the code in there? Just wondering.
    Friday 08 October 2010 15:04:00
  • kikeub

    @AwesomeGirl86 Intead of use RedBall >>Use>> this.Redball
    Tuesday 05 October 2010 11:05:59
  • 5plan13

    NIce tutorial!!! also run in actionscript 2.0?
    Tuesday 07 September 2010 09:10:08
  • suggie1337

    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;
    Tuesday 07 September 2010 05:55:11
  • AwesomeGirl86

    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.
    Tuesday 31 August 2010 22:54:24
  • ynski85

    thank you but you're not my type . . . cheers Adam!
    Tuesday 31 August 2010 03:26:57
  • Naresh7080

    Nice tutorials.
    Friday 23 July 2010 08:30:23
ADVERTISEMENT
Supplements
Social Network
Tag cloud