Core tips: Flash AS3 to make a rotating circular web navigation tutorial for personalities.
Flash AS3 to make a rotating circular web page with personality.
1. Draw a black rectangle with rectangular tool, convert to MC movie clip, open Properties window
2. Double-click the movie clip to edit it, use the Text tool, set as dynamic text, draw an area, set the color to white, and name the instance named Abelbtn.
3, back to scene 1, delete the newly created movie clips.
4, we select the first frame, and then open the Action panel, enter the following code, mainly to import Tweenlite engine.
Import com.greensock.*;
Import com.greensock.easing.*;
5, and then create a number that dynamically invokes the item text for each menu.
var menu_items:array = ["Home", "About ME", "PORTFOLIO", "BLOG", "contact"];
var menu:sprite = new Sprite ();
Menu.x= STAGE.STAGEWIDTH/2;
MENU.Y=STAGE.STAGEHEIGHT/2;
AddChild (menu);
6, use a function Buildmenu to implement each menu item.
function Buildmenu () {
var Btn:mybutton;
var angle:int=360/menu_items.length;
for (var i:int = 0; i< menu_items.length; i++) {
BTN = new MyButton ();
Btn.buttonmode=true;
Btn.labelBtn.text = Menu_items[i];
Btn.mousechildren=false;
Menu.addchild (BTN);
Tweenlite.to (btn,2,{rotation:-i*angle,ease:bounce.easeout});
}
}
7, the last to add a listener click event code.
Menu.addeventlistener (Mouseevent.click,clickhandler);
function ClickHandler (e:mouseevent): void{
To do ...
Trace (MyButton (e.target). Labelbtn.text);
}
8, all the code is as follows.
Import com.greensock.*;
Import com.greensock.easing.*;
var menu_items:array = ["Home", "About ME", "PORTFOLIO", "BLOG", "contact"];
var menu:sprite = new Sprite ();
Menu.x= STAGE.STAGEWIDTH/2;
MENU.Y=STAGE.STAGEHEIGHT/2;
AddChild (menu);
Buildmenu ();
function Buildmenu () {
var Btn:mybutton;
var angle:int=360/menu_items.length;
for (var i:int = 0; i< menu_items.length; i++) {
BTN = new MyButton ();
Btn.buttonmode=true;
Btn.labelBtn.text = Menu_items[i];
Btn.mousechildren=false;
Menu.addchild (BTN);
Tweenlite.to (btn,2,{rotation:-i*angle,ease:bounce.easeout});
}
}
Menu.addeventlistener (Mouseevent.click,clickhandler);
function ClickHandler (e:mouseevent): void{
To do ...
Trace (MyButton (e.target). Labelbtn.text);
1 Full text reading tips: Try the "←→" button, turn the page more convenient Oh!