Action Script Memo
Just a memo to myself..
Taget movie clip
some_mc.gotoAndPlay("framelabel");
some_mc.gotoAndStop("framelabel");
Function
function showsome() {
some_mc._alpha = 100;
}
function hidesome() {
some_mc._alpha = 0;
}
Popup an external URL
this.some_btn.onRelease = function() {
getURL("http://www.go-redsox.com/index.php", "_blank");
};
(Has to end with file extension such as .html or .php… other wise, http://www.go-redsox.com/ will NOT work)
Tween class
import mx.transitions.Tween;
import mx.transitions.easing.*;
var ShowSome:Tween =
new Tween(some_mc, "_alpha", Regular.easeOut,
some_mc._alpha, 100, 5, true);
Click and make dragable (is that a wrod?)
this.some_mc.onPress = function():Void {
this.startDrag(false, 0, 0, -300, -100);
};
this.some_mc.onRelease = function():Void {
this.stopDrag();
};
this.some_mc.onRelease = function():Void {
this.stopDrag();
};
this.some_mc.onRelease = function():Void {
this.stopDrag();
};
// startDrag range: if you have 2000(w)x1200(h) image
// that you want to move in 750x500 window,
// it should be 0, 0, -1250 [750-2000], -750 [500-1200]
// make sure some_ms is placed at x:0 y:0
Including external .as file
#include "file.as"
Launching pop up with url
this.some_mc.some_btn.onRelease = function() {
getURL("http://www.daigo.org/", "_blank");
};
Launching pop up with url, Part 2,
this.some_mc.some_btn.onPress = function() {
getURL("javascript:popup('http://daigo.org','flashPopup',
'width=300,height=100')"); }
// didn't work...
Reading XML and get rid of annoying “'”
some_mc.some_txt.text =
sArray[number].split("'").join("'");
//Gets rid of '
Simple if
if(bArray[number] == 0) {
_root.some_mc.some_mc._alpha = 0;
}
else if(bArray[number] == 1) {
_root.some_mc.some_mc._alpha = 100;
}
Link: Kirupa.com
