
October 23rd, 2006, 11:25 AM
|
 |
I-Team User
|
|
Join Date: May 2006
Location: Florida
|
|
|
NEED HELP with flash Action script
hello all i dont' know much about flash but i found this animation that is using action script to animate.
I want to add something to the end of it or even have it redirect to another page after it runs. any help would be great.
thanx
here is the code,
Code:
// MATRIX SIMULATION 1.0
// Mike Corrigan
stop ();
var myNum:Number;
var myTimer:Number = setInterval (newClip, 40);
var counter:Number = 0;
var counter2:Number = 0;
var titleCounter:Number = 0;
var myTitle:String = new String("DEM TEK v1.0");
// format for webPage is ("www.mypage.com") or type "null" for no redirection// --- not compatible with some browsers
var webPage:String = new String(null);
var space:Boolean = false;
var alphaB:String = new String(" 1a[Z2b]Y3c|X4d}W5e{V6f'U7g;T8h.0S9i,R~j:Q'kP!lO@mN#nM$oL% pK^qJ&rI*sH(tG)uF_vE+wD-xC=yB\zA?><\"");
_root.createEmptyMovieClip ("topLine", getNextHighestDepth());
_root.attachMovie("finish", "finish", getNextHighestDepth(), {_x: Stage.width-(this._width+10), _y: 330})
_root["finish"].theTxt.text = "decoding... 0%";
_root["finish"]._alpha = 60;
mainTitle ();
centerIt();
function mainTitle () {
if (titleCounter < myTitle.length){
_root.topLine.attachMovie ("myLet", "myLet" + titleCounter, getNextHighestDepth(), {_x:27*titleCounter, _y:0});
trace(_root["topLine"]["myLet"+titleCounter]);
checkLets (_root["topLine"]["myLet"+titleCounter]);
centerIt();
}else{
_root["finish"].theTxt.text = "decoding complete.";
_root["finish"]._alpha = 80;
if (webPage != "null"){
_root["topLine"].onRelease = function(){
// send user to web page
getURL("http://" + webPage, "_blank", "GET");
}
}
}
}
function checkLets (myObj:MovieClip) {
// trace(myObj);
var testCount:Number = 0;
myObj.onEnterFrame = function(){
myObj.myLetter.text = alphaB.substr(testCount,1);
// the followign is a cool effect
// Selection.setFocus(myObj.myLetter);
if (myObj.myLetter.text == myTitle.substr(titleCounter,1)){
_root["finish"].theTxt.text = "decoding... " + Math.floor(((titleCounter+1)/myTitle.length)*100)+"%";
myObj.myLetter.text = myTitle.substr(titleCounter,1);
delete myObj.onEnterFrame;
titleCounter++;
mainTitle();
}else{
testCount++;
}
}
}
function centerIt(){
_root["topLine"]._x = (Stage.width/2)-(_root["topLine"]._width/2)+20;
_root["topLine"]._y = (Stage.height/2);
}
function newClip () {
myNum = randRange (1, 36) * 20;
_root.attachMovie ("block2", "block2" + counter2, getNextHighestDepth (), {_x:myNum, _y:-10});
myMove (_root["block2" + counter2]);
counter2++;
}
function randRange (min:Number, max:Number):Number {
var randomNum:Number = Math.floor (Math.random () * (max - min + 1)) + min;
return randomNum;
}
function myMove (myObj:MovieClip) {
myObj.onEnterFrame = function () {
if (myObj._y < 400) {
myObj._y += 20;
_root.attachMovie ("chars", "chars" + counter, getNextHighestDepth (), {_x:myObj._x, _y:myObj._y});
_root["topLine"].swapDepths(getNextHighestDepth());
_root["chars" + counter].gotoAndStop (randRange (1, 40));
myAlpha (_root["chars" + (counter - 1)]);
counter++;
} else {
removeMovieClip (myObj);
delete myObj.onEnterFrame;
}
};
}
function myAlpha (myObj:MovieClip) {
myObj.onEnterFrame = function () {
if (myObj._alpha > 0) {
myObj._alpha -= 5;
} else {
delete myObj.onEnterFrame;
removeMovieClip (myObj);
}
};
}
|