Jump to content
Search Community

wearn

Members
  • Posts

    6
  • Joined

  • Last visited

wearn's Achievements

0

Reputation

  1. Hello Jack, thank you for your answer. I am having a problem with the trowprobs plugin and the solution to click / scroll in a list. I have implemented the solution in this topic: http://forums.greensock.com/topic/6675-click-event-and-scroll-event-conflict/ But i can not fix the problem to realy hit the button. Hopefully you can help me out. I would like a trace "hit button 1" when i click on the first item in the list..and so on.. This is the .fla file. http://www.thuis-bios.nl/ipadapp/menu_app.zip Hopefully it is something small and anyone can help me out:) Regards, Werner
  2. Hello Jack, i am having a lot of problems with the code for my app. This whole day i worked for a solution to get this code working, but my skills are to bad. Can you please help me out? I have to get it work at 10 januari for my graduation:).
  3. i have to integrade this option for my graduation in to weeks, so is there anyone who can help me out? merry x-mass!
  4. Hello, i want to integrade this option to my code below. I am not having the knowledge of doing it on my own. Can anyone please help me out? I have the button testtest working, but it also works when i drag on this movieclip. Hopefully anyone can help me out. import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import flash.geom.Rectangle; import flash.utils.getTimer; import flash.events.MouseEvent; import flash.text.*; import flash.display.*; import flash.events.MouseEvent; import flash.net.URLRequest; import fl.transitions.Tween; import fl.transitions.easing.*; import fl.transitions.TweenEvent; //var myTween:Tween = new Tween(blitMask, "alpha", Strong.easeOut, 0, 1, 3, true); // onRelease myMovieClip.testtest.addEventListener(MouseEvent.CLICK,onReleaseMyButton); function onReleaseMyButton(event:MouseEvent):void { trace("CHECK CLICK"); //testtest.x += 20; } TweenPlugin.activate([ThrowPropsPlugin]); var bounds:Rectangle = new Rectangle(0, 0, 1024, 768); graphics.beginFill(0x888888, 0); graphics.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); graphics.endFill(); //here is where I reference the MovieClip. var mc:Sprite = myMovieClip; myMovieClip.cacheAsBitmap = true; myMovieClip.cacheAsBitmapMatrix = new Matrix(); //myMovieClip.werner.text = "bureaustoelen"; //myMovieClip.werner2.text = "web 2 print"; var blitMask:BlitMask = new BlitMask(mc, bounds.x, bounds.y, bounds.width, bounds.height, true); //blitMask.bitmapMode = false; var t1:uint, t2:uint, y1:Number, y2:Number, x1:Number, x2:Number, xOverlap:Number, xOffset:Number, yOverlap:Number, yOffset:Number; blitMask.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); blitMask.bitmapMode = false; function mouseDownHandler(event:MouseEvent):void { TweenLite.killTweensOf(mc); //x1 = x2 = mc.x; //xOffset = this.mouseX - mc.x; //xOverlap = Math.max(0, mc.width - bounds.width); y1 = y2 = mc.y; yOffset = this.mouseY - mc.y; yOverlap = Math.max(0, mc.height - bounds.height); t1 = t2 = getTimer(); mc.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); mc.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } function mouseMoveHandler(event:MouseEvent):void { var y:Number = this.mouseY - yOffset; //if mc's position exceeds the bounds, make it drag only half as far with each mouse movement (like iPhone/iPad behavior) if (y > bounds.top) { mc.y = (y + bounds.top) * 0.5; } else if (y < bounds.top - yOverlap) { mc.y = (y + bounds.top - yOverlap) * 0.5; } else { mc.y = y; } var x:Number = this.mouseX - xOffset; if (x > bounds.left) { mc.x = (x + bounds.left) * 0.5; } else if (x < bounds.left - xOverlap) { mc.x = (x + bounds.left - xOverlap) * 0.5; } else { mc.x = x; } blitMask.update(); var t:uint = getTimer(); //if the frame rate is too high, we won't be able to track the velocity as well, so only update the values 20 times per second if (t - t2 > 50) { x2 = x1; x1 = mc.x; y2 = y1; t2 = t1; y1 = mc.y; t1 = t; } event.updateAfterEvent(); } function mouseUpHandler(event:MouseEvent):void { mc.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); mc.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); var time:Number = (getTimer() - t2) / 1000; var xVelocity:Number = (mc.x - x2) / time; var yVelocity:Number = (mc.y - y2) / time; ThrowPropsPlugin.to(mc, {throwProps:{ y:{velocity:yVelocity, max:bounds.top, min:bounds.top - yOverlap, resistance:300}, x:{velocity:xVelocity, max:bounds.left, min:bounds.left - xOverlap, resistance:300} }, onUpdate:blitMask.update, ease:Strong.easeOut }, 10, 0.3, 1); }
  5. Thank you for the reply. My skills are not good enough to implement the code. Where do i have to put the blitMask.bitmapMode = false; code?...i can not find the oncomplete call Regards
  6. Hello, Iam developing a Ipad app and i would like to use the throwprops plugin for my menu. The plugin works fine when i trow the movieclip (Y) but i can not click on the movieclips inside this movieclip. I tried the search engine, and the solution thats given wont work for me. Can anybody help me out? Its for my graduation Regards. import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import flash.geom.Rectangle; import flash.utils.getTimer; import flash.events.MouseEvent; import flash.text.*; import flash.display.*; import flash.events.MouseEvent; import flash.net.URLRequest; // onRelease testtest.addEventListener(MouseEvent.CLICK,onReleaseMyButton); function onReleaseMyButton(event:MouseEvent):void { trace("CHECK CLICK"); } TweenPlugin.activate([ThrowPropsPlugin]); var bounds:Rectangle = new Rectangle(0, 0, 768, 768); graphics.beginFill(0x888888, 0); graphics.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); graphics.endFill(); //here is where I reference the MovieClip. var mc:Sprite = myMovieClip; myMovieClip.cacheAsBitmap = true; myMovieClip.cacheAsBitmapMatrix = new Matrix(); myMovieClip.werner.text = "bureaustoelen"; myMovieClip.werner2.text = "web 2 print"; var blitMask:BlitMask = new BlitMask(mc, bounds.x, bounds.y, bounds.width, bounds.height, true); var t1:uint, t2:uint, y1:Number, y2:Number, x1:Number, x2:Number, xOverlap:Number, xOffset:Number, yOverlap:Number, yOffset:Number; blitMask.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); function mouseDownHandler(event:MouseEvent):void { TweenLite.killTweensOf(mc); //x1 = x2 = mc.x; //xOffset = this.mouseX - mc.x; //xOverlap = Math.max(0, mc.width - bounds.width); y1 = y2 = mc.y; yOffset = this.mouseY - mc.y; yOverlap = Math.max(0, mc.height - bounds.height); t1 = t2 = getTimer(); mc.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); mc.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } function mouseMoveHandler(event:MouseEvent):void { var y:Number = this.mouseY - yOffset; //if mc's position exceeds the bounds, make it drag only half as far with each mouse movement (like iPhone/iPad behavior) if (y > bounds.top) { mc.y = (y + bounds.top) * 0.5; } else if (y < bounds.top - yOverlap) { mc.y = (y + bounds.top - yOverlap) * 0.5; } else { mc.y = y; } var x:Number = this.mouseX - xOffset; if (x > bounds.left) { mc.x = (x + bounds.left) * 0.5; } else if (x < bounds.left - xOverlap) { mc.x = (x + bounds.left - xOverlap) * 0.5; } else { mc.x = x; } blitMask.update(); var t:uint = getTimer(); //if the frame rate is too high, we won't be able to track the velocity as well, so only update the values 20 times per second if (t - t2 > 50) { x2 = x1; x1 = mc.x; y2 = y1; t2 = t1; y1 = mc.y; t1 = t; } event.updateAfterEvent(); } function mouseUpHandler(event:MouseEvent):void { mc.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); mc.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); var time:Number = (getTimer() - t2) / 1000; var xVelocity:Number = (mc.x - x2) / time; var yVelocity:Number = (mc.y - y2) / time; ThrowPropsPlugin.to(mc, {throwProps:{ y:{velocity:yVelocity, max:bounds.top, min:bounds.top - yOverlap, resistance:300}, x:{velocity:xVelocity, max:bounds.left, min:bounds.left - xOverlap, resistance:300} }, onUpdate:blitMask.update, ease:Strong.easeOut }, 10, 0.3, 1); }
×
×
  • Create New...