Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

scottiescotsman

Members
  • Posts

    16
  • Joined

  • Last visited

About scottiescotsman

  • Birthday 05/20/1966

Contact Methods

Profile Information

  • Gender
    Male
  • Location
    Glasgow, SCOTLAND

Recent Profile Visitors

2,421 profile views

scottiescotsman's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. import com.greensock.*; import com.greensock.easing.*; import flash.text.TextField; import flash.display.MovieClip; var spc:Number = 0; var maskWidth:Number = 300; var mc:MovieClip = new MovieClip; addChild(mc); mc.x = 150; mc.y = 10; var tf:TextField = new TextField(); mc.addChild(tf); mc.tf.x = 0; mc.tf.y = 0; mc.tf.text = "0123456789123456789012345678901234567890123456789"; trace(mc.tf.text); scrollWords(); function scrollWords():void { mc.tf.wordWrap = false; mc.tf.autoSize = TextFieldAutoSize.CENTER; if(mc.width >= maskWidth) { goForwardTween(mc); } } function goForwardTween(mc:MovieClip):void { spc = (mc.width/2)-(maskWidth/2); TweenMax.to(mc, 3, {x:spc, delay:1, onComplete:goBackTween, onCompleteParams:[mc] }); } function goBackTween(mc:MovieClip):void { spc = (mc.width/2)-(maskWidth/2); TweenMax.to(mc, 3, {x:-spc, delay:1, onComplete:goForwardTween, onCompleteParams:[mc] }); } Hi sorry ... I not used to posting things :/ here is my fla. I figured out the animation before I posted it but cant get it to work correctly. As the size of the tf & therefore the size of the mc will be dependant on the tf.text, it doesn't report back the correct tf.text.size so cannot in turn correct the animation x values. as shown on the png I posted. Thanks in advance Steven changed code and still not work... but should lol scroller_demo (2).zip
  2. hope this helps you to understand what I am trying to achieve thanks in advance Steven scroller_demo.zip
  3. main_Player.txtScroll.tf.x = 0; main_Player.txtScroll.tf.y = 0; main_Player.txtScroll.x = 166; main_Player.txtScroll.y = 182; main_Player.txtScroll.width = main_Player.txtScroll.tf.width; scrollWords(); function scrollWords():void { main_Player.txtScroll.tf.wordWrap = false; main_Player.txtScroll.tf.autoSize = TextFieldAutoSize.CENTER; if(main_Player.txtScroll.tf.width >= 136) { goForwardTween(tf); } } function goForwardTween(tf:TextField):void { TweenMax.to(tf, 3, {x:248, delay:1, onComplete:goBackTween, onCompleteParams:[tf] }); } function goBackTween(tf:TextField):void { TweenMax.to(tf, 3, {x:-tf.width, delay:1, onComplete:goForwardTween, onCompleteParams:[tf] }); } Hi guys haven't been here in awhile here goes ..... ...basically what I have is a TextField inside a MovieClip, and if the text inside the TextField exceeds a certain size it moves back & forth so that the far right of the MovieClip moves to the far left of the mask and far left of the MovieClip moves to the far right of the mask. But for some reason I cant seem to get it to move it populates the TextField ok .. but wont TweenMax.to functions even if the text is larger than the mask. hope someone can help... Steven
  4. Jamie that doesn't work m8 dial starts @ 12 o'clock [volume = 0] and works great at rotating and changing the volume. With the only problem being it keeps rotating and changing volume even if I rotate < 0 or > 360. the code you had written as it didn't restrict the rotation at all, and if I mouse UP just after 6 o'clock it snapped to 12 o'clock. Sorry to be a nuisance.... plz help Steven
  5. /*********************************************************/ function mouseDownHandler(event:MouseEvent):void { TweenLite.killTweensOf(main_Player.dial); offset = Math.atan2(main_Player.dial.y - this.mouseY, this.mouseX - main_Player.dial.x); r1 = r2 = main_Player.dial.rotation; t1 = t2 = getTimer(); main_Player.dial.addEventListener(Event.ENTER_FRAME, enterFrameHandler); main_Player.dial.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } /*********************************************************/ function mouseUpHandler(event:MouseEvent):void { main_Player.dial.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); main_Player.dial.removeEventListener(Event.ENTER_FRAME, enterFrameHandler); var time: Number = (getTimer() - t2) / 1000; var dif: Number = main_Player.dial.rotation - r2; if (dif != dif % 180) { dif += (dif < 0) ? 360 : -360; } var rVelocity: Number = dif / time; ThrowPropsPlugin.to(main_Player.dial, { throwProps: { rotation: { velocity: rVelocity, resistance: 250, end: getEnd } }, onUpdate: snapEnd, ease: Strong.easeOut }, 10, 0.25, 2); } /*********************************************************/ function getEnd(endValue) { var rotationSnap = 30; return Math.round(endValue / rotationSnap) * rotationSnap; } /*********************************************************/ function snapEnd():void { //volumeTxt.text = String(int(degFromRot(dial.rotation))); } /*********************************************************/ function degFromRot(p_rotInput: Number):Number { var degOutput: Number = p_rotInput; while (degOutput >= 360) { degOutput -= 360; } while (degOutput < 0) { degOutput += 360; } return degOutput; } /*********************************************************/ Tried to figure out how to restrict it to 0-360 ? As I have it working perfectly apart from I can rotate it constantly with no restrictions, as it is a volume controller and needs to stop @ 360 & 0 deg Thanks Steven
  6. I was just wondering can LoaderMax read the header information from a mp3... such as bitrate and other header information. Also how would I display this information ? Tried for weeks to get the albumArt from a mp3 but successfully done it, so the only thing left is the bitrate. I know you can work it out with as3 but it is not accurate enough for me so need it from the mp3 header information. Thanks in advance Steven
  7. yes it works m8 thanks, but not the way I wanted it. is there any way that when I mouse over it, it finishes it's 360 cycle or rotation it is on, rather than snapping to (0) ? Thanks in advance Steven
  8. function mouseOUT(e:MouseEvent):void{ TweenMax.to(menu_MAIN, 2, {rotation:"360", ease:Linear.easeNone, repeat:-1}); } function mouseOVER(e:MouseEvent):void{ TweenMax.killTweensOf(menu_MAIN);; } Hi guys, here is a little problem I have and cant figure out how to solve it say I have a clock hand @ 12 o'clock which rotates constantly until I MOUSE_OVER it, what I am trying to do is when I MOUSE_OVER it I want the clock hand to always stop @ 12 o'clock no mater when I MOUSE_OVER it. Thanks for your help in advance Steven
  9. function yoyo():void{ TweenMax.killTweensOf(yoyo_MC); yoyo_MC.x = 0; yoyo_MC.sndTicker.text = ""+snd.id3.artist; yoyo_MC.sndTicker.autoSize = TextFieldAutoSize.LEFT; var xWidth = int(yoyo_MC.width)-193; TweenMax.to(yoyo_MC, 3, {x:-xWidth, y:155, ease:Sine.easeInOut, repeat:-1, yoyo:true}); } Hi guys I have a mp3 tag text scroller left to right with tweenmax.to .... ..but I cant seem to get it to start at with the left side of text finishing at left point of window x=0, and the right side finishing in the end of the right window x=193. so the text is yo-yoing inside the window. I tried loads of ways but to no avail ... heres what I have that does work but not as I would like Thanks in advance Steven
  10. Yup just what I needed and works a treat for what I needed it for can I restrict it to only go from 0-360 deg ? Thanks Steven
  11. ok now I a super member $99 lol I have downloaded the new plugins and installed them in my flash folder. now just need figure out how to get it to act exactly like the one on webpage Thanks Steven
  12. var dial:Sprite; var radius:Number = 0; var angle:Number = 0; var angleConvert:Number = 180 / Math.PI; init(); function init():void { makeDial(); makeOrb(); } function onMove(e:MouseEvent):void { angle = Math.atan2(mouseY - dial.y, mouseX - dial.x); volumeMC.rotation = angleConvert * angle + 90; } function onOrbDown(e:MouseEvent):void { stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove); stage.addEventListener(MouseEvent.MOUSE_UP, onOrbUp); } function onOrbUp(e:MouseEvent):void { stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMove); stage.removeEventListener(MouseEvent.MOUSE_UP, onOrbUp); } function makeDial():void { dial = new Sprite(); var g:Graphics = dial.graphics; g.lineStyle(2, 0x333333); g.drawCircle(0, 0, radius); dial.x = 170; dial.y = 370; addChild(dial); } function makeOrb():void { volumeMC.buttonMode = volumeMC.useHandCursor = true; volumeMC.addEventListener(MouseEvent.MOUSE_DOWN, onOrbDown); } Hi I have a volumeMC dial that drags and drops great, but I want to use the rotation snap in tweenMax to make this better. All I want it to do is .... 1] drag rotate volumeMC around its own centre from 0-360deg in 10deg intervals. 2] to trace the current rotation value to I can adjust the sound. here is what I have that works but I don't like it ... hope someone can help Steven
  13. Sorry about the posting in wrong section Steven
  14. Hi there I am sort of new to as3 & tweenMax and am wanting some help please. I have a volumeMC that I want to rotate [ drag ] and snap every 10 degrees, stop @ 360deg @ 0deg & return the value it snapped at. please could you help Steven
×