Hola
arme esta pag http://www.figueredoad.com.ar/index_02.html
y en una d las secciones tengo q linkear los textos q aparecen, para eso hice d cada frase un movie transparente,
en la linea d tiempo puse este codigo
}
this[array[i]].onPress = function() {
incoterms.onPress=function(){
getURL('http://www.figueredoad.com.ar/incoterms.html');
}
les paso todo el codigo para ver si alguien puede descubrir q es lo q esta mal,
porq lo revise mil veces y no lo encuentro...
import flash.geom.Rectangle;
b5._y=100;
function createAccordion(width:Number,height:Number,array:A rray){
var root=this;
trace(root);
var movieClipArray:Array=array;
var movieClipWidth:Number=width;
var movieClipHeight:Number=height;
var position:Number=0;
var fake:Array=new Array();
for(var i:Number=0;i<array.length;i++){
root[movieClipArray[i]]._y=0;
root[movieClipArray[i]].scrollRect=new Rectangle(0,0,movieClipWidth,movieClipHeight);
fake.push(new Object());
fake[i].scrollX=0;
fake[i].scrollY=0;
fake[i].scrollWidth=movieClipWidth;
fake[i].scrollHeight=movieClipHeight;
//Rollover function caller
this[array[i]].onRollOver = function() {
for(var n:Number=0;n<movieClipArray.length;n++){
if(root[movieClipArray[n]]==this){
position=n;
arrange();
}
}
}
this[array[i]].onPress = function() {
incoterms.onPress=function(){
getURL('http://www.figueredoad.com.ar/incoterms.html');
}
}
}
function arrange(){
for(var i:Number=0;i<movieClipArray.length;i++){
if(i<position){
fake[i]._x=i*(movieClipWidth/movieClipArray.length)+1;
fake[i].scrollX=movieClipWidth/2-movieClipWidth/movieClipArray.length;
fake[i].scrollY=0;
fake[i].scrollWidth=movieClipWidth/movieClipArray.length;
fake[i].scrollHeight=movieClipHeight;
}
if(i==position){
fake[i]._x=i*(movieClipWidth/movieClipArray.length);
fake[i].scrollX=0;
fake[i].scrollY=0;
fake[i].scrollWidth=movieClipWidth;
fake[i].scrollHeight=movieClipHeight;
}
if(i>position){
fake[i]._x=(i-1)*(movieClipWidth/movieClipArray.length)+movieClipWidth-1;
fake[i].scrollX=movieClipWidth/2-movieClipWidth/movieClipArray.length;
fake[i].scrollY=0;
fake[i].scrollWidth=movieClipWidth/movieClipArray.length;
fake[i].scrollHeight=movieClipHeight;
}
}
}
root.onEnterFrame=function(){
for(var i:Number=0;i<movieClipArray.length;i++){
var rect:Rectangle=root[movieClipArray[i]].scrollRect;
if(root[movieClipArray[i]]._x<fake[i]._x){
root[movieClipArray[i]]._x+=(fake[i]._x-root[movieClipArray[i]]._x)/2;
}else{
root[movieClipArray[i]]._x-=(root[movieClipArray[i]]._x-fake[i]._x)/2;
}
if(rect.x<fake[i].scrollX){
rect.x+=Math.floor((fake[i].scrollX-rect.x)/2);
}else{
rect.x-=Math.floor((rect.x-fake[i].scrollX)/2);
}
if(rect.width<fake[i].scrollWidth){
rect.width+=Math.floor((fake[i].scrollWidth-rect.width)/2);
}else{
rect.width-=Math.floor((rect.width-fake[i].scrollWidth)/2);
}
root[movieClipArray[i]].scrollRect=rect;
}
}
arrange();
}
createAccordion(450,400,["b1","b2","b3","b4","b5"]);
eso es todo, en la linea 31 es dond puse el codigo para q linkee el mc (el nombre d instancia es incoterms)
Muchas gracias!