Jump to content
GreenSock

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

vdubplate

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by vdubplate

  1. I actually got it to work eventually although I didn't get the result I was looking for.
  2. Can anyone see why my onComplete function in function test2 will not work? I'm testing and I can not get it to fire. [as] import flash.events.MouseEvent; import com.greensock.*; import com.greensock.easing.*; import flash.events.Event; var Clicking:uint=0; var tab_x = CLIPcontainer_mc.x; CLIPcontainer_mc.mc1_mc.buttonMode = 1; CLIPcontainer_mc.mc2_mc.buttonMode = 1; CLIPcontainer_mc.mc3_mc.buttonMode = 1; CLIPcontainer_mc.alpha = 0; var AutoPlay:TimelineMax = new TimelineMax({repeat:-1}); AutoPlay.append(TweenMax.to(CLIPcontainer_mc, 3, {alpha:1, delay: 1})); AutoPlay.append(TweenMax.to(CLIPcontainer_mc, 3, {x:tab_x + -270, delay: 1})); AutoPlay.append(TweenMax.to(CLIPcontainer_mc, 3, {x:tab_x + -540, delay: 1})); AutoPlay.append(TweenMax.to(CLIPcontainer_mc, 1, {alpha:0})); AutoPlay.restart(); CLIPcontainer_mc.mc1_mc.addEventListener(MouseEvent.CLICK, test) CLIPcontainer_mc.mc2_mc.addEventListener(MouseEvent.CLICK, test2) CLIPcontainer_mc.mc3_mc.addEventListener(MouseEvent.CLICK, test3) function test(event:MouseEvent):void{trace("C1"); AutoPlay.pause();} function test2(event:MouseEvent):void{ trace("C2"); AutoPlay.append(TweenMax.to(CLIPcontainer_mc, 3, {x:tab_x + -270, delay: 1, onComplete: GO})); function GO():void { trace('onComplete:Pause working!'); AutoPlay.pause(); } } function test3(event:MouseEvent):void{trace("C3"); AutoPlay.pause();} [/as]
  3. Yes I totally missed that. Thanks for clarifying for me.
  4. I got this to work: var photo = document.getElementById("box"); TweenLite.to(photo, 1.5, {css:{width:"200px"}}); The documentation mentioned that this would work but had no luck: var photo = document.getElementById("photo"); TweenLite.to(photo, 1.5, {width:200});
  5. Thanks guys, I sent over the code with the wrong variable but I had tried it with the box variable set up correctly and was still a no go. So I have to use the CSS plugin to change the size? I did have that commented out in my code. That worked fine. The example in the documentation wasn't workign out for me though which would have been: var photo = document.getElementById("photo"); TweenLite.to(photo, 1.5, {width:100}); Is the first exaple in the getting started guide.
  6. I decided to try this out today. I was able to get stuff tweening around when I use the css plugin but I can't get the first example to work. var photo = document.getElementById("#box"); TweenLite.to(box, 1.5, {width:200}); I attached a very basic example. Can someone tell me what I did wrong? I had some developers at my job take a stab with no luck.
  7. I'm trying to make a scrolling text field in a file I'm working on. The problem I am having is that no matter what I do the text eases in and slows down at the end of the tween. I have tried the code below with no luck: TweenLite.to(text1_txt, 30, {x:-2000, y:464, ease:"None"}); TweenLite.to(text1_txt, 30, {x:-2000, y:464, ease:"Linear.easeNone"}); Can someone explain what I need to do to get a linear tween? Thanks in advance - John PS: I would have searche dthe forums for "how to turn off easing in a tweeen" but the forum won't allow me.
  8. Hmm, I see what you mean. What I have is a 3 tab menu that opens as you click on the tab and will unmask and article in each tab. I'm having a problem getting that to work right. I cant figure out how to be able to get to the scrollbars under the masks if that makes sense.
  9. I was hoping someone can help me out. I need to scale a movieclip. Right now I'm only able to stretch a movieclip. What I'm trying to do is have a movieclip that I want to have a mask inside of. When the movieclip scales it should mask and unmask whats inside of the movieclip. Because I am stretching the movieclip, its stretching everything inside the movieclip which I don't want. Here is a simple piece of code. Can someone tell me how to scale instead of stretch please import com.greensock.*; TweenLite.to(mc, 1, {scaleY:1.3});
  10. Hi Carl, Thanks for getting back to me so quick. In a nutshell I am stretching a mask. I was using: ScaleX when I should have been using Width as you pointed out. Thanks so much for your help.
  11. How would I specify the exact distance then? I want to go about 40 pixels out from my 300 pixel box and then back
  12. I was hoping someone could help me out. This should be really simple and I cant figure it out. So I have an ad that I am working on. Its 300x250 and it expands to lets say 560. I have a mask thats 300x250 and I want to animate that open to the length of 560 and when the user clicks the close button it needs to go back to 300. Ive done it before and today I cant get it to work. What's happening in my code is the mask animates to the right and never stops. If I pull the window open the mask opens infinately. This is my code and I have attached a simple file with my code inside if thats easier Thanks ahead of time for the help. import flash.events.MouseEvent; import com.greensock.*; import com.greensock.easing.*; Open.addEventListener(MouseEvent.CLICK, OpenNow) function OpenNow(e:MouseEvent):void{ TweenLite.to(Mask,2,{scaleX:560, ease:Expo.easeIn}); } Close.addEventListener(MouseEvent.CLICK, CloseNow) function CloseNow(e:MouseEvent):void{ TweenLite.to(Mask,2,{scaleX:0, ease:Expo.easeIn}); }
  13. Cool. I'm going to give it a try. Thanks for the reply.
  14. I was checking out the the new plugin and I was thinking about how I could use this for a new rich media ad I'm going to be working on soon. What my question is and there is prob not a short answer for this question. I want to make my ad function like this sweet HTML5 site for Tron : http://disneydigitalbooks.go.com/tron/ (Drag the site from right to left) How hard would it be to figure out how to move things on the stage based on position of the dragged portion of the stage or scroller on the stage? I want to move the ad from right to left and as a certain portion of the stage comes into view so would products videos and text in the way that the Tron site is functioning
  15. Thanks Carl I'll give this a go in the morning and keep the code on hand for next time. I appreciate the time you put in to show me this. - John
  16. There is a prob an easy solution to this. I'm having a hard time finding the logic that I need. So I have a window that needs to open and close on the click of a button. so first click window opens. Second click window closes. This is what i think my code will kind of look like but doesn't work. I don't know how to structure the logic. can someone help me out? import flash.events.MouseEvent; import com.greensock.*; import com.greensock.easing.*; container_mc.find_more_btn.addEventListener(MouseEvent.CLICK, myFunction); function myFunction(event:MouseEvent):void { if(event.type == "Click"){ TWEEN FORWARD }else if(event.type == "Click++"){ TWEEN BACK }
  17. Thanks guys this really helped me figure out an animation that I needed for a project at work. I'll be using these tips for the next projects as well.
  18. I figured out what I need to do with what you showed me but I'm still stumped on tl.append( ... ); This is how I have my code set up and its workign good. IS there anything else I can do to streamline this: b1.addEventListener(MouseEvent.ROLL_OVER, test) b2.addEventListener(MouseEvent.ROLL_OVER, test) b3.addEventListener(MouseEvent.ROLL_OVER, test) b4.addEventListener(MouseEvent.ROLL_OVER, test) function test(evt:Event):void{john.pause();} var john:TimelineMax = new TimelineMax({repeat:-1}); john.append(TweenMax.to(b1, 1, {scaleX:1, scaleY:1, rotation:360})); john.append(TweenMax.to(b1, 1, {scaleX:.8, scaleY:.8, rotation:-360})); john.append(TweenMax.to(b2, 1, {scaleX:1, scaleY:1, rotation:360})); john.append(TweenMax.to(b2, 1, {scaleX:.8, scaleY:.8, rotation:-360})); john.append(TweenMax.to(b3, 1, {scaleX:1, scaleY:1, rotation:360})); john.append(TweenMax.to(b3, 1, {scaleX:.8, scaleY:.8, rotation:-360})); john.append(TweenMax.to(b4, 1, {scaleX:1, scaleY:1, rotation:360})); john.append(TweenMax.to(b4, 1, {scaleX:.8, scaleY:.8, rotation:-360}));
  19. So would it look something like this? var tl:TimelineMax = new TimelineMax({repeat:-1}); tl.append( ... ); timeline.append(TweenLite.to(b2, 2, {scaleX:1, scaleY:1, rotation:360}); timeline.append(TweenLite.to(b3, 2, {scaleX:1, scaleY:1, rotation:360}); I'm confused with tl.append( ... );
  20. Sweet, I'll give that a try right now
  21. Thanks for the reply. I'll give that a try tomorrow. If you don't mind me asking another question. Say I had a set of Tweens that I wanted to run in a specific order. I know I can use timeline lite to do this but what I need to do is play this chain of animations until someone hovers over them. How would I break out of the order and move to a new function?
  22. The reason I was trying to add that code to the enter_frame function is because I need this ad that I'm making to run a sequence of circle animations and when the user clicks on one then the animation will stop and animate on roll over only. Sorry if this msg is slightly convoluted. I'm writing from my phone in a car. Is there a better wAy to do this? Is there a way to chain some Tweens together and repeat them in the same way?
  23. I have a couple of animations that I need to append to each other in timeline lite on ENTER_FRAME and then I need to stop the animation sequence when a user clicks one of the buttons animating in the sequence. Do I have my code correct? I can't get the timeline lite classes to work for me at all even in a quick test. NOTE: I would be working on this in the timeline and not in a class file [as] addEventListener(Event.ENTER_FRAME, AnimateCircles) function AnimateCircles(evt:Event):void { var john:TimelineLite = new TimelineLite(); timeline.append(TweenLite.to(b1, 2, {scaleX:1, scaleY:1, rotation:360}); timeline.append(TweenLite.to(b2, 2, {scaleX:1, scaleY:1, rotation:360}); timeline.append(TweenLite.to(b3, 2, {scaleX:1, scaleY:1, rotation:360}); } [/as]
  24. I'm trying to get a constant rotation from Tween max on rollover. I'm able to do it with actionscript but I am going to need to do this several times for different objects so I don't want to use this code. Can someone take a look at my code and point me n the right direction? // Add Listener to the Rotate Button mc2_mc.addEventListener(MouseEvent.MOUSE_OVER, rotateButtonOver); function rotateButtonOver(evt:MouseEvent):void { // Add ENTER_FRAME Event Listener to the stage addEventListener(Event.ENTER_FRAME, startRotate); } function startRotate(evt:Event):void { // Call function rotateSquare rotateSquare(); } function rotateSquare():void { // Rotate the MovieClip mc2_mc.rotation += 10; }
  25. This is the effect that I want to achieve: // Add Listener to the Rotate Button mc2_mc.addEventListener(MouseEvent.MOUSE_OVER, rotateButtonOver); function rotateButtonOver(evt:MouseEvent):void { // Add ENTER_FRAME Event Listener to the stage addEventListener(Event.ENTER_FRAME, startRotate); } function startRotate(evt:Event):void { // Call function rotateSquare rotateSquare(); } function rotateSquare():void { // Rotate the MovieClip mc2_mc.rotation += 10; }
×