Jump to content
Search Community

Fab

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Fab's Achievements

0

Reputation

  1. Hi there. I´m trying to set a Tweenlite to my movieclip that moves according to the mouse movement but the problem is that my MC doesn´t stay that centered when i´m hovering with the mouse. It looks a bit strange, like it doesn´t adjust to keep the movieclip centered. I can see the movieclip aside a bit. I have this code: private function onMove(e:Event):void { var distx:Number = mouseX / 1900; var disty:Number = mouseY / 1200; TweenLite.to(cont3, 2, { rotationY:(-70 +(145*distx)), rotationX:(70 -(140*disty)), ease:Expo.easeOut }); } I´ve tried to change the values but it only gets worse. The movement of the movieclip is exactly like this website: http://www.bbc.co.uk/switch/meta4orce/launch.shtml You see,the Menu adjusts with the mouse movement and it centers itself depending if the mouse is hovering it or not. I can´t coordinate mine to look like that. Is there another way to code this movement instead of what i have? Anyone care to share the same experiences if they had to do something like this? Thanks for your help.
  2. Ok the problem displaying the con3 movieclip is solved now. The next task is to display videos when the user presses the links inside the con3 movieclip. These links are movieclips also. How can i make that so that the videos display somewhere on the stage?
  3. What i was casting was the movie clip enlarge var mc:MovieClip = MovieClip(e.currentTarget); TweenLite.to(mc.enlarge, 0.2, { alpha:0 }); I forgot to put it on stage. It´s ok now but i still want to ask you another thing because i´m still along way out from finishing my project. If you see in my code i´ve made the movieclips rotating when the mouse hovers the stage. I´m following this tutorial http://www.gotoandlearn.com/play.php?id=103 and i want to have the same effect but with the style from this website from bbc: http://www.bbc.co.uk/switch/meta4orce/launch.shtml When i press the movieclip container2 i want it to open the container3 that is on frame 10 but when i do that the container2 stops rotating and just stays static. Here´s the code: package { import com.greensock.TweenLite; import com.greensock.TweenMax; import com.greensock.*; import com.greensock.easing.*; import flash.display.*; import flash.events.*; public class Painel extends MovieClip { private var inFocus:MovieClip; public function Painel():void { setupClips(); addEventListener(Event.ENTER_FRAME, loop); } private function setupClips():void { var len:int = con2.numChildren; for(var i:int=0; i { var mc:MovieClip = MovieClip(con2.getChildAt(i)); mc.buttonMode = true; mc.loc = [mc.x, mc.y]; mc.addEventListener(MouseEvent.ROLL_OVER, onOver); mc.addEventListener(MouseEvent.ROLL_OUT, onOut); mc.addEventListener(MouseEvent.CLICK, onClick); } } private function onOver(e:MouseEvent):void { var mc:MovieClip = MovieClip(e.currentTarget); TweenLite.to(mc.enlarge, 0.2, { alpha:1 }); } private function onOut(e:MouseEvent):void { var mc:MovieClip = MovieClip(e.currentTarget); TweenLite.to(mc.enlarge, 0.2, { alpha:0 }); } private function onClick(e:MouseEvent):void { var mc:MovieClip = MovieClip(e.currentTarget); if(inFocus == null) { gotoAndPlay(10); } } private function loop(e:Event):void { var distx:Number = mouseX / 650; var disty:Number = mouseY / 450; TweenLite.to(con2, 2, { rotationY:(-70 +(140*distx)), rotationX:(70 -(140*disty)), ease:Expo.easeOut }); } } } How can i keep both rotating even on frame 10? After that i want to display videos from the 4 buttons i have inside container3 just like in the BBC website. Can you help me with that?
  4. Thanks for the help guys. I had to download a trial of Flash CS5 to put this working. It now works but i´m having a new problem with the project. I´m having the erro #1009. TypeError: Error #1009: Cannot access a property or method of a null object reference at com.greensock::TweenLite/init() at com.greensock::TweenLite/renderTime() at com.greensock.core::SimpleTimeline/renderTime() at com.greensock::TweenLite$/updateAll() This is my code package { import com.greensock.TweenLite; import com.greensock.TweenMax; import com.greensock.*; import com.greensock.easing.*; import flash.display.*; import flash.events.*; public class Painel extends MovieClip { public function Painel():void { setupClips(); addEventListener(Event.ENTER_FRAME, loop); } private function setupClips():void { var len:int = con2.numChildren; for(var i:int=0; i { var mc:MovieClip = MovieClip(con2.getChildAt(i)); mc.buttonMode = true; mc.loc = [mc.x, mc.y]; mc.addEventListener(MouseEvent.ROLL_OVER, onOver); mc.addEventListener(MouseEvent.ROLL_OUT, onOut); mc.addEventListener(MouseEvent.CLICK, onClick); } } private function onOver(e:MouseEvent):void { var mc:MovieClip = MovieClip(e.currentTarget); TweenLite.to(mc.enlarge, 0.2, { alpha:1 }); } private function onOut(e:MouseEvent):void { var mc:MovieClip = MovieClip(e.currentTarget); TweenLite.to(mc, 0.2, { alpha:0 }); } private function onClick(e:MouseEvent):void { } private function loop(e:Event):void { var distx:Number = mouseX / 650; var disty:Number = mouseY / 450; TweenLite.to(con2, 2, { rotationY:(-70 +(140*distx)), rotationX:(70 -(140*disty)), ease:Expo.easeOut }); } } } I have 5 movieclips inside the con2 movieclip and i´ve tried to instance them before but it didn´t work. When i load my SWF i hover the mouse over each MC butflash gives this error and the MC`s disappear from the scene. Can you help?
  5. I´m actually using Flash CS3 which is still using Flash Player 9 From your question i guess i will have to download Flash cs4 at least.
  6. Hello there everyone I´ve came across this forum because i have been searching for solutions to my project problem. I´m folowing this tutorial http://www.gotoandlearn.com/play.php?id=103 but my container (which i have given the instance name of con) movieclip doesn´t work,it just stays static instead of responding to my mouse movement. The code i have is this: package { import com.greensock.TweenLite; import com.greensock.TweenMax; import com.greensock.*; import com.greensock.easing.*; import flash.display.*; import flash.events.*; public class Painel extends MovieClip { public function Painel():void { addEventListener(Event.ENTER_FRAME, loop); } private function loop(e:Event):void { var distx:Number = mouseX / 650; var disty:Number = mouseY / 450; TweenLite.to(con, 2, { rotationY:(-70 +(140*distx)), rotationX:(70 -(140*disty)), ease:Expo.easeOut }); } } } Somehow the words "rotation" doesn´t show in blue in my .as but they are blue in the tutorial. I don´t think i´ve missed anything in the code from the tutorial for rotation not showing in blue which i guess that´s the main problem. I don´t have any sort of errors in the code and the ones i had i´ve already solved coming to this website. Thanks fro your help in advance. The deadline to finish this project is near.
×
×
  • Create New...