-
how to include multiple links in as3.0 transitions slideshow
we created thumbnail image gallery slideshow by using action script with auto and manual,. my requirement is , how to include multiple text link in each and every slideshow. below i mention the script code,
code start here
/********/
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
System.security.allowDomain("*");
/**************/
var tab_array:Object = new Object()
tab_array["tab1"] = {content:"tab1_content"}
tab_array["tab2"] = {content:"tab2_content"}
tab_array["tab3"] = {content:"tab3_content"}
tab_array["tab4"] = {content:"tab4_content"}
var auto_array = new Array("tab1", "tab2", "tab3", "tab4");
var currentPorp = new Object();
prev = {tab:'', content:'', active:''}
var defaultTab = "tab1";
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+1);
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, 4000);
}
function startScroll() {
clearInterval(auto);
auto = setInterval(autoScroll, 4000);
}
startScroll();
/***************************/
code ends here.
i was included text link in in each slideshow (ie. tab_content_movieclip), its working but that links displayed in all slideshow.
for my demo link http://www.franklincovey.com/tc/ (flash_banner).
actually they done that the flash video in xml. Is it possible to make in actionscript 2.0 or 3.0 by using the above code?
pls check out the attachments
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
|