famousfeem
03-07-2010, 11:53 PM
I'm really a newbie to this but i'm already in school for it so hope to join the rest soon.
Oké my first post here:o,
if been truggeling with tweenlight to insert a button in my code. The tween part works fine but I can not find a way to insert a link on the object I'm tweening. (button1)
I left my comment there so you can see Im dutch and a real new newbie
//zet alles in een pakketje dan kan het extern worden gebruikt
package
{
import com.greensock.TweenLite;
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.*;
import flash.events.*;
button1_btn.addEventListener(MouseEvent.MOUSE_DOWN , mouseDownHandler);//als muis ingedrukt is muisdown uitvoeren
public class PhotoPanels extends MovieClip // importeer vanaf fla
{
public function PhotoPanels():void
{
addEventListener(Event.ENTER_FRAME, loop);
}
private function loop(e:Event):void
{
var distx:Number = mouseX /650; //bepaal de positie van de muis
var disty:Number = mouseY /450;
TweenLite.to(con, 2, {
rotationY:(-40 + (80*distx)), //bepaal hoeveel er gedraaid kan worden
rotationX:(40 - (80*disty)),
ease:Expo.easeOut
});
}
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.google.com/"));
}
Please help because getting stuck is no problem but never getting further is
Oké my first post here:o,
if been truggeling with tweenlight to insert a button in my code. The tween part works fine but I can not find a way to insert a link on the object I'm tweening. (button1)
I left my comment there so you can see Im dutch and a real new newbie
//zet alles in een pakketje dan kan het extern worden gebruikt
package
{
import com.greensock.TweenLite;
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.*;
import flash.events.*;
button1_btn.addEventListener(MouseEvent.MOUSE_DOWN , mouseDownHandler);//als muis ingedrukt is muisdown uitvoeren
public class PhotoPanels extends MovieClip // importeer vanaf fla
{
public function PhotoPanels():void
{
addEventListener(Event.ENTER_FRAME, loop);
}
private function loop(e:Event):void
{
var distx:Number = mouseX /650; //bepaal de positie van de muis
var disty:Number = mouseY /450;
TweenLite.to(con, 2, {
rotationY:(-40 + (80*distx)), //bepaal hoeveel er gedraaid kan worden
rotationX:(40 - (80*disty)),
ease:Expo.easeOut
});
}
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.google.com/"));
}
Please help because getting stuck is no problem but never getting further is