Hola he adaptado un menú tipo mac q adapte costa de un fla y tres clases, pero no me funciona hago clic en el botón para que abra otra página.
CLASE Main
package{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.net.navigateToURL;
import flash.net.URLRequest;
public class Main extends Sprite{
public function Main():void{
mc_star.addEventListener(MouseEvent.CLICK,buttonCl ick);
mc_gear.addEventListener(MouseEvent.CLICK,buttonCl ick);
mc_apple.addEventListener(MouseEvent.CLICK,buttonC lick);
mc_photo.addEventListener(MouseEvent.CLICK,buttonC lick);
/*mc_buy.addEventListener(MouseEvent.CLICK,buttonCl ick);
mc_contact.addEventListener(MouseEvent.CLICK,butto nClick);*/
}
private function buttonClick(e:MouseEvent):void{
var url:URLRequest=new URLRequest();
switch(e.target.name){
case "mc_star": url.url="http://www.estudio2caminos.com.ar/index.php"; break;
case "mc_gear": url.url="http://www.estudio2caminos.com.ar/estudio.php"; break;
case "mc_apple": url.url="http://www.estudio2caminos.com.ar/porfolio.php"; break;
case "mc_photo": url.url="http://www.estudio2caminos.com.ar/contacto.php"; break;
/*case "mc_buy": url.url="http://www.buy.com"; break;
case "mc_contact": url.url="http://www.contact.com"; break;*/
}
navigateToURL(url,"_blank");
}
}
}
CLASE OverButton
package{
import org.effects.DockButton;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
import com.greensock.TweenLite;
import com.greensock.plugins.TweenPlugin;
import com.greensock.plugins.TintPlugin;
public class OverButton extends DockButton{
private var _object:DisplayObject;
public function OverButton():void{
_object=this.getChildAt(0);
this.addEventListener(MouseEvent.MOUSE_OVER,mouseO ver);
this.addEventListener(MouseEvent.MOUSE_OUT,mouseOu t);
TweenPlugin.activate([TintPlugin]);
}
private function mouseOver(e:MouseEvent):void{
new TweenLite(_object,.5,{tint:0x990099});
}
private function mouseOut(e:MouseEvent):void{
new TweenLite(_object,.5,{tint:null});
}
}
}
CLASE DOCKBUTTON
package org.effects{
import flash.geom.Rectangle;
public class DockButton extends DockItem{
public function DockButton():void{
super(50,40,2);
buttonMode=true;
mouseChildren=false;
var bounds:Rectangle=getBounds(this);
this.graphics.beginFill(0,0);
this.graphics.drawRect(bounds.x,bounds.y,bounds.wi dth,bounds.height);
}
}
}
CLASE DOCKITEM
package org.effects{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import com.greensock.TweenLite;
public class DockItem extends Sprite{
private var _initPosition:Number;
public var maxXDistance:Number;
public var maxYDistance:Number;
public var maxScale:Number;
public function DockItem($maxXDistance:Number=60,$maxYDistance:Num ber=30,$maxScale:Number=2):void{
maxXDistance=$maxXDistance;
maxYDistance=$maxYDistance;
maxScale=$maxScale;
if(stage) init();
else addEventListener(Event.ADDED_TO_STAGE,init);
addEventListener(Event.REMOVED_FROM_STAGE,end);
}
private function init(e:Event=null):void{
_initPosition=x;
stage.addEventListener(MouseEvent.MOUSE_MOVE,mouse Move);
stage.addEventListener(Event.MOUSE_LEAVE,mouseLeav e);
}
private function mouseLeave(e:Event):void{
TweenLite.to(this,.3,{x:_initPosition,scaleX:1,sca leY:1});
}
private function mouseMove(e:MouseEvent):void{
var yDistance:Number=Math.abs(parent.mouseY-y);
if(yDistance>maxYDistance){
if(_initPosition==x) return;
else{
TweenLite.to(this,.3,{x:_initPosition,scaleX:1,sca leY:1});
return;
}
}
var xDistance:Number=parent.mouseX-_initPosition;
xDistance=xDistance>maxXDistance?maxXDistance:xDis tance;
xDistance=xDistance<-maxXDistance?-maxXDistance:xDistance;
var posX=_initPosition-xDistance;
var scale:Number=(maxXDistance-Math.abs(xDistance))/maxXDistance;
scale=1+(maxScale*scale);
TweenLite.to(this,.3,{x:posX,scaleX:scale,scaleY:s cale});
}
private function end(e:Event=null):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE,mo useMove);
stage.removeEventListener(Event.MOUSE_LEAVE,mouseL eave);
}
}
}
ESTE ES EL LINK DEL TUTORIAL
http://active.tutsplus.com/tutorials/actionscript/create-a-mac-dock-style-menu-with-as3/
ESTOS SON TODOS LOS ARCHIVOS INCLUIDA LA CLASE MAIN
http://www.4shared.com/file/257490590/36dce1b9/MacMenuSource.html
NO ENTIENDO QUE ES LO Q ESTOY HACIENDO MAL TODO FUNCIONA PERFECTO MENOS LOS LINKS!!!!!!!!!!!!!!!!