|
-
Senior Member
Here's your code:
Code:
// Action script...
// [Action in Frame 1]
function startSkills()
{
for (x = 0; x < skillList.length; x++)
{
skills_mc.duplicateMovieClip("s" + x, x + 1);
this["s" + x].skills_txt.autoSize = true;
this["s" + x].skills_txt.text = skillList[x];
this["s" + x].dir = 1;
skillsArray.push(this["s" + x]);
} // end of for
} // End of the function
function tweenSkills()
{
trace ("Tweening skills " + skillsArray.length);
var _loc2 = Math.round(Math.random() * (skillsArray.length - 1));
skillsArray[_loc2]._x = Math.max(Math.random() * Stage.width - skillsArray[_loc2]._width, 0);
skillsArray[_loc2].onEnterFrame = function ()
{
if (this._y > Stage.height + 75)
{
this._y = Stage.height;
this.dir = this.dir * -1;
this._x = Math.max(Math.random() * Stage.width - this._width, 0);
}
else if (this._y < -75)
{
this._y = -70;
this.dir = this.dir * -1;
this._x = Math.max(Math.random() * Stage.width - this._width, 0);
} // end else if
if (this._y > 0 && this._y < Stage.height)
{
this._alpha = Math.random() * 50 + 50;
}
else
{
this._alpha = 100;
} // end else if
this._y = this._y + this.dir;
};
skillsArray.splice(_loc2, 1);
if (skillsArray.length == 0)
{
trace ("Clearing interval");
clearInterval(st);
} // end if
trace (skillsArray);
} // End of the function
function moveMoon()
{
trace ("Moon");
var _loc1 = deg2rad(moon_mc.ang);
moon_mc._x = moon_mc.xc + moon_mc.rad * Math.cos(_loc1);
moon_mc._y = moon_mc.yc + moon_mc.rad * Math.sin(_loc1);
moon_mc.ang = moon_mc.ang + moon_mc.angC;
moon_mc.ang = moon_mc.ang % 360;
if (moon_mc.ang == 0)
{
moon_mc.ang = 175;
} // end if
trace (moon_mc.ang);
} // End of the function
function deg2rad(degree)
{
return (degree * 1.745329E-002);
} // End of the function
function updateClock()
{
var _loc1 = new Date();
var _loc4 = _loc1.getHours();
var _loc2 = _loc1.getMinutes();
var _loc3 = _loc1.getSeconds();
moon_mc.hh_mc._rotation = 30 * _loc4 + 30 * _loc2 / 60;
moon_mc.mh_mc._rotation = 6 * _loc2 + 6 * _loc3 / 60;
moon_mc.sh_mc._rotation = 6 * _loc3;
} // End of the function
function startOrbs()
{
var _loc4 = 1;
var _loc3 = -1;
for (x = 0; x < 20; x++)
{
_loc4 = _loc4 * -1;
_loc3 = _loc3 * -1;
orb_mc.duplicateMovieClip("orb" + x + "_mc", _root.getNextHighestDepth());
_root["orb" + x + "_mc"]._x = Math.random() * Stage.width;
_root["orb" + x + "_mc"]._y = Math.random() * Stage.height;
_root["orb" + x + "_mc"].ydir = _loc4;
_root["orb" + x + "_mc"].xdir = _loc3;
_root["orb" + x + "_mc"].onEnterFrame = function ()
{
if (this._y > Stage.height + 75)
{
this._y = Stage.height;
this.ydir = this.ydir * -1;
}
else if (this._y < -75)
{
this._y = -70;
this.ydir = this.ydir * -1;
} // end else if
if (this._x > Stage.width + 75)
{
this._x = Stage.width;
this.xdir = this.xdir * -1;
}
else if (this._x < -75)
{
this._x = -70;
this.xdir = this.xdir * -1;
} // end else if
this._alpha = Math.random() * 75 + 25;
this._y = this._y + this.ydir;
this._x = this._x + this.xdir;
};
} // end of for
} // End of the function
var st;
trace ("vfd main");
var skillList = new Array("ActionScript", "HTML", "JavaScript", "CSS", "PHP", "jQuery", "Prototype", "XML", "MySql", "Postgresql", "Flex", "AIR");
var skillNum = 0;
var skillsArray = new Array();
var dta = 50;
var st;
var ltin = new mx.transitions.Tween(welcome_mc, "_alpha", none, 100, 0, 5, true);
ltin.onMotionFinished = function ()
{
startSkills();
new mx.transitions.Tween(main_temple_mc, "_alpha", none, 0, 100, 2, true);
new mx.transitions.Tween(l_mount_mc, "_alpha", none, 0, 100, 2, true);
new mx.transitions.Tween(r_mount_mc, "_alpha", none, 0, 100, 2, true);
new mx.transitions.Tween(water_mc, "_alpha", none, 0, 100, 2, true);
new mx.transitions.Tween(moon_mc, "_alpha", none, 0, 100, 2, true);
startOrbs();
st = setInterval(tweenSkills, 5000);
};
moon_mc.xc = Stage.width / 2;
moon_mc.yc = Stage.height;
moon_mc.rad = 400;
moon_mc.ang = 225;
moon_mc.angC = 1;
moveMoon();
var orbit = setInterval(moveMoon, 8000);
updateClock();
setInterval(updateClock, 1000);
Where exactly is everything set? I guess I'm just having a bit of a hard time seeing things just right.
I can make things work, but only with angles in polar coordinates. I need it to be on a start and end X, Y plane, and that's where my troubles at.
Could you explain this a bit more? Thanks.
Also, if you'd like me to remove this post, let me k now and a I will, as I know it is your code.
Thanks for sharing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|