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?