Hey everyone and thanks for any help in advance. I’m using an array to store movie clips and use them to tween position around a central movieclip when pressed and then tween back to the center when pressed again. I would like the _x and _y positions to tween around the central movieclip in a clock-like postion.
As of now I’m using raduis and degrees to tr try to get this effect, but i’ve had many problems. Right now the movieclips just fan out in a straight line. Does anyone have any idea how to fix this. Here is the code:
/////// MX Transitions
import mx.transitions.*;
import mx.transitions.easing.*;
import mx.transitions.tween.*;
import caurina.transitions.*;
import flash.filters.BlurFilter;
import flash.filters.GlowFilter;
import flash.display.*;
//////// DROPSHADOW FILTER
//apply a filter to MC
var myFilter = new flash.filters.DropShadowFilter();
myFilter.angle = 35;
myFilter.distance = 2.5;
myFilter.color = 0x000000;
//menuOne
menuOne._x = Stage.width/2-menuOne.zero._width;
menuOne._x = Stage.height/2-menuOne.zero._height;
menuOne.onResize = function(){
menuOne.tween(["_x","_y"],[Stage.width/2-menuOne.zero._width,Stage.height/2-menuOne.zero._height],.3, "easeoutExpo",0);
};
Stage.addListener (menuOne);
menuOne.onResize();
////////MAIN NAV ROLLOVER CONTROLS
var groupinfo:Array = [menuOne.one,menuOne.two,menuOne.three,menuOne.four,menuOne.five,menuOne.six];
trace(groupinfo.length);
// assign functions to each event for each button in the group
function init(r:Number, x:Number, y:Number):Void {
for (var c in groupinfo) {
groupinfo[c].push;
groupinfo[c].onRollOver = doRollOver;
groupinfo[c].onRollOut = doRollOut;
groupinfo[c].onRelease = doClick;
var radius = 30;
var degree = 0;
var orbit = (degree/180)*Math.PI
var radian;
//
groupinfo[c].tween(["_x","_y"],[(Math.cos(orbit) * radius + menuOne.zero._x)*c, (Math.sin(orbit) * radius + menuOne.zero._y)*c],.7,"easeoutExpo",0);//controls X andY space between array elements
trace("groupinfo._x = "+groupinfo[c]._x);
trace("groupinfo._y = "+groupinfo[c]._y);
groupinfo[c].filters = [myFilter];//dropShadow
}
}
function init02(r:Number, x:Number, y:Number):Void {
for (var d in groupinfo) {
groupinfo[d].push;
groupinfo[d].tween(["_x","_y"],[0,0],.7,"easeoutExpo",0);//controls Y space between array elements
trace("groupinfo._x = "+groupinfo[c]._x);
trace("groupinfo._y = "+groupinfo[c]._y);
}
}
function checkInstance(input:MovieClip, arr:Array) {
var l:Number = groupinfo.length;
for(var i:Number=0;i<l;i++) {
var selectedItem:MovieClip = groupinfo*;
if (input == selectedItem) {
trace("selectedItem " + selectedItem._name+ " is in the arr");
}
}
}
// create a variable to track the currently selected button
var activebtn:MovieClip;
//define handler function for rollovers
function colorGo() {
this.tween("_alpha",50,.5,"easeOutSine");
}
function colorBack() {
this.tween("_alpha",100,.5,"easeOutSine");
}
function doRollOver():Void {
if (this != activebtn) {
this.onEnterFrame = colorGo;
trace(checkInstance(this, groupinfo*));
}
}
function doRollOut():Void {
if(this != activebtn) {
this.onEnterFrame = colorBack;
//trace(checkInstance(this, groupinfo*));
}
}
// doClick: 1) save a reference to previously active button, 2) update activebtn,
// 3) turn off previously active, 4) turn on current active
function doClick() {
var prevbtn:MovieClip = activebtn;
activebtn = this// update pointer to current selection
prevbtn.onRollOut();//update other movieClips
activebtn.enabled = false;//disabled pressed button
prevbtn.enabled = true;//enabled other buttons
clearInterval(myIntervalSlide03);//clear interval
}
////////////ZERO
press01 = true;
menuOne.zero.onRollOver = function(){
this.tween("_alpha",50,.5,"easeOutSine");
}
menuOne.zero.onRollOut = function(){
this.tween("_alpha",100,.5,"easeOutSine");
}
menuOne.zero.onRelease = function(){
if (press01 == true) {
init();
press01 = false;
trace("buttons Out");
} else {
init02();
press01 = true;
trace("buttons In");
}
}
any help would be appreciated,
thnx,
rmcnaugh…