Jump to content
GreenSock

joakimhoegset

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by joakimhoegset

  1. Hi I am trying to tween a few images and am getting two problems. After using ENTER_FRAME on event listener I cannot use any buttons to start tweens? Why is this? Second the tweens are flickering in on the first frames. All the tweens with omMove. Is there something else wrong here? Thanks, Joakim import com.greensock.*; //Visibility of the buttons bpublishApps_btn.visible = false; bplayerApps_btn.visible = false; bpublishWork_btn.visible = false; infernoWork_btn.visible = false; twinkWork_btn.visible = false; svenskWork_btn.visible = false; farrutxWork_btn.visible = false; addEventListener(Event.ENTER_FRAME, omMove); menu_mc.jobb_btn.addEventListener(MouseEvent.CLICK,jobbMove); function jobbMove(e:Event):void { TweenMax.to(pic.content_mc, 1, {y:-324.5}); bpublishApps_btn.visible = false; bplayerApps_btn.visible = false; bpublishWork_btn.visible = true; infernoWork_btn.visible = true; twinkWork_btn.visible = true; svenskWork_btn.visible = true; farrutxWork_btn.visible = true; } menu_mc.app_btn.addEventListener(MouseEvent.CLICK,appMove); function appMove(e:Event):void { TweenMax.to(pic.content_mc, 1, {y:324.5}); bpublishApps_btn.visible = true; bplayerApps_btn.visible = true; bpublishWork_btn.visible = false; infernoWork_btn.visible = false; twinkWork_btn.visible = false; svenskWork_btn.visible = false; farrutxWork_btn.visible = false; } menu_mc.om_btn.addEventListener(MouseEvent.CLICK,omMove); function omMove(e:Event):void { TweenMax.to(pic.content_mc, 1, {y:-973}); bpublishApps_btn.visible = false; bplayerApps_btn.visible = false; bpublishWork_btn.visible = false; infernoWork_btn.visible = false; twinkWork_btn.visible = false; svenskWork_btn.visible = false; farrutxWork_btn.visible = false; } menu_mc.kontakt_btn.addEventListener(MouseEvent.CLICK, goUrl); function goUrl(e:MouseEvent):void { navigateToURL(new URLRequest("mailTo:info@joakimhogset.com")); } //Event listener for Application buttons bpublishApps_btn.addEventListener(MouseEvent.CLICK,bpublishAppsMove); bplayerApps_btn.addEventListener(MouseEvent.CLICK,bplayerAppsMove); //Event listener for Work buttons bpublishWork_btn.addEventListener(MouseEvent.CLICK,bpublishWorkMove); infernoWork_btn.addEventListener(MouseEvent.CLICK,infernoWorkMove); twinkWork_btn.addEventListener(MouseEvent.CLICK,twinkWorkMove); svenskWork_btn.addEventListener(MouseEvent.CLICK,svenskWorkMove); farrutxWork_btn.addEventListener(MouseEvent.CLICK,farrutxWorkMove); //Functions for applications function bpublishAppsMove(e:Event):void { TweenMax.to(pic.content_mc.app_mc, 1, {x:0}); } function bplayerAppsMove(e:Event):void { TweenMax.to(pic.content_mc.app_mc, 1, {x:-1280}); } //Functions for work function bpublishWorkMove(e:Event):void { TweenMax.to(pic.content_mc.flash_mc, 1, {x:0}); } function infernoWorkMove(e:Event):void { TweenMax.to(pic.content_mc.flash_mc, 1, {x:-1280}); } function twinkWorkMove(e:Event):void { TweenMax.to(pic.content_mc.flash_mc, 1, {x:-2560}); } function svenskWorkMove(e:Event):void { TweenMax.to(pic.content_mc.flash_mc, 1, {x:-3840}); } function farrutxWorkMove(e:Event):void { TweenMax.to(pic.content_mc.flash_mc, 1, {x:-5120}); }
  2. I couldn't get that to work. I will send you the fla. What if I wanted to tween img1 and img2 together at the same time from y:100 to 1 in one second and img3 and img4 together at the same time from y:100 to 1 in one second with a 1 second delay from the first two clips and img5 and img6 together at the same time from y:100 to 1 in one second with 1 second delay from the second set of clips with no repeat? Thx, Joakim
  3. Here is the whole code. import com.greensock.*; import fl.motion.easing.*; var clips1:Array = [img1, img2, img3, img4, img5]; var clips2:Array = [img6, img7, img8, img9, img10]; //set them all to invisible and an alpha of 0 initially TweenMax.allTo(clips1.concat(clips2), 0, {autoAlpha:0}); //create the timeline var timeline:TimelineMax = new TimelineMax({repeat:-1}); //fade clips1 in timeline.appendMultiple(TweenMax.allTo(clips1, 3, {autoAlpha:1}, 0.5)); //fade clips1 out timeline.appendMultiple(TweenMax.allTo(clips1, 2, {autoAlpha:0}), 4); //fade clips2 in timeline.appendMultiple(TweenMax.allTo(clips2, 3, {autoAlpha:1}, 0.5)); //fade clips2 out timeline.appendMultiple(TweenMax.allTo(clips2, 2, {autoAlpha:0}), 4); big_btn.addEventListener(MouseEvent.ROLL_OVER, onClips); big_btn.addEventListener(MouseEvent.ROLL_OUT, offClips); // Move the arrows function onClips(e:MouseEvent):void { TweenMax.to(clips1, 1, {z:93}); TweenMax.to(clips2, 1, {z:-46}); } function offClips(e:MouseEvent):void { TweenMax.to(clips1, 1, {z:171}); TweenMax.to(clips2, 1, {z:0}); }
  4. Thanks but it doesn't get the clips1 and clips2. Only works when I input one tween for every img1 and ing2 etc Joakim
  5. Thanks I will go through that. Can I not do this though? big_btn.addEventListener(MouseEvent.ROLL_OVER, onClips); big_btn.addEventListener(MouseEvent.ROLL_OUT, offClips); // Move the arrows function onClips(e:MouseEvent):void { TweenMax.to(clips1, 1, {z:93}); TweenMax.to(clips2, 1, {z:-46}); } function offClips(e:MouseEvent):void { TweenMax.to(clips1, 1, {z:171}); TweenMax.to(clips2, 1, {z:0}); } Joakim
  6. Thanks I saw the repeat after posting it. Sorry for that. No I am using AS3. Just found that on Adobe. didn't really look through it. Putting it in a movieclip then I need to change the code to control the clip1 and 2 right? Do I just put the name of the first movie clip before the clips or img? movie.clips1 or movie.img1, movie.img2 etc... Joakim
  7. That is great thanks, Only one thing. Dump stuff into a container??? I am fairly new to as3 and don't know this. Found this on adobe: import flash.geom.Rectangle; var container:MovieClip = setUpContainer(); var window:Rectangle = new Rectangle(0, 0, 100, 40); container.scrollRect = window; function setUpContainer():MovieClip { var mc:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth()); mc._x = 50; mc._y = 50; mc.opaqueBackground = 0xCCCCCC; var content:MovieClip = mc.createEmptyMovieClip("content", mc.getNextHighestDepth()); var colors:Array = [0xFF0000, 0x0000FF]; var alphas:Array = [100, 100]; var ratios:Array = [0, 0xFF]; var matrix:Object = {a:150, b:0, c:0, d:0, e:150, f:0, g:150, h:150, i:1}; content.beginGradientFill("linear", colors, alphas, ratios, matrix); content.lineTo(300, 0); content.lineTo(300, 300); content.lineTo(0, 300); content.lineTo(0, 0); content.endFill(); content._rotation = -90; mc.onEnterFrame = function() { this.content._y += 1; } return mc; } Does this have anything to do with it? My rectangle is w:753 h:130 Thanks for all your help. Joakim
  8. Hi you can try to use yoyo instead. private function bounceUp():void { bounceUpTween = TweenMax.to(this, 0.5, {y: "-50", repeat:-1, yoyo:true} ); } I assume this is a roll_over function so on the roll_out you can use private function bounceDown():void { bounceUpTween = TweenMax.to(this, 0.5, {y: "original y position"} ); } This gets it back to its original position from where it is at the moment. Joakim
  9. Hi I have been trying to get my head around the multiple clip stacking. I am trying to have five clips go from alpha 0 to 1 with a delay of 0.5sec. After they are all finished they should be visible for 5sec before fading out again. After fading out another set of five mc goes from alpha 0 to 1 with a delay of 0.5sec. After they are all finished they should be visible for 5sec before fading out again. and after this finishes it starts over again with the first five clips. There is one more problem I want to have a mouse over that increases all content in size with 0.2 or preferably increase z axel using a mask to contain within the size of the "stage". This of course on roll out goes back. I get that this is a little unclear what I want but if all the clips were in one movie clip and increase the z they will make it feel like it is moving in space but if you just increase them one and one they will just feel like they are increasing in size. Thanks, Joakim
  10. Hi I am sure this is quite easy but I need help. I want to have a movieclip animate from x:115 to 205 and y:55 to 33 This action should be on MOUSE_OVER and yoyo back and forth when the mouse is over a button. When the mouse is out of the button is should go from where it is currently and back to x:115 y:55. How do I do this? Thanks for any help. Joakim
×