Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Results 1 to 3 of 3

Thread: onRelease...removed !

  1. #1
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,609
    Rep Power
    9

    onRelease...removed !

    flash templates
    That's right! onPress,onRelease,onRollOver and onRollOut have been removed.
    Now, by now it should be clear, it's the DispatchEvent class to manage everything.
    As usual:
    you add a listener to the clip the mouse should interact with
    you manage the code so that it executes the events within the methods called by the listener

    The class I've developed creates a Sprite at runtime and associates the mouse events








    Here is the class I've written:
    Code:
    package
    {
    	import flash.display.MovieClip;
    	import flash.display.Sprite;
    	import flash.events.*;
    	
    	public class NoMoreOnPress extends MovieClip
    	{
    		private var size:Number=100;
    		
    		public function NoMoreOnPress()
    		{
    			this.createClip();
    		}
    		
    		public function createClip():void
    		{
    			var coke:Sprite=new Sprite();
    			coke.graphics.beginFill(0xFF6600);
                coke.graphics.drawRect(0,0,this.size,this.size);
                coke.graphics.endFill();
    			coke.x=stage.stageWidth/2-coke.width/2;
    			coke.y=stage.stageHeight/2-coke.height/2;
                this.addChild(coke);
    			this.addCokeListeners(coke);
    		}
    		
    		public function addCokeListeners(coke:Sprite):void
    		{
    			coke.addEventListener(MouseEvent.MOUSE_OVER,mouseIsOver);
    			coke.addEventListener(MouseEvent.MOUSE_OUT,mouseIsOut);
    			coke.addEventListener(MouseEvent.MOUSE_DOWN,mouseIsDown);
    			coke.addEventListener(MouseEvent.MOUSE_UP,mouseIsUp);
    		}
    		public function mouseIsOver(event:Event):void
    		{
    			trace('il mouse mi è sopra');
    		}
    		public function mouseIsOut(event:Event):void
    		{
    			trace('il mouse non mi tocca');
    		}
    		public function mouseIsDown(event:Event):void
    		{
    			trace('il mouse mi ha cliccato sopra');
    		}
    		public function mouseIsUp(event:Event):void
    		{
    			trace('il mouse è stato rilasciato sopra di me');
    		}
    	}
    }
    cya!

  2. #2
    Junior Member Settled In cyberluk is on a distinguished road
    Join Date
    Nov 2007
    Posts
    10
    Rep Power
    0

    Re: onRelease...removed !

    Yes, and what if I have some moving object on the stage and want to detect MouseDown, MouseUp and other events also when the cursor IS NOT pointing the object (because it's moving and mouse is not).

  3. #3

+ Reply to Thread

Similar Threads

  1. swapDepths removed !
    By Flep in forum Tutorials
    Replies: 2
    Last Post: 07-08-08, 19:24
  2. loadMovie...removed !
    By Flep in forum Tutorials
    Replies: 3
    Last Post: 07-07-08, 21:40
  3. attachMovie...removed !
    By Flep in forum Tutorials
    Replies: 5
    Last Post: 19-06-08, 19:39
  4. DuplicateMovieclip...removed!
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 27-09-07, 12:04
  5. onRelease rimosso
    By Flep in forum Articoli e tutorials
    Replies: 0
    Last Post: 19-09-07, 12:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts