Jump to content
Search Community

Applauz

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Applauz

  1. Carl saves the day! Thank you sir!
  2. Here's my file if it makes it easier to see whats happening. scrollNumbers.fla.zip
  3. no go. The end values are still not the right number
  4. This is driving me absolutely nuts! Hoping Carl comes in and saves the day like always
  5. The problem is in this line var newNumber:Number = (randomNumber(0, 5) * 300) + 7200; I had to change to 300 because the height of each of my numbers is 300. The math doesn't seem to work with this number1 = 10-((strip1.y % 1000)/100); number1 = number1 == 10 ? 0 : number1;
  6. Thanks so much for pointing me in the right direction. My spinning is perfect.. even got the blur working nicely. My final number is not calculating properly though I think it has to do with the fact that in the original version each number height is 100 and there is 10 slots ( 0 - 9 ) I've increased my number height to 300 and dropped down to 6 slots ( 0 - 5 ) Do you spot anything I'm missing in my calculations ? import com.greensock.*; import com.greensock.easing.*; import flash.events.MouseEvent; import flash.display.MovieClip; var blitMask1:BlitMask = new BlitMask(strip1,strip1.x,strip1.y,strip1.width,300,true,true,0xffffff,true); var blitMask2:BlitMask = new BlitMask(strip2,strip2.x,strip2.y,strip2.width,300,true,true,0xffffff,true); var blitMask3:BlitMask = new BlitMask(strip3,strip3.x,strip3.y,strip3.width,300,true,true,0xffffff,true); var number1:int; var number2:int; var number3:int; spin_btn.addEventListener(MouseEvent.CLICK, spin); function spin(event:MouseEvent):void { var i:int = 1; while (i <= 3) { var newNumber:Number = (randomNumber(0, 5) * 300) + 7200; //TweenMax.to(this["strip" +i], 1.5 + (i*.1), { y:strip1.y + newNumber, onComplete:checkResults}); //tween to the relative value of newNumber TweenMax.to(this["strip" +i], 3 + (i*.1), {y:strip1.y + newNumber, onComplete:checkResults}); //blur to 40 and then back to 0. TweenMax.to(this["strip" +i], 1.5, {blurFilter:{blurY:40}, repeat:1, yoyo:true}); i++; } } function randomNumber(min:Number, max:Number):Number { //good return Math.floor(Math.random() * (1 + max - min) + min); } function checkResults():void{ number1 = 6-((strip1.y % 1000)/100); number1 = number1 == 10 ? 0 : number1; number2 = 6-((strip2.y % 1000)/100); number2 = number2 == 10 ? 0 : number2; number3 = 6-((strip3.y % 1000)/100); number3 = number3 == 10 ? 0 : number3; trace("Number 1 is - " + number1 ); trace("Number 2 is - " + number2 ); trace("Number 3 is - " + number3 ); } In the original version I don't know why the number 1200 is there.. I increased this to 7200 as it makes the numbers spin longer. I can't wrap my head around what I'm missing here. Any help is appreciated.
  7. I'm using blitmask to make a scrolling slot machine style interface. Here is what I have so far .. which is working. var blitMask1:BlitMask = new BlitMask(strip1,strip1.x,strip1.y,strip1.width,100,true,true,0xffffff,true); var blitMask2:BlitMask = new BlitMask(strip2,strip2.x,strip2.y,strip2.width,100,true,true,0xffffff,true); var blitMask3:BlitMask = new BlitMask(strip3,strip3.x,strip3.y,strip3.width,100,true,true,0xffffff,true); spin_btn.addEventListener(MouseEvent.CLICK, spin); function spin(event:MouseEvent):void { var i:int = 1; while (i <= 3) { var newNumber:Number = (randomNumber(0, 5) * 100) + 1400; TweenMax.to(this["strip" +i], 3 + (i*.5), {y:strip1.y + newNumber, onComplete:checkResults}); i++; } } function randomNumber(min:Number, max:Number):Number { //good return Math.floor(Math.random() * (1 + max - min) + min); } function checkResults():void{ trace("FINISHED"); } The issue I am having is that even when 2 items are the same.. the Y coord is not the same.. so it's difficult for me to know which item was landed on. Hoping someone can help me be able to trace out which slot was actually landed on. Any help is appreciated. Cheers!
  8. No filters on the movie clip. Its a large movie clip.. about 4,000 pixels in width. I dont understand why its only ease Expo that glitches though.
  9. I don't have any other code... Just this.. This works fine TweenMax.to(memberSelector_mc, 1, {x:-1036,ease:Circ.easeOut}); This skips / snaps at the end of the tween when it slows down TweenMax.to(memberSelector_mc, 1, {x:-1036,ease:Expo.easeOut});
  10. I have some simple tweens using TweenMax. They work fine however just as they ease to end the tween they all of a sudden jump / snap into position. Any idea why this happens ? *Note* - This is happening with ease:Expo.easeOut
  11. Im dragging like this. albumTracklist_mc.startDrag(false, new Rectangle(100, -99999, 0, 99999999));
  12. So I found the problem. The issue was I am setting line spacing on the multiline text box. Shouldn't be an issue I know ... but it is. Also ... If I remove all ThrowProps and just use a simple starDrag function I don't get the issue. The issue only happens when using throwProps + line spacing.
  13. How come when I blitmask the text box (bitmapMode true) the text isn't the same quality on retina. It downgrades the quality of the text. This issue ONLY happens when I drag the text box out of view and back in view.. but it only happens when throw props is applied to the dragging.
  14. This is definitely and issue with the text box. If I throw this text box in a movie clip and apply blitmask to that movie clip the problem goes away. This isn't an option however because when I blitmask the movie clip of text the quality of the text is visibly downgraded on the retina iPad. So now the challenge is to figure out why throw props has issue with my text box.
  15. So the problem happens when the movieclip containing the text exits the stage and then you drag it back in to view. When it comes back in to view a portion of the movie clip is gone. This isn't an issue with text because as a test I put a button on the same line that the text that goes missing is on... and that button vanishes too. Its almost like its masking it or something. Here is my code.... don't mind the mess. I haven't cleaned up my code yet Let me know if anything looks out of place. tracklistScrollHeight = 239 - (albumTracklist_mc.height - tracklistMask.height); TweenPlugin.activate([ThrowPropsPlugin]); var t1:uint, t2:uint, y1:Number, y2:Number; albumTracklist_mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); function mouseDownHandler(event:MouseEvent):void { // FIX for Button events // startTouch = mouseY; dragging = true; //i am now dragging offset = albumTracklist_mc.mouseY; //setting the offset from the origin mouseDX = mouseY; // // curY = 0; prevY = 0; // TweenLite.killTweensOf(albumTracklist_mc); y1 = y2 = albumTracklist_mc.y; t1 = t2 = getTimer(); //albumTracklist_mc.startDrag(false, new Rectangle(0, -99999, 0, 99999999)); albumTracklist_mc.addEventListener(Event.ENTER_FRAME, enterFrameHandler); albumTracklist_mc.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } function enterFrameHandler(event:Event):void { endTouch = mouseY; if (startTouch - endTouch < 10 && startTouch - endTouch >-10) { // BUTTON PRESS } else{ dragMe = dragMe +1; if (dragMe < 3){ albumTracklist_mc.startDrag(false, new Rectangle(100, -99999, 0, 99999999)); } y2 = y1; t2 = t1; y1 = albumTracklist_mc.y; t1 = getTimer(); } } function mouseUpHandler(event:MouseEvent):void { // FIX for button events in Throwprops // dragMe = 1; mouseUX = mouseDX; mouseDX = mouseY; vy = mouseDX - mouseUX; //trace("The RANGE was - " + Math.abs(mouseDX - mouseUX)); // albumTracklist_mc.stopDrag(); albumTracklist_mc.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); albumTracklist_mc.removeEventListener(Event.ENTER_FRAME, enterFrameHandler); var time:Number = (getTimer() - t2) / 1000; var yVelocity:Number = (albumTracklist_mc.y - y2) / time; var yOverlap:Number = Math.max(0, albumTracklist_mc.height - albumTracklist_mc.height); //if (Math.abs(mouseDX - mouseUX) > tolerance){ trace("Mouse up was not within range of mouse down (10px), so is not a button press"); ThrowPropsPlugin.to(albumTracklist_mc, {throwProps:{ y:{velocity:yVelocity, max:239, min:tracklistScrollHeight, resistance:100} }, ease:Strong.easeOut }, 10, 0.3, 0.2); // } //else if (Math.abs(mouseDX - mouseUX) < tolerance){ // trace("Mouse up was within range of mouse down (10px), so is a button press :)"); //and will it work? No! // trace("the detected button press was on: " + event.target.name); // } }
  16. I have a movie clip that contains a multiline text field. It has about 20 lines of text. Each line numbered. 1. kjlkjasldkjlaskjlaskjd 2. klasjlaksjdlaksdj 3. kajshdkajhsdkjahsdkh etc. For some reason .. the entire first line of text glitches and disappears and then randomly comes back when you scroll it off screen. So when you scroll it off screen and then bring it back in to view.. the text starts at 2. kjahskdjhasdkjha if you keep scrolling up and down for a bit line 1. just randomly comes back. I have no idea whats causing this. Any ideas ?
  17. Well .. the duration of the delayed call is a dynamic variable that changes. I was hoping to just have a listener that could listen for the value in the delayed call timer.
  18. Hello, I'm using a delayed call that runs for 12 seconds. Is there a way to listen when it hits 3 seconds left or 9 seconds have passed ?
  19. ah! .. think I got it now. Thanks!
  20. I still don't grasp this. If on MOUSE_DOWN I capture startTouch = mouseX; and onMOUSE_UP I capture endTouch = mouseX; Its easy to then in the MOUSE_UP handler put if (startTouch - endTouch < 10 && startTouch - endTouch >-10) { // You only pressed } else { // You swiped } How can I determine the startTouch and the endTouch all in the MOUSE_DOWN ?
  21. Actually . wait. That method works great for buttons and I'm already doing something like that for my buttons. My problem is with detecting it within my throwprops... because on mouseDown i start the drag. This is what causes the little shift when you tap the screen. How can i ignore the detection of mouseDown within a range when the mouseDown is the first part of the equation in calculating the difference between mouseX on mouseDown / mouseUp ?
  22. Do you have any examples of this ?
  23. I'm using ThroProps to animate a large timeline image. It works great! I have one minor issue. When I do a simple touch of the screen. "not intending to swipe" .. there is a very subtle jitter. ThrowPropsPlugin.to(coreTechMainLayout_mc, {throwProps:{ y:{velocity:yVelocity, max:0, min:0, resistance:100}, x:{velocity:xVelocity, max:-0, min:-980, resistance:100} }, ease:Strong.easeOut, onComplete:enableBitMapMode }, 10, 0.3, 0.2); Is there anything in these settings that affects this ?
  24. I currently developer in AIR using Flash Pro CS6 I haven't touched Starling yet... but I hear performance is much better using it. Do you know if I can still use Greensock to Tween while using Starling?
×
×
  • Create New...