ÇØÇÇ ¾¾Áö¾ÆÀÌ¿¡¼ ¹ÞÀº ads_loader ¼Ò½ºÆÄÀÏÀ» ÆíÁýÇØ¼ »ç¿ëÇÏ·Á Çϴµ¥...
ù¹øÂ° ÅÇ ¸µÅ©°¡ ÀüÇô ÀâÈ÷Áö ¾Ê¾Æ¼ ¹®ÀÇ µå¸³´Ï´Ù.
¼Ò½º»ó ¹®Á¦°¡ ÀÖÀ»°Í°°¾Æ¼...Á¦´«À¸·Î º¸ÀÌÁö ¾Ê¾Æ¼ µµ¿òÁ» ¿äûµå·Áº¾´Ï´Ù.
[ÆÄÀÏ÷ºÎ]
----------- ³»¿ë -------------
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
System.security.allowDomain("*");
/**************/
var tab_array:Object = new Object()
tab_array["tab0"] = {content:"tab0_content", url:""}
tab_array["tab1"] = {content:"tab1_content", url:"../../index.php"}
tab_array["tab2"] = {content:"tab2_content", url:"../../index.php"}
tab_array["tab3"] = {content:"tab3_content", url:"../../index.php"}
var auto_array = new Array("tab0", "tab1", "tab2", "tab3");
var currentPorp = new Object();
prev = {tab:'', content:'', active:''}
var defaultTab = "tab0";
function setAction() {
for(var i in tab_array) {
var currentTab = i;
var current_mc = this[currentTab];
current_mc.onRollOver = setRollover;
current_mc.onRollOut = setRollOut;
current_mc.onRelease = setRelease;
//set url action
var target_mc = this[tab_array[currentTab].content];
target_mc._alpha = 0;
target_mc.onRelease = gotoURL;
if(i==defaultTab) {
showTab(defaultTab);
}
}
}
//run this code
setAction();
function setRollover(evt) {
var current_mc = this;
current_mc.gotoAndStop(2);
}
function setRollOut(evt) {
var current_mc = this;
if(prev.active != current_mc._name)
current_mc.gotoAndStop(1);
}
function setRelease(evt) {
var current_mc = this;
current_mc.gotoAndStop(2);
//prev.active = current_mc._name;
var url = tab_array[current_mc._name].url;
var target_mc = tab_array[current_mc._name].content;
var current_tab = current_mc._name;
currentPorp.url = url;
currentPorp.tab = current_tab;
currentPorp.target_mc = target_mc;
showTab(current_mc._name);
setCounter();
stopAutoScroll();
}
function setCounter() {
for(var i:Number=0;i<auto_array.length;i++) {
if(currentPorp.tab==auto_array[i]) {
counter = (i+0);
return;
}
}
}
function showTab(tab) {
var current_mc = this[tab];
//trace("prev.active " +prev.active + " tab " + tab);
if(prev.active!="") {
this[prev.active].gotoAndStop(1);
}
prev.active = tab;
//trace(" showTab prev.active " +prev.active + " tab " + tab);
current_mc.gotoAndStop(2);
var target_mc = this[tab_array[tab].content];
if(prev.content!="") {
new Tween(prev.content, "_alpha", easeIn.easeIn, 100, 0, 1, true);
}
prev.content = target_mc;
var bTween:Tween = new Tween(target_mc, "_alpha", easeIn.easeIn, 0, 100, 1, true);
bTween.onMotionFinished = function(evt) {
//trace("done");
}
}
function gotoURL() {
var current_mc = this;
trace("currentPorp.url" + currentPorp.url);
getURL(currentPorp.url);
}
/**********************/
var auto;
var counter = 1;
function autoScroll() {
if(counter>=auto_array.length) {
counter =0;
}
var tab = auto_array[counter];
showTab(tab);
counter++;
}
function stopAutoScroll() {
clearInterval(auto);
auto = setInterval(autoScroll, 6000);
}
function startScroll() {
clearInterval(auto);
auto = setInterval(autoScroll, 6000);
}
startScroll();
/***************************/
----------ÀÌ»ó-------------