-
getURL"BArray[i]" in AArray[i].onRelease isn't work
Code:
var linkArray = new Array(A_url, B_url, C_url, D_url, E_url);
var btnArray = new Array(A_btn, B_btn, C_btn, D_btn, E_btn);
for (i=0; i<5; i++) {
btnArray[i]._alpha = 0;
btnArray[i].onRollOver = function() {
new Tween(this, "_alpha", Strong.easeIn, 0, 100, 0.5, true);
};
btnArray[i].onRollOut = function() {
new Tween(this, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
};
btnArray[i].onRelease = function() {
getURL(linkArray[this.i], "_self");<<< how it works?
};
}
linkarray are the urls extract from XML
btnArray are the movieClips instance name on stage
how can i work this out?
-
Flashmatics
The 'i' will contain the last value of the loop iteration use the following instead..the changes are hghlighted in bold
Code:
var linkArray = new Array(A_url, B_url, C_url, D_url, E_url);
var btnArray = new Array(A_btn, B_btn, C_btn, D_btn, E_btn);
for (i=0; i<5; i++) {
btnArray[i].id = i;
btnArray[i]._alpha = 0;
btnArray[i].onRollOver = function() {
new Tween(this, "_alpha", Strong.easeIn, 0, 100, 0.5, true);
};
btnArray[i].onRollOut = function() {
new Tween(this, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
};
btnArray[i].onRelease = function() {
getURL(linkArray[this.id], "_self");<<< how it works?
};
}
Hope it helps!!
-
thx for reply
i've try to trace(linkArray[this.i]) // undefined
doesn't work ...
-
does anyone have similar experiance on array in array ?
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
|