[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Section 1 (1.16 KiB) ●
//BTextBox (BTextBox)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class BTextBox extends MovieClip {
public var vartext:TextField;
public var newtext;
public var framecount;// = 0
public var pauseframes;// = 0
public var wasshown;// = false
public var inoutspeed;// = 0.15
public var fade;// = 0.6
public var pausespeed;// = 1
public function BTextBox(){
this.alpha = 0;
vartext.text = "More text";
this.addEventListener(Event.ENTER_FRAME, newFrame);
}
public function ChangeText(_arg1){
vartext.text = _arg1;
}
public function newFrame(_arg1:Event){
if (this.alpha <= fade){
if (wasshown == false){
this.alpha = (this.alpha + inoutspeed);
};
};
if ((((wasshown == true)) && ((this.alpha >= 0)))){
this.alpha = (this.alpha - inoutspeed);
};
if ((((this.alpha <= 0)) && ((wasshown == true)))){
this.removeEventListener(Event.ENTER_FRAME, newFrame);
this.parent.removeChild(this);
};
if (this.alpha > fade){
if (pauseframes <= pausespeed){
pauseframes++;
} else {
wasshown = true;
};
};
}
}
}//package
Section 2 (1.16 KiB) ●
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
public class Main extends MovieClip {
public var newbox:MovieClip;
public var counter;// = 20
public var textboxx;
public var textboxy;
public var tranceArray:Array;
public var textlinger;// = 5
public function Main(){
tranceArray = new Array();
super();
this.addEventListener(Event.ENTER_FRAME, newFrame);
tranceArray = ["Silly Dashie", "Good Dashie", "Twitcha-twitch!", "Smile!", "Silly and Sleepy", "And Slipping and Sleeping", "Less think, more sink", "No speed, just need"];
}
public function newFrame(_arg1:Event){
var _local2:*;
var _local3:*;
if (counter >= textlinger){
counter = 0;
_local2 = randomRange(0, 7);
textboxx = randomRange(100, 450);
textboxy = randomRange(50, 450);
newbox = new BTextBox();
this.addChild(newbox);
_local3 = tranceArray[_local2];
newbox.ChangeText(_local3);
newbox.x = textboxx;
newbox.y = textboxy;
trace("hello");
} else {
counter++;
};
}
public function randomRange(_arg1, _arg2){
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
}
}//package